29 "--print-rejected-preprocessed-source",
38 "--show-symbol-table",
39 "--show-function-table",
45 "--string-abstraction",
53 "--validate-goto-model",
55 "--export-file-local-symbols",
57 "--export-function-local-symbols",
112 "-compatibility_version",
146 "-no-integrated-cpp",
168 "-print-libgcc-file-name",
169 "-print-multi-directory",
171 "-print-search-dirs",
173 "-print-sysroot-headers-suffix",
197 "-mno-unaligned-access",
235 current_args.reserve(argc - 1);
237 for(
int i=1; i<argc; i++)
238 current_args.push_back(argv[i]);
248 const argst &args_to_parse,
251 for(argst::const_iterator it = args_to_parse.begin();
252 it != args_to_parse.end();
255 const std::string &argv_i=*it;
260 std::ifstream opts_file(argv_i.substr(1));
261 std::ostringstream all_lines;
264 while(std::getline(opts_file, line))
265 all_lines <<
' ' << line;
267 line = all_lines.str();
269 line.erase(0, line.find_first_not_of(
"\t "));
287 argst::const_iterator next=it;
301 *o!=
nullptr && !found;
307 if(next != args_to_parse.end())
316 else if(
has_prefix(argv_i, std::string(*o)+
"="))
319 set(*o, argv_i.substr(strlen(*o)+1));
342 std::string value=argv_i.substr(4);
352 std::size_t equal_pos=argv_i.find(
'=');
354 if(equal_pos==std::string::npos)
357 set(argv_i.substr(0, equal_pos), argv_i.substr(equal_pos+1));
366 argst::const_iterator next=it;
373 *o!=
nullptr && !found;
379 if(next != args_to_parse.end())
390 else if(
has_prefix(argv_i, std::string(*o)+
"="))
393 set(*o, argv_i.substr(strlen(*o)+1));
399 *o!=
nullptr && !found;
405 if(next != args_to_parse.end())
418 set(*o, argv_i.substr(strlen(*o)));
424 *o!=
nullptr && !found;
430 set(*o, argv_i.substr(strlen(*o)));
437 std::cerr <<
"Warning: uninterpreted gcc option '" << argv_i
450 assert(!line.empty());
451 assert(line[0]!=
' ' && line[0]!=
'\t');
453 argst args_from_specs;
456 arg_end!=std::string::npos;
457 arg_start=line.find_first_not_of(
"\t ", arg_end))
459 arg_end=line.find_first_of(
"\t ", arg_start);
460 args_from_specs.push_back(line.substr(arg_start, arg_end - arg_start));
469 const std::string &specs_file_name=
get_value(
"specs");
470 if(specs_file_name.empty())
473 std::ifstream specs_file(specs_file_name);
477 while(std::getline(specs_file, line))
480 line.erase(0, line.find_first_not_of(
"\t "));
486 (line==
"*link_libgcc:" ||