30 for(std::size_t i = 0; i < arguments.size(); i++)
33 if(std::string(arguments[i], 0, 2) ==
"--")
37 if(arguments[i] ==
"--verbosity")
39 if(i < arguments.size() - 1)
41 set(arguments[i], arguments[i + 1]);
46 else if(!arguments[i].empty() && arguments[i][0] ==
'@')
65 std::vector<std::string> arguments;
68 for(
int i = 1; i < argc; i++)
69 arguments.push_back(argv[i]);
71 return parse(arguments);
74 static std::istream &
my_wgetline(std::istream &in, std::wstring &dest)
103 dest += wchar_t(ch1 + (ch2 << 8));
111 std::ifstream infile(file);
115 std::cerr <<
"failed to open response file '" << file <<
"'\n";
121 getline(infile, line);
123 line.size() >= 2 && line[0] ==
static_cast<char>(0xff) &&
124 line[1] ==
static_cast<char>(0xfe))
143 while(std::getline(infile2, wline))
149 line.size() >= 3 && line[0] ==
static_cast<char>(0xef) &&
150 line[1] ==
static_cast<char>(0xbb) && line[2] ==
static_cast<char>(0xbf))
156 while(getline(infile, line))
163 while(getline(infile, line))
180 std::vector<std::string> arguments;
182 bool in_quotes =
false;
183 for(std::size_t i = 0; i < line.size(); i++)
187 if(ch ==
' ' && !in_quotes)
190 arguments.push_back(option);
195 in_quotes = !in_quotes;
202 arguments.push_back(option);
216 std::cout <<
"Warning: uninterpreted non-LINK option '" << s <<
"'\n";
225 "ASSEMBLYLINKRESOURCE",
230 "CLRLOADEROPTIMIZATION",
231 "CLRSUPPORTLASTERROR",
232 "CLRTHREADATTRIBUTE",
233 "CLRUNMANAGEDCODECHECK",
270 "MANIFESTDEPENDENCY",
315 std::string result = s;
325 if(s[0] !=
'/' && s[0] !=
'-')
335 to_upper_string(std::string(s, 1, std::string::npos)) == ms_link_option ||
336 to_upper_string(std::string(s, 1, ms_link_option.size() + 1)) == ms_link_option +
':')
338 std::optional<std::size_t> optnr =
getoptnr(ms_link_option);
340 if(!optnr.has_value())
352 if(s.size() > ms_link_option.size() + 1)
353 options[*optnr].values.push_back(
354 std::string(s, ms_link_option.size() + 2, std::string::npos));
361 std::cout <<
"Warning: uninterpreted LINK option '" << s <<
"'\n";
static abstract_object_pointert transform(const exprt &expr, const std::vector< abstract_object_pointert > &operands, const abstract_environmentt &environment, const namespacet &ns)
std::optional< std::size_t > getoptnr(char option) const
std::vector< optiont > options
void set(const std::string &opt, const char *value) override
Set option option to value.
void process_non_link_option(const std::string &s)
virtual bool parse(int argc, const char **argv, const char *optstring)
Parses a commandline according to a specification given in optstring.
void process_response_file_line(const std::string &line)
void process_response_file(const std::string &file)
void process_link_option(const std::string &s)
static std::string binary(const constant_exprt &src)
const char * ms_link_options[]
static std::string to_upper_string(const std::string &s)
static std::istream & my_wgetline(std::istream &in, std::wstring &dest)
const char * non_ms_link_options[]
parses the command line options into a cmdlinet
A special command line object for LINK options.
output_type narrow(input_type input)
Run-time checked narrowing cast.