27 "--show-symbol-table",
28 "--show-function-table",
33 "--string-abstraction",
46 "--validate-goto-model",
47 "--export-file-local-symbols",
55 for(std::size_t i = 0; i < arguments.size(); i++)
58 if(std::string(arguments[i], 0, 2) ==
"--")
63 arguments[i] ==
"--verbosity" || arguments[i] ==
"--function" ||
64 arguments[i] ==
"--mangle-suffix")
66 if(i < arguments.size() - 1)
68 set(arguments[i], arguments[i + 1]);
73 else if(!arguments[i].empty() && arguments[i][0] ==
'@')
78 else if(arguments[i] ==
"/link" || arguments[i] ==
"-link")
81 i = arguments.size() - 1;
84 arguments[i].size() == 2 &&
85 (arguments[i] ==
"/D" || arguments[i] ==
"-D") &&
86 i != arguments.size() - 1)
89 std::string tmp =
"/D" + arguments[i + 1];
106 const wchar_t *CL_env=_wgetenv(L
"CL");
113 const char *CL_env=
getenv(
"CL");
128 std::vector<std::string> arguments;
131 for(
int i=1; i<argc; i++)
132 arguments.push_back(argv[i]);
134 return parse(arguments);
137 static std::istream &
my_wgetline(std::istream &in, std::wstring &dest)
166 dest += wchar_t(ch1 + (ch2 << CHAR_BIT));
174 std::ifstream infile(file);
178 std::cerr <<
"failed to open response file '" << file <<
"'\n";
184 getline(infile, line);
186 line[0]==
static_cast<char>(0xff) &&
187 line[1]==
static_cast<char>(0xfe))
206 while(std::getline(infile2, wline))
211 else if(line.size()>=3 &&
212 line[0]==
static_cast<char>(0xef) &&
213 line[1]==
static_cast<char>(0xbb) &&
214 line[2]==
static_cast<char>(0xbf))
220 while(getline(infile, line))
227 while(getline(infile, line))
244 std::vector<std::string> arguments;
246 bool in_quotes=
false;
247 for(std::size_t i=0; i<line.size(); i++)
251 if(ch==
' ' && !in_quotes)
254 arguments.push_back(option);
259 in_quotes=!in_quotes;
266 arguments.push_back(option);
272 const std::string &s)
281 std::cout <<
"Warning: uninterpreted non-CL option '" << s <<
"'\n";
417 if(s[0]!=
'/' && s[0]!=
'-')
425 if(std::string(s, 1, std::string::npos)==
ms_cl_flags[j])
428 std::optional<std::size_t> optnr;
440 option.
optstring=std::string(s, 1, std::string::npos);
445 if(!optnr.has_value())
460 if(std::string(s, 1, ms_cl_prefix.size())==ms_cl_prefix)
464 std::optional<std::size_t> optnr;
466 if(ms_cl_prefix.size()==1)
470 option.
optchar=ms_cl_prefix[0];
481 if(!optnr.has_value())
488 options[*optnr].values.push_back(
489 std::string(s, ms_cl_prefix.size()+1, std::string::npos));
496 std::cout <<
"Warning: uninterpreted CL option '" << s <<
"'\n";
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_response_file(const std::string &file)
void process_response_file_line(const std::string &line)
void process_non_cl_option(const std::string &s)
void process_cl_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.
static std::string binary(const constant_exprt &src)
const char * ms_cl_prefixes[]
const char * non_ms_cl_options[]
parses the command line options into a cmdlinet
const char * ms_cl_flags[]
static std::istream & my_wgetline(std::istream &in, std::wstring &dest)
A special command line object for the gcc-like options.
output_type narrow(input_type input)
Run-time checked narrowing cast.
char * getenv(const char *name)