29 "--print-rejected-preprocessed-source",
37 "--show-symbol-table",
38 "--show-function-table",
44 "--string-abstraction",
53 "--validate-goto-model",
55 "--export-function-local-symbols",
110 "-compatibility_version",
142 "-no-integrated-cpp",
164 "-print-libgcc-file-name",
165 "-print-multi-directory",
167 "-print-search-dirs",
169 "-print-sysroot-headers-suffix",
192 "-mno-unaligned-access",
229 current_args.reserve(argc - 1);
231 for(
int i=1; i<argc; i++)
232 current_args.push_back(argv[i]);
242 const argst &args_to_parse,
245 for(argst::const_iterator it = args_to_parse.begin();
246 it != args_to_parse.end();
249 const std::string &argv_i=*it;
254 std::ifstream opts_file(argv_i.substr(1));
257 while(std::getline(opts_file, line))
260 line.erase(0, line.find_first_not_of(
"\t "));
279 argst::const_iterator next=it;
293 *o!=
nullptr && !found;
299 if(next != args_to_parse.end())
308 else if(
has_prefix(argv_i, std::string(*o)+
"="))
311 set(*o, argv_i.substr(strlen(*o)+1));
334 std::string value=argv_i.substr(4);
344 std::size_t equal_pos=argv_i.find(
'=');
346 if(equal_pos==std::string::npos)
349 set(argv_i.substr(0, equal_pos), argv_i.substr(equal_pos+1));
358 argst::const_iterator next=it;
365 *o!=
nullptr && !found;
371 if(next != args_to_parse.end())
382 else if(
has_prefix(argv_i, std::string(*o)+
"="))
385 set(*o, argv_i.substr(strlen(*o)+1));
391 *o!=
nullptr && !found;
397 if(next != args_to_parse.end())
410 set(*o, argv_i.substr(strlen(*o)));
416 *o!=
nullptr && !found;
422 set(*o, argv_i.substr(strlen(*o)));
429 std::cerr <<
"Warning: uninterpreted gcc option '" << argv_i
442 assert(!line.empty());
443 assert(line[0]!=
' ' && line[0]!=
'\t');
445 argst args_from_specs;
448 arg_end!=std::string::npos;
449 arg_start=line.find_first_not_of(
"\t ", arg_end))
451 arg_end=line.find_first_of(
"\t ", arg_start);
452 args_from_specs.push_back(line.substr(arg_start, arg_end - arg_start));
461 const std::string &specs_file_name=
get_value(
"specs");
462 if(specs_file_name.empty())
465 std::ifstream specs_file(specs_file_name);
469 while(std::getline(specs_file, line))
472 line.erase(0, line.find_first_not_of(
"\t "));
478 (line==
"*link_libgcc:" ||