29 "--print-rejected-preprocessed-source",
38 "--show-symbol-table",
39 "--show-function-table",
45 "--string-abstraction",
54 "--validate-goto-model",
56 "--export-file-local-symbols",
58 "--export-function-local-symbols",
113 "-compatibility_version",
145 "-no-integrated-cpp",
167 "-print-libgcc-file-name",
168 "-print-multi-directory",
170 "-print-search-dirs",
172 "-print-sysroot-headers-suffix",
195 "-mno-unaligned-access",
232 current_args.reserve(argc - 1);
234 for(
int i=1; i<argc; i++)
235 current_args.push_back(argv[i]);
245 const argst &args_to_parse,
248 for(argst::const_iterator it = args_to_parse.begin();
249 it != args_to_parse.end();
252 const std::string &argv_i=*it;
257 std::ifstream opts_file(argv_i.substr(1));
260 while(std::getline(opts_file, line))
263 line.erase(0, line.find_first_not_of(
"\t "));
282 argst::const_iterator next=it;
296 *o!=
nullptr && !found;
302 if(next != args_to_parse.end())
311 else if(
has_prefix(argv_i, std::string(*o)+
"="))
314 set(*o, argv_i.substr(strlen(*o)+1));
337 std::string value=argv_i.substr(4);
347 std::size_t equal_pos=argv_i.find(
'=');
349 if(equal_pos==std::string::npos)
352 set(argv_i.substr(0, equal_pos), argv_i.substr(equal_pos+1));
361 argst::const_iterator next=it;
368 *o!=
nullptr && !found;
374 if(next != args_to_parse.end())
385 else if(
has_prefix(argv_i, std::string(*o)+
"="))
388 set(*o, argv_i.substr(strlen(*o)+1));
394 *o!=
nullptr && !found;
400 if(next != args_to_parse.end())
413 set(*o, argv_i.substr(strlen(*o)));
419 *o!=
nullptr && !found;
425 set(*o, argv_i.substr(strlen(*o)));
432 std::cerr <<
"Warning: uninterpreted gcc option '" << argv_i
445 assert(!line.empty());
446 assert(line[0]!=
' ' && line[0]!=
'\t');
448 argst args_from_specs;
451 arg_end!=std::string::npos;
452 arg_start=line.find_first_not_of(
"\t ", arg_end))
454 arg_end=line.find_first_of(
"\t ", arg_start);
455 args_from_specs.push_back(line.substr(arg_start, arg_end - arg_start));
464 const std::string &specs_file_name=
get_value(
"specs");
465 if(specs_file_name.empty())
468 std::ifstream specs_file(specs_file_name);
472 while(std::getline(specs_file, line))
475 line.erase(0, line.find_first_not_of(
"\t "));
481 (line==
"*link_libgcc:" ||