Lines Matching refs:CmdArgs
47 static void addAssemblerKPIC(const ArgList &Args, ArgStringList &CmdArgs) {
58 CmdArgs.push_back("-KPIC");
116 ArgStringList &CmdArgs,
137 CmdArgs.push_back(Args.MakeArgString(std::string(ArgName) + "."));
139 CmdArgs.push_back(ArgName);
140 CmdArgs.push_back(".");
144 CmdArgs.push_back(Args.MakeArgString(std::string(ArgName) + Dirs.substr(0, Delim)));
146 CmdArgs.push_back(ArgName);
147 CmdArgs.push_back(Args.MakeArgString(Dirs.substr(0, Delim)));
155 CmdArgs.push_back(Args.MakeArgString(std::string(ArgName) + "."));
157 CmdArgs.push_back(ArgName);
158 CmdArgs.push_back(".");
162 CmdArgs.push_back(Args.MakeArgString(std::string(ArgName) + Dirs));
164 CmdArgs.push_back(ArgName);
165 CmdArgs.push_back(Args.MakeArgString(Dirs));
172 ArgStringList &CmdArgs) {
177 Args.AddAllArgValues(CmdArgs, options::OPT_Zlinker_input);
192 CmdArgs.push_back(II.getFilename());
201 TC.AddCXXStdlibLibArgs(Args, CmdArgs);
203 TC.AddCCKextLibArgs(Args, CmdArgs);
205 A.renderAsInput(Args, CmdArgs);
211 addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH");
241 ArgStringList &CmdArgs,
248 Args.AddLastArg(CmdArgs, options::OPT_C);
249 Args.AddLastArg(CmdArgs, options::OPT_CC);
269 CmdArgs.push_back("-dependency-file");
270 CmdArgs.push_back(DepFile);
290 CmdArgs.push_back("-MT");
293 CmdArgs.push_back(Args.MakeArgString(Quoted));
298 CmdArgs.push_back("-sys-header-deps");
301 CmdArgs.push_back("-module-file-deps");
308 CmdArgs.push_back("-MG");
311 Args.AddLastArg(CmdArgs, options::OPT_MP);
321 CmdArgs.push_back("-MT");
324 CmdArgs.push_back(Args.MakeArgString(Quoted));
328 A->render(Args, CmdArgs);
379 CmdArgs.push_back("-include-pch");
381 CmdArgs.push_back("-include-pth");
382 CmdArgs.push_back(Args.MakeArgString(P.str()));
394 A->render(Args, CmdArgs);
397 Args.AddAllArgs(CmdArgs, options::OPT_D, options::OPT_U);
398 Args.AddAllArgs(CmdArgs, options::OPT_I_Group, options::OPT_F,
407 Args.AddAllArgValues(CmdArgs, options::OPT_Wp_COMMA,
419 CmdArgs.push_back("-isysroot");
420 CmdArgs.push_back(C.getArgs().MakeArgString(sysroot));
429 addDirectoryList(Args, CmdArgs, "-I", "CPATH");
431 addDirectoryList(Args, CmdArgs, "-c-isystem", "C_INCLUDE_PATH");
433 addDirectoryList(Args, CmdArgs, "-cxx-isystem", "CPLUS_INCLUDE_PATH");
435 addDirectoryList(Args, CmdArgs, "-objc-isystem", "OBJC_INCLUDE_PATH");
437 addDirectoryList(Args, CmdArgs, "-objcxx-isystem", "OBJCPLUS_INCLUDE_PATH");
441 getToolChain().AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
444 getToolChain().AddClangSystemIncludeArgs(Args, CmdArgs);
740 ArgStringList &CmdArgs,
784 CmdArgs.push_back("-target-abi");
785 CmdArgs.push_back(ABIName);
793 CmdArgs.push_back("-msoft-float");
794 CmdArgs.push_back("-mfloat-abi");
795 CmdArgs.push_back("soft");
798 CmdArgs.push_back("-mfloat-abi");
799 CmdArgs.push_back("soft");
803 CmdArgs.push_back("-mfloat-abi");
804 CmdArgs.push_back("hard");
810 CmdArgs.push_back("-backend-option");
811 CmdArgs.push_back("-arm-long-calls");
814 CmdArgs.push_back("-backend-option");
815 CmdArgs.push_back("-arm-strict-align");
818 CmdArgs.push_back("-backend-option");
819 CmdArgs.push_back("-arm-use-movt=0");
827 CmdArgs.push_back("-mno-global-merge");
833 CmdArgs.push_back("-no-implicit-float");
839 CmdArgs.push_back("-backend-option");
840 CmdArgs.push_back("-arm-reserve-r9");
869 ArgStringList &CmdArgs) const {
876 CmdArgs.push_back("-disable-red-zone");
880 CmdArgs.push_back("-no-implicit-float");
890 CmdArgs.push_back("-target-abi");
891 CmdArgs.push_back(ABIName);
893 CmdArgs.push_back("-target-cpu");
894 CmdArgs.push_back(Args.MakeArgString(getAArch64TargetCPU(Args)));
897 CmdArgs.push_back("-backend-option");
898 CmdArgs.push_back("-aarch64-strict-align");
906 CmdArgs.push_back("-mno-global-merge");
1066 ArgStringList &CmdArgs) const {
1073 CmdArgs.push_back("-target-abi");
1074 CmdArgs.push_back(ABIName.data());
1080 CmdArgs.push_back("-msoft-float");
1081 CmdArgs.push_back("-mfloat-abi");
1082 CmdArgs.push_back("soft");
1087 CmdArgs.push_back("-mfloat-abi");
1088 CmdArgs.push_back("hard");
1093 CmdArgs.push_back("-mllvm");
1094 CmdArgs.push_back("-mxgot");
1101 CmdArgs.push_back("-mllvm");
1102 CmdArgs.push_back("-mno-ldc1-sdc1");
1109 CmdArgs.push_back("-mllvm");
1110 CmdArgs.push_back("-mno-check-zero-division");
1116 CmdArgs.push_back("-mllvm");
1117 CmdArgs.push_back(Args.MakeArgString("-mips-ssection-threshold=" + v));
1247 ArgStringList &CmdArgs) const {
1271 CmdArgs.push_back("-msoft-float");
1274 CmdArgs.push_back("-mhard-float");
1409 ArgStringList &CmdArgs) {
1413 CmdArgs.push_back("-plugin");
1415 CmdArgs.push_back(Args.MakeArgString(Plugin));
1423 CmdArgs.push_back(Args.MakeArgString(Twine("-plugin-opt=mcpu=") + CPU));
1470 ArgStringList &CmdArgs) const {
1476 CmdArgs.push_back("-disable-red-zone");
1491 CmdArgs.push_back("-no-implicit-float");
1496 CmdArgs.push_back("-mllvm");
1497 CmdArgs.push_back(Args.MakeArgString("-x86-asm-syntax=" + Value));
1528 ArgStringList &CmdArgs) const {
1529 CmdArgs.push_back("-fno-signed-char");
1530 CmdArgs.push_back("-mqdsp6-compat");
1531 CmdArgs.push_back("-Wreturn-type");
1535 CmdArgs.push_back ("-mllvm");
1536 CmdArgs.push_back(Args.MakeArgString(
1541 CmdArgs.push_back("-fshort-enums");
1543 CmdArgs.push_back ("-mllvm");
1544 CmdArgs.push_back ("-enable-hexagon-ieee-rnd-near");
1546 CmdArgs.push_back ("-mllvm");
1547 CmdArgs.push_back ("-machine-sink-split=0");
1575 const ArgList &Args, ArgStringList &CmdArgs,
1632 CmdArgs.push_back("-target-feature");
1633 CmdArgs.push_back(Name);
1702 ArgStringList &CmdArgs) {
1724 CmdArgs.push_back("-fobjc-exceptions");
1744 CmdArgs.push_back("-fcxx-exceptions");
1751 CmdArgs.push_back("-fexceptions");
1810 ArgStringList &CmdArgs,
1813 CmdArgs.push_back("-mrelax-all");
1834 CmdArgs.push_back(Value.data());
1842 CmdArgs.push_back("-msave-temp-labels");
1844 CmdArgs.push_back("-mllvm");
1845 CmdArgs.push_back("-fatal-assembler-warnings");
1847 CmdArgs.push_back("-mnoexecstack");
1855 CmdArgs.push_back(Value.data());
1861 CmdArgs.push_back(Value.data());
1870 CmdArgs.push_back("-compress-debug-sections");
1900 const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) {
1906 CmdArgs.push_back(Args.MakeArgString(LibClangRT));
1907 CmdArgs.push_back("-lgcc_s");
1909 CmdArgs.push_back("-lgcc_eh");
1913 const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) {
1932 CmdArgs.push_back(Args.MakeArgString(LibProfile));
1951 ArgStringList &CmdArgs,
1970 CmdArgs.insert(BeforeLibStdCXX ? CmdArgs.begin() : CmdArgs.end(),
1975 CmdArgs.push_back("-lpthread");
1976 CmdArgs.push_back("-lrt");
1977 CmdArgs.push_back("-lm");
1980 CmdArgs.push_back("-ldl");
1988 CmdArgs.push_back(
1991 CmdArgs.push_back("-export-dynamic");
1998 ArgStringList &CmdArgs, bool Shared, bool IsCXX) {
2003 CmdArgs.insert(CmdArgs.begin(), Args.MakeArgString(LibSanitizer));
2012 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "asan-preinit",
2016 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "asan", true);
2018 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "asan_cxx", true);
2025 ArgStringList &CmdArgs) {
2027 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "tsan", true);
2033 ArgStringList &CmdArgs) {
2035 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "msan", true);
2041 ArgStringList &CmdArgs) {
2043 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "lsan", true);
2049 ArgStringList &CmdArgs, bool IsCXX,
2058 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "san", true, false);
2060 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "ubsan", false, true);
2065 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "ubsan_cxx", false, true);
2069 ArgStringList &CmdArgs) {
2071 addSanitizerRTLinkFlags(TC, Args, CmdArgs, "dfsan", true);
2076 ArgStringList &CmdArgs) {
2080 addUbsanRT(TC, Args, CmdArgs, D.CCCIsCXX(),
2084 addAsanRT(TC, Args, CmdArgs, Sanitize.needsSharedAsanRt(), D.CCCIsCXX());
2086 addTsanRT(TC, Args, CmdArgs);
2088 addMsanRT(TC, Args, CmdArgs);
2090 addLsanRT(TC, Args, CmdArgs);
2092 addDfsanRT(TC, Args, CmdArgs);
2137 static void addDebugCompDirArg(const ArgList &Args, ArgStringList &CmdArgs) {
2140 CmdArgs.push_back("-fdebug-compilation-dir");
2141 CmdArgs.push_back(Args.MakeArgString(cwd));
2220 /// Add -x lang to \p CmdArgs for \p Input.
2222 ArgStringList &CmdArgs) {
2228 CmdArgs.push_back("-x");
2230 CmdArgs.push_back(types::getTypeName(types::TY_PP_ObjCXX));
2232 CmdArgs.push_back(types::getTypeName(Input.getType()));
2243 ArgStringList CmdArgs;
2255 CmdArgs.push_back("-cc1");
2258 CmdArgs.push_back("-triple");
2260 CmdArgs.push_back(Args.MakeArgString(TripleStr));
2276 getToolChain().addClangWarningOptions(CmdArgs);
2283 CmdArgs.push_back("-analyze");
2285 CmdArgs.push_back("-migrate");
2288 CmdArgs.push_back("-Eonly");
2290 CmdArgs.push_back("-E");
2293 CmdArgs.push_back("-P");
2296 CmdArgs.push_back("-emit-obj");
2298 CollectArgsForIntegratedAssembler(C, Args, CmdArgs, D);
2307 CmdArgs.push_back("-fsyntax-only");
2309 CmdArgs.push_back("-emit-pch");
2311 CmdArgs.push_back("-emit-pth");
2313 CmdArgs.push_back("-verify-pch");
2318 CmdArgs.push_back("-fsyntax-only");
2321 CmdArgs.push_back("-emit-llvm");
2324 CmdArgs.push_back("-emit-llvm-bc");
2326 CmdArgs.push_back("-S");
2328 CmdArgs.push_back("-emit-pch");
2330 CmdArgs.push_back("-module-file-info");
2332 CmdArgs.push_back("-rewrite-objc");
2335 CmdArgs.push_back("-rewrite-objc");
2347 CmdArgs.push_back("-disable-free");
2351 CmdArgs.push_back("-disable-llvm-verifier");
2356 CmdArgs.push_back("-main-file-name");
2357 CmdArgs.push_back(getBaseInputName(Args, Inputs));
2362 CmdArgs.push_back("-static-define");
2366 CmdArgs.push_back("-analyzer-store=region");
2369 CmdArgs.push_back("-analyzer-opt-analyze-nested-blocks");
2371 CmdArgs.push_back("-analyzer-eagerly-assume");
2375 CmdArgs.push_back("-analyzer-checker=core");
2378 CmdArgs.push_back("-analyzer-checker=unix");
2381 CmdArgs.push_back("-analyzer-checker=osx");
2383 CmdArgs.push_back("-analyzer-checker=deadcode");
2386 CmdArgs.push_back("-analyzer-checker=cplusplus");
2389 CmdArgs.push_back(
2391 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.getpw");
2392 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.gets");
2393 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mktemp");
2394 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mkstemp");
2395 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.vfork");
2400 CmdArgs.push_back("-analyzer-output");
2402 CmdArgs.push_back(A->getValue());
2404 CmdArgs.push_back("plist");
2409 CmdArgs.push_back("-w");
2412 Args.AddAllArgValues(CmdArgs, options::OPT_Xanalyzer);
2525 CmdArgs.push_back("-mrelocation-model");
2526 CmdArgs.push_back("dynamic-no-pic");
2532 CmdArgs.push_back("-pic-level");
2533 CmdArgs.push_back("2");
2538 CmdArgs.push_back("-mrelocation-model");
2539 CmdArgs.push_back(PIC ? "pic" : "static");
2542 CmdArgs.push_back("-pic-level");
2543 CmdArgs.push_back(IsPICLevelTwo ? "2" : "1");
2545 CmdArgs.push_back("-pie-level");
2546 CmdArgs.push_back(IsPICLevelTwo ? "2" : "1");
2553 CmdArgs.push_back("-fno-merge-all-constants");
2559 CmdArgs.push_back("-mllvm");
2560 CmdArgs.push_back(Args.MakeArgString("-warn-stack-size=" + v));
2565 CmdArgs.push_back("-mregparm");
2566 CmdArgs.push_back(A->getValue());
2575 CmdArgs.push_back("-fpcc-struct-return");
2578 CmdArgs.push_back("-freg-struct-return");
2583 CmdArgs.push_back("-mrtd");
2586 CmdArgs.push_back("-mdisable-fp-elim");
2589 CmdArgs.push_back("-mno-zero-initialized-in-bss");
2601 CmdArgs.push_back("-relaxed-aliasing");
2604 CmdArgs.push_back("-no-struct-path-tbaa");
2607 CmdArgs.push_back("-fstrict-enums");
2610 CmdArgs.push_back("-mdisable-tail-calls");
2614 CmdArgs.push_back("-split-stacks");
2635 CmdArgs.push_back("-menable-no-infs");
2645 CmdArgs.push_back("-menable-no-nans");
2664 CmdArgs.push_back("-fmath-errno");
2716 CmdArgs.push_back("-menable-unsafe-fp-math");
2726 CmdArgs.push_back(Args.MakeArgString("-ffp-contract=" + Val));
2734 CmdArgs.push_back(Args.MakeArgString("-ffp-contract=fast"));
2746 CmdArgs.push_back("-ffast-math");
2750 CmdArgs.push_back("-ffinite-math-only");
2759 CmdArgs.push_back("-masm-verbose");
2763 CmdArgs.push_back("-no-integrated-as");
2766 CmdArgs.push_back("-mdebug-pass");
2767 CmdArgs.push_back("Structure");
2770 CmdArgs.push_back("-mdebug-pass");
2771 CmdArgs.push_back("Arguments");
2777 CmdArgs.push_back("-mconstructor-aliases");
2782 CmdArgs.push_back("-fforbid-guard-variables");
2785 CmdArgs.push_back("-mms-bitfields");
2799 CmdArgs.push_back("-munwind-tables");
2801 getToolChain().addClangTargetOptions(Args, CmdArgs);
2804 CmdArgs.push_back("-mlimit-float-precision");
2805 CmdArgs.push_back(A->getValue());
2812 CmdArgs.push_back("-mcode-model");
2813 CmdArgs.push_back(A->getValue());
2821 CmdArgs.push_back("-target-cpu");
2822 CmdArgs.push_back(Args.MakeArgString(CPU));
2826 CmdArgs.push_back("-mfpmath");
2827 CmdArgs.push_back(A->getValue());
2831 getTargetFeatures(D, ETriple, Args, CmdArgs, false);
2842 AddARMTargetArgs(Args, CmdArgs, KernelOrKext);
2849 AddAArch64TargetArgs(Args, CmdArgs);
2856 AddMIPSTargetArgs(Args, CmdArgs);
2860 AddSparcTargetArgs(Args, CmdArgs);
2865 AddX86TargetArgs(Args, CmdArgs);
2869 AddHexagonTargetArgs(Args, CmdArgs);
2875 AddClangCLArgs(Args, CmdArgs);
2879 CmdArgs.push_back("-target-linker-version");
2880 CmdArgs.push_back(A->getValue());
2884 CmdArgs.push_back("-momit-leaf-frame-pointer");
2901 Args.AddAllArgs(CmdArgs, options::OPT_v);
2902 Args.AddLastArg(CmdArgs, options::OPT_H);
2904 CmdArgs.push_back("-header-include-file");
2905 CmdArgs.push_back(D.CCPrintHeadersFilename ?
2908 Args.AddLastArg(CmdArgs, options::OPT_P);
2909 Args.AddLastArg(CmdArgs, options::OPT_print_ivar_layout);
2912 CmdArgs.push_back("-diagnostic-log-file");
2913 CmdArgs.push_back(D.CCLogDiagnosticsFilename ?
2924 CmdArgs.push_back("-gline-tables-only");
2929 CmdArgs.push_back("-gdwarf-2");
2931 CmdArgs.push_back("-gdwarf-2");
2933 CmdArgs.push_back("-gdwarf-3");
2935 CmdArgs.push_back("-gdwarf-4");
2942 CmdArgs.push_back("-gdwarf-2");
2944 CmdArgs.push_back("-g");
2951 CmdArgs.push_back("-dwarf-column-info");
2959 CmdArgs.push_back("-g");
2960 CmdArgs.push_back("-backend-option");
2961 CmdArgs.push_back("-split-dwarf=Enable");
2966 CmdArgs.push_back("-backend-option");
2967 CmdArgs.push_back("-generate-gnu-dwarf-pub-sections");
2973 CmdArgs.push_back("-backend-option");
2974 CmdArgs.push_back("-generate-arange-section");
2979 CmdArgs.push_back("-backend-option");
2980 CmdArgs.push_back("-generate-type-units");
2985 CmdArgs.push_back("-ffunction-sections");
2990 CmdArgs.push_back("-fdata-sections");
2993 Args.AddAllArgs(CmdArgs, options::OPT_finstrument_functions);
3001 Args.AddAllArgs(CmdArgs, options::OPT_fprofile_instr_generate);
3004 A->render(Args, CmdArgs);
3006 CmdArgs.push_back("-fprofile-instr-use=pgo-data");
3010 CmdArgs.push_back("-femit-coverage-notes");
3013 CmdArgs.push_back("-femit-coverage-data");
3018 CmdArgs.push_back("-coverage-file");
3027 CmdArgs.push_back(Args.MakeArgString(CoverageFilename));
3033 CmdArgs.push_back("-nostdsysteminc");
3034 CmdArgs.push_back("-nobuiltininc");
3037 CmdArgs.push_back("-nostdsysteminc");
3038 Args.AddLastArg(CmdArgs, options::OPT_nostdincxx);
3039 Args.AddLastArg(CmdArgs, options::OPT_nobuiltininc);
3043 CmdArgs.push_back("-resource-dir");
3044 CmdArgs.push_back(D.ResourceDir.c_str());
3046 Args.AddLastArg(CmdArgs, options::OPT_working_directory);
3058 CmdArgs.push_back("-arcmt-check");
3061 CmdArgs.push_back("-arcmt-modify");
3064 CmdArgs.push_back("-arcmt-migrate");
3065 CmdArgs.push_back("-mt-migrate-directory");
3066 CmdArgs.push_back(A->getValue());
3068 Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_report_output);
3069 Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_emit_arc_errors);
3084 CmdArgs.push_back("-mt-migrate-directory");
3085 CmdArgs.push_back(A->getValue());
3091 CmdArgs.push_back("-objcmt-migrate-literals");
3092 CmdArgs.push_back("-objcmt-migrate-subscripting");
3093 CmdArgs.push_back("-objcmt-migrate-property");
3095 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_literals);
3096 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_subscripting);
3097 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property);
3100 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_literals);
3101 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_subscripting);
3102 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property);
3103 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_all);
3104 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readonly_property);
3105 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readwrite_property);
3106 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_annotation);
3107 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_instancetype);
3108 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_nsmacros);
3109 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_protocol_conformance);
3110 Args.AddLastArg(CmdArgs, options::OPT_objcmt_atomic_property);
3111 Args.AddLastArg(CmdArgs, options::OPT_objcmt_returns_innerpointer_property);
3112 Args.AddLastArg(CmdArgs, options::OPT_objcmt_ns_nonatomic_iosonly);
3113 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_designated_init);
3114 Args.AddLastArg(CmdArgs, options::OPT_objcmt_whitelist_dir_path);
3122 AddPreprocessingOptions(C, JA, D, Args, CmdArgs, Output, Inputs);
3133 CmdArgs.push_back("-O3");
3136 A->render(Args, CmdArgs);
3144 Args.AddAllArgs(CmdArgs, options::OPT_W_Group);
3146 CmdArgs.push_back("-pedantic");
3147 Args.AddLastArg(CmdArgs, options::OPT_pedantic_errors);
3148 Args.AddLastArg(CmdArgs, options::OPT_w);
3158 CmdArgs.push_back("-std=c++98");
3160 CmdArgs.push_back("-std=c89");
3162 Std->render(Args, CmdArgs);
3167 A->render(Args, CmdArgs);
3176 Args.AddAllArgsTranslated(CmdArgs, options::OPT_std_default_EQ,
3179 CmdArgs.push_back("-std=c++11");
3181 Args.AddLastArg(CmdArgs, options::OPT_trigraphs);
3201 CmdArgs.push_back("-fconst-strings");
3210 CmdArgs.push_back("-fdeprecated-macro");
3216 CmdArgs.push_back("-fgnu-keywords");
3218 CmdArgs.push_back("-fno-gnu-keywords");
3222 CmdArgs.push_back("-fno-dwarf-directory-asm");
3225 CmdArgs.push_back("-fno-autolink");
3228 addDebugCompDirArg(Args, CmdArgs);
3232 CmdArgs.push_back("-ftemplate-depth");
3233 CmdArgs.push_back(A->getValue());
3237 CmdArgs.push_back("-foperator-arrow-depth");
3238 CmdArgs.push_back(A->getValue());
3242 CmdArgs.push_back("-fconstexpr-depth");
3243 CmdArgs.push_back(A->getValue());
3247 CmdArgs.push_back("-fconstexpr-steps");
3248 CmdArgs.push_back(A->getValue());
3252 CmdArgs.push_back("-fbracket-depth");
3253 CmdArgs.push_back(A->getValue());
3260 CmdArgs.push_back(Args.MakeArgString("-Wlarge-by-value-copy=" + bytes));
3262 CmdArgs.push_back("-Wlarge-by-value-copy=64"); // default value
3267 CmdArgs.push_back("-relocatable-pch");
3270 CmdArgs.push_back("-fconstant-string-class");
3271 CmdArgs.push_back(A->getValue());
3275 CmdArgs.push_back("-ftabstop");
3276 CmdArgs.push_back(A->getValue());
3279 CmdArgs.push_back("-ferror-limit");
3281 CmdArgs.push_back(A->getValue());
3283 CmdArgs.push_back("19");
3286 CmdArgs.push_back("-fmacro-backtrace-limit");
3287 CmdArgs.push_back(A->getValue());
3291 CmdArgs.push_back("-ftemplate-backtrace-limit");
3292 CmdArgs.push_back(A->getValue());
3296 CmdArgs.push_back("-fconstexpr-backtrace-limit");
3297 CmdArgs.push_back(A->getValue());
3301 CmdArgs.push_back("-fmessage-length");
3303 CmdArgs.push_back(A->getValue());
3308 CmdArgs.push_back(Args.MakeArgString(Twine(N)));
3315 CmdArgs.push_back("-fvisibility");
3316 CmdArgs.push_back(A->getValue());
3319 CmdArgs.push_back("-fvisibility");
3320 CmdArgs.push_back("hidden");
3321 CmdArgs.push_back("-ftype-visibility");
3322 CmdArgs.push_back("default");
3326 Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden);
3328 Args.AddLastArg(CmdArgs, options::OPT_ftlsmodel_EQ);
3333 CmdArgs.push_back("-ffreestanding");
3336 Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls);
3337 Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions);
3338 Args.AddLastArg(CmdArgs, options::OPT_fstandalone_debug);
3339 Args.AddLastArg(CmdArgs, options::OPT_fno_standalone_debug);
3340 Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);
3344 Args.AddLastArg(CmdArgs, options::OPT_faltivec);
3345 Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_show_template_tree);
3346 Args.AddLastArg(CmdArgs, options::OPT_fno_elide_type);
3349 Sanitize.addArgs(Args, CmdArgs);
3354 CmdArgs.push_back("-fno-sanitize-recover");
3358 CmdArgs.push_back("-fsanitize-undefined-trap-on-error");
3369 Args.AddLastArg(CmdArgs, options::OPT_pg);
3374 CmdArgs.push_back("-fno-lax-vector-conversions");
3377 CmdArgs.push_back("-fapple-kext");
3379 Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch);
3380 Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info);
3381 Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_parseable_fixits);
3382 Args.AddLastArg(CmdArgs, options::OPT_ftime_report);
3383 Args.AddLastArg(CmdArgs, options::OPT_ftrapv);
3386 CmdArgs.push_back("-ftrapv-handler");
3387 CmdArgs.push_back(A->getValue());
3390 Args.AddLastArg(CmdArgs, options::OPT_ftrap_function_EQ);
3397 CmdArgs.push_back("-fwrapv");
3401 CmdArgs.push_back("-fwrapv");
3407 CmdArgs.push_back("-freroll-loops");
3409 Args.AddLastArg(CmdArgs, options::OPT_fwritable_strings);
3410 Args.AddLastArg(CmdArgs, options::OPT_funroll_loops,
3413 Args.AddLastArg(CmdArgs, options::OPT_pthread);
3434 CmdArgs.push_back("-stack-protector");
3435 CmdArgs.push_back(Args.MakeArgString(Twine(StackProtectorLevel)));
3444 CmdArgs.push_back("-stack-protector-buffer-size");
3446 CmdArgs.push_back(Args.MakeArgString(Str.drop_front(16)));
3455 CmdArgs.push_back("-backend-option");
3456 CmdArgs.push_back("-force-align-stack");
3460 CmdArgs.push_back(Args.MakeArgString("-mstackrealign"));
3465 CmdArgs.push_back(Args.MakeArgString("-mstack-alignment=" + alignment));
3472 CmdArgs.push_back("-backend-option");
3477 CmdArgs.push_back("-aarch64-strict-align");
3479 CmdArgs.push_back("-arm-strict-align");
3481 CmdArgs.push_back("-backend-option");
3486 CmdArgs.push_back("-aarch64-no-strict-align");
3488 CmdArgs.push_back("-arm-no-strict-align");
3496 CmdArgs.push_back("-backend-option");
3497 CmdArgs.push_back("-arm-restrict-it");
3499 CmdArgs.push_back("-backend-option");
3500 CmdArgs.push_back("-arm-no-restrict-it");
3505 CmdArgs.push_back("-backend-option");
3506 CmdArgs.push_back("-arm-restrict-it");
3514 CmdArgs.push_back("-backend-option");
3515 CmdArgs.push_back("-arm-long-calls");
3527 A->render(Args, CmdArgs);
3531 A->render(Args, CmdArgs);
3534 A->render(Args, CmdArgs);
3537 A->render(Args, CmdArgs);
3541 CmdArgs.push_back("-fapple-kext");
3543 CmdArgs.push_back("-fno-builtin");
3548 CmdArgs.push_back("-fno-builtin");
3552 CmdArgs.push_back("-fno-assume-sane-operator-new");
3560 CmdArgs.push_back("-fblocks");
3564 CmdArgs.push_back("-fblocks-runtime-optional");
3576 CmdArgs.push_back("-fmodules");
3585 CmdArgs.push_back("-fmodule-maps");
3593 CmdArgs.push_back("-fmodules-decluse");
3601 CmdArgs.push_back("-fmodules-strict-decluse");
3607 A->render(Args, CmdArgs);
3612 A->render(Args, CmdArgs);
3634 CmdArgs.push_back(Args.MakeArgString(ModuleCachePath));
3643 CmdArgs.push_back("-module-dependency-dir");
3644 CmdArgs.push_back(Args.MakeArgString(VFSDir));
3649 A->render(Args, CmdArgs);
3652 Args.AddAllArgs(CmdArgs, options::OPT_fmodules_ignore_macro);
3653 Args.AddLastArg(CmdArgs, options::OPT_fmodules_prune_interval);
3654 Args.AddLastArg(CmdArgs, options::OPT_fmodules_prune_after);
3656 Args.AddLastArg(CmdArgs, options::OPT_fbuild_session_timestamp);
3662 Args.AddLastArg(CmdArgs,
3666 Args.AddLastArg(CmdArgs, options::OPT_fmodules_validate_system_headers);
3672 CmdArgs.push_back("-fno-access-control");
3678 CmdArgs.push_back("-fno-elide-constructors");
3683 CmdArgs.push_back("-fno-rtti");
3701 CmdArgs.push_back("-fshort-enums");
3706 CmdArgs.push_back("-fno-signed-char");
3711 CmdArgs.push_back("-fno-threadsafe-statics");
3720 CmdArgs.push_back("-fno-use-cxa-atexit");
3725 CmdArgs.push_back("-fms-extensions");
3733 CmdArgs.push_back("-fms-compatibility");
3740 CmdArgs.push_back("-fmsc-version=1700");
3742 CmdArgs.push_back(Args.MakeArgString("-fmsc-version=" + msc_ver));
3749 CmdArgs.push_back("-fborland-extensions");
3755 CmdArgs.push_back("-fdelayed-template-parsing");
3761 A->render(Args, CmdArgs);
3766 CmdArgs.push_back("-fgnu89-inline");
3769 CmdArgs.push_back("-fno-inline");
3772 CmdArgs.push_back("-fno-inline-functions");
3774 ObjCRuntime objcRuntime = AddObjCRuntimeArgs(Args, CmdArgs, rewriteKind);
3786 CmdArgs.push_back("-fobjc-dispatch-method=mixed");
3788 CmdArgs.push_back("-fobjc-dispatch-method=non-legacy");
3800 CmdArgs.push_back("-fobjc-subscripting-legacy-runtime");
3804 CmdArgs.push_back("-fencode-extended-block-signature");
3813 CmdArgs.push_back("-fobjc-arc");
3820 CmdArgs.push_back("-fobjc-arc-cxxlib=libc++");
3822 CmdArgs.push_back("-fobjc-arc-cxxlib=libstdc++");
3830 CmdArgs.push_back("-fobjc-arc-exceptions");
3836 CmdArgs.push_back("-fno-objc-infer-related-result-type");
3848 GCArg->render(Args, CmdArgs);
3859 objcRuntime, CmdArgs);
3862 CmdArgs.push_back("-fsjlj-exceptions");
3867 CmdArgs.push_back("-fno-assume-sane-operator-new");
3875 CmdArgs.push_back("-fno-constant-cfstrings");
3881 A->render(Args, CmdArgs);
3887 CmdArgs.push_back("-fpascal-strings");
3894 CmdArgs.push_back(Args.MakeArgString(PackStructStr));
3897 CmdArgs.push_back("-fpack-struct=1");
3902 CmdArgs.push_back("-fno-common");
3908 CmdArgs.push_back("-fno-common");
3934 CmdArgs.push_back("-fno-caret-diagnostics");
3939 CmdArgs.push_back("-fno-diagnostics-fixit-info");
3944 CmdArgs.push_back("-fdiagnostics-show-option");
3948 CmdArgs.push_back("-fdiagnostics-show-category");
3949 CmdArgs.push_back(A->getValue());
3954 CmdArgs.push_back("-fdiagnostics-format");
3955 CmdArgs.push_back(A->getValue());
3963 CmdArgs.push_back("-fdiagnostics-show-note-include-stack");
3965 CmdArgs.push_back("-fno-diagnostics-show-note-include-stack");
4005 CmdArgs.push_back("-fcolor-diagnostics");
4008 CmdArgs.push_back("-fansi-escape-codes");
4012 CmdArgs.push_back("-fno-show-source-location");
4017 CmdArgs.push_back("-fno-show-column");
4021 CmdArgs.push_back("-fno-spell-checking");
4027 CmdArgs.push_back("-fasm-blocks");
4037 CmdArgs.push_back("-vectorize-loops");
4045 CmdArgs.push_back("-vectorize-slp");
4050 CmdArgs.push_back("-vectorize-slp-aggressive");
4053 A->render(Args, CmdArgs);
4060 CmdArgs.push_back("-fdollars-in-identifiers");
4062 CmdArgs.push_back("-fno-dollars-in-identifiers");
4075 CmdArgs.push_back("-fapple-pragma-pack");
4081 CmdArgs.push_back("-fno-math-builtin");
4092 CmdArgs.push_back("-fno-builtin-strcat");
4094 CmdArgs.push_back("-fno-builtin-strcpy");
4105 CmdArgs.push_back("-frewrite-includes");
4111 CmdArgs.push_back("-traditional-cpp");
4116 Args.AddLastArg(CmdArgs, options::OPT_dM);
4117 Args.AddLastArg(CmdArgs, options::OPT_dD);
4121 CmdArgs.push_back("-serialize-diagnostic-file");
4122 CmdArgs.push_back(Args.MakeArgString(A->getValue()));
4126 CmdArgs.push_back("-fretain-comments-from-system-headers");
4129 Args.AddAllArgs(CmdArgs, options::OPT_fcomment_block_commands);
4131 Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments);
4135 Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
4143 CmdArgs.push_back("-disable-llvm-optzns");
4145 (*it)->render(Args, CmdArgs);
4151 CmdArgs.push_back("-o");
4152 CmdArgs.push_back(Output.getFilename());
4158 addDashXForInput(Args, II, CmdArgs);
4161 CmdArgs.push_back(II.getFilename());
4163 II.getInputArg().renderAsInput(Args, CmdArgs);
4166 Args.AddAllArgs(CmdArgs, options::OPT_undef);
4183 CmdArgs.push_back("-dwarf-debug-flags");
4184 CmdArgs.push_back(Args.MakeArgString(Flags.str()));
4194 CmdArgs.push_back("-split-dwarf-file");
4196 CmdArgs.push_back(SplitDwarfOut);
4205 C.addCommand(new FallbackCommand(JA, *this, Exec, CmdArgs, CLCommand));
4207 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
4242 ArgStringList &cmdArgs,
4260 runtimeArg->render(args, cmdArgs);
4358 cmdArgs.push_back(args.MakeArgString(
4402 void Clang::AddClangCLArgs(const ArgList &Args, ArgStringList &CmdArgs) const {
4416 CmdArgs.push_back("-D_DEBUG");
4417 CmdArgs.push_back("-D_MT");
4418 CmdArgs.push_back("-D_DLL");
4419 CmdArgs.push_back("--dependent-lib=msvcrt");
4422 CmdArgs.push_back("-D_DEBUG");
4423 CmdArgs.push_back("-D_MT");
4424 CmdArgs.push_back("-D_DLL");
4425 CmdArgs.push_back("--dependent-lib=msvcrtd");
4429 CmdArgs.push_back("-D_DEBUG");
4430 CmdArgs.push_back("-D_MT");
4431 CmdArgs.push_back("--dependent-lib=libcmt");
4434 CmdArgs.push_back("-D_DEBUG");
4435 CmdArgs.push_back("-D_MT");
4436 CmdArgs.push_back("--dependent-lib=libcmtd");
4445 CmdArgs.push_back("--dependent-lib=oldnames");
4448 A->render(Args, CmdArgs);
4453 CmdArgs.push_back("-fno-rtti-data");
4459 CmdArgs.push_back("-fexceptions");
4460 CmdArgs.push_back("-fcxx-exceptions");
4465 CmdArgs.push_back("-E");
4466 CmdArgs.push_back("-P");
4488 CmdArgs.push_back("-fms-memptr-rep=single");
4490 CmdArgs.push_back("-fms-memptr-rep=multiple");
4492 CmdArgs.push_back("-fms-memptr-rep=virtual");
4496 A->render(Args, CmdArgs);
4499 CmdArgs.push_back("-fdiagnostics-format");
4501 CmdArgs.push_back("msvc-fallback");
4503 CmdArgs.push_back("msvc");
4518 ArgStringList CmdArgs;
4531 CmdArgs.push_back("-cc1as");
4534 CmdArgs.push_back("-triple");
4537 CmdArgs.push_back(Args.MakeArgString(TripleStr));
4541 CmdArgs.push_back("-filetype");
4542 CmdArgs.push_back("obj");
4546 CmdArgs.push_back("-main-file-name");
4547 CmdArgs.push_back(Clang::getBaseInputName(Args, Inputs));
4553 CmdArgs.push_back("-target-cpu");
4554 CmdArgs.push_back(Args.MakeArgString(CPU));
4559 getTargetFeatures(D, Triple, Args, CmdArgs, true);
4578 CmdArgs.push_back("-g");
4581 CmdArgs.push_back("-gdwarf-2");
4583 CmdArgs.push_back("-gdwarf-3");
4585 CmdArgs.push_back("-gdwarf-4");
4588 addDebugCompDirArg(Args, CmdArgs);
4592 CmdArgs.push_back("-dwarf-debug-producer");
4593 CmdArgs.push_back(Args.MakeArgString(getClangFullVersion()));
4610 CmdArgs.push_back("-dwarf-debug-flags");
4611 CmdArgs.push_back(Args.MakeArgString(Flags.str()));
4626 CollectArgsForIntegratedAssembler(C, Args, CmdArgs,
4629 Args.AddAllArgs(CmdArgs, options::OPT_mllvm);
4632 CmdArgs.push_back("-o");
4633 CmdArgs.push_back(Output.getFilename());
4636 CmdArgs.push_back(Input.getFilename());
4639 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
4656 ArgStringList CmdArgs;
4675 A->render(Args, CmdArgs);
4679 RenderExtraToolArgs(JA, CmdArgs);
4684 CmdArgs.push_back("-arch");
4688 CmdArgs.push_back("ppc");
4690 CmdArgs.push_back("ppc64");
4692 CmdArgs.push_back("ppc64le");
4694 CmdArgs.push_back(Args.MakeArgString(getToolChain().getArchName()));
4703 CmdArgs.push_back("-m32");
4706 CmdArgs.push_back("-m64");
4709 CmdArgs.push_back("-o");
4710 CmdArgs.push_back(Output.getFilename());
4713 CmdArgs.push_back("-fsyntax-only");
4716 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
4741 CmdArgs.push_back("-x");
4742 CmdArgs.push_back(types::getTypeName(II.getType()));
4746 CmdArgs.push_back(II.getFilename());
4752 CmdArgs.push_back("-lstdc++");
4757 A.render(Args, CmdArgs);
4772 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
4776 ArgStringList &CmdArgs) const {
4777 CmdArgs.push_back("-E");
4781 ArgStringList &CmdArgs) const {
4787 CmdArgs.push_back("-c");
4793 CmdArgs.push_back("-S");
4798 ArgStringList &CmdArgs) const {
4804 ArgStringList &CmdArgs) const {
4814 ArgStringList CmdArgs;
4818 CmdArgs.push_back(Args.MakeArgString(MarchString));
4820 RenderExtraToolArgs(JA, CmdArgs);
4823 CmdArgs.push_back("-o");
4824 CmdArgs.push_back(Output.getFilename());
4827 CmdArgs.push_back("-fsyntax-only");
4832 CmdArgs.push_back(
4835 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
4860 CmdArgs.push_back(II.getFilename());
4863 II.getInputArg().render(Args, CmdArgs);
4868 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
4872 ArgStringList &CmdArgs) const {
4886 ArgStringList CmdArgs;
4913 CmdArgs.push_back(Opt.c_str());
4916 CmdArgs.push_back(Args.MakeArgString("-m" + MarchString));
4919 CmdArgs.push_back("-shared");
4920 CmdArgs.push_back("-call_shared"); // should be the default, but doing as
4925 CmdArgs.push_back("-static");
4928 CmdArgs.push_back("-pie");
4932 CmdArgs.push_back(
4939 CmdArgs.push_back("-o");
4940 CmdArgs.push_back(Output.getFilename());
4976 CmdArgs.push_back(
4979 CmdArgs.push_back(Args.MakeArgString(StartFilesDir + "/crt0.o"));
4982 CmdArgs.push_back(Args.MakeArgString(StartFilesDir + initObj));
4990 CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
4995 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
4996 Args.AddAllArgs(CmdArgs, options::OPT_e);
4997 Args.AddAllArgs(CmdArgs, options::OPT_s);
4998 Args.AddAllArgs(CmdArgs, options::OPT_t);
4999 Args.AddAllArgs(CmdArgs, options::OPT_u_Group);
5001 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
5008 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
5009 CmdArgs.push_back("-lm");
5012 CmdArgs.push_back("--start-group");
5017 CmdArgs.push_back(Args.MakeArgString("-l" + *i));
5018 CmdArgs.push_back("-lc");
5020 CmdArgs.push_back("-lgcc");
5022 CmdArgs.push_back("--end-group");
5030 CmdArgs.push_back(Args.MakeArgString(StartFilesDir + finiObj));
5034 C.addCommand(new Command(JA, *this, Args.MakeArgString(Linker), CmdArgs));
5293 ArgStringList CmdArgs;
5313 CmdArgs.push_back("-Q");
5320 CmdArgs.push_back("--gstabs");
5322 CmdArgs.push_back("-g");
5326 AddMachOArch(Args, CmdArgs);
5332 CmdArgs.push_back("-force_cpusubtype_ALL");
5339 CmdArgs.push_back("-static");
5341 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
5345 CmdArgs.push_back("-o");
5346 CmdArgs.push_back(Output.getFilename());
5349 CmdArgs.push_back(Input.getFilename());
5355 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5361 ArgStringList &CmdArgs) const {
5365 CmdArgs.push_back("-arch");
5366 CmdArgs.push_back(Args.MakeArgString(ArchName));
5370 CmdArgs.push_back("-force_cpusubtype_ALL");
5386 ArgStringList &CmdArgs,
5404 CmdArgs.push_back("-demangle");
5407 CmdArgs.push_back("-export_dynamic");
5416 CmdArgs.push_back("-object_path_lto");
5417 CmdArgs.push_back(TmpPath);
5421 Args.AddAllArgs(CmdArgs, options::OPT_static);
5423 CmdArgs.push_back("-dynamic");
5430 AddMachOArch(Args, CmdArgs);
5432 Args.AddLastArg(CmdArgs, options::OPT_force__cpusubtype__ALL);
5434 Args.AddLastArg(CmdArgs, options::OPT_bundle);
5435 Args.AddAllArgs(CmdArgs, options::OPT_bundle__loader);
5436 Args.AddAllArgs(CmdArgs, options::OPT_client__name);
5445 Args.AddLastArg(CmdArgs, options::OPT_force__flat__namespace);
5446 Args.AddLastArg(CmdArgs, options::OPT_keep__private__externs);
5447 Args.AddLastArg(CmdArgs, options::OPT_private__bundle);
5449 CmdArgs.push_back("-dylib");
5461 Args.AddAllArgsTranslated(CmdArgs, options::OPT_compatibility__version,
5463 Args.AddAllArgsTranslated(CmdArgs, options::OPT_current__version,
5466 AddMachOArch(Args, CmdArgs);
5468 Args.AddAllArgsTranslated(CmdArgs, options::OPT_install__name,
5472 Args.AddLastArg(CmdArgs, options::OPT_all__load);
5473 Args.AddAllArgs(CmdArgs, options::OPT_allowable__client);
5474 Args.AddLastArg(CmdArgs, options::OPT_bind__at__load);
5476 Args.AddLastArg(CmdArgs, options::OPT_arch__errors__fatal);
5477 Args.AddLastArg(CmdArgs, options::OPT_dead__strip);
5478 Args.AddLastArg(CmdArgs, options::OPT_no__dead__strip__inits__and__terms);
5479 Args.AddAllArgs(CmdArgs, options::OPT_dylib__file);
5480 Args.AddLastArg(CmdArgs, options::OPT_dynamic);
5481 Args.AddAllArgs(CmdArgs, options::OPT_exported__symbols__list);
5482 Args.AddLastArg(CmdArgs, options::OPT_flat__namespace);
5483 Args.AddAllArgs(CmdArgs, options::OPT_force__load);
5484 Args.AddAllArgs(CmdArgs, options::OPT_headerpad__max__install__names);
5485 Args.AddAllArgs(CmdArgs, options::OPT_image__base);
5486 Args.AddAllArgs(CmdArgs, options::OPT_init);
5489 MachOTC.addMinVersionArgs(Args, CmdArgs);
5491 Args.AddLastArg(CmdArgs, options::OPT_nomultidefs);
5492 Args.AddLastArg(CmdArgs, options::OPT_multi__module);
5493 Args.AddLastArg(CmdArgs, options::OPT_single__module);
5494 Args.AddAllArgs(CmdArgs, options::OPT_multiply__defined);
5495 Args.AddAllArgs(CmdArgs, options::OPT_multiply__defined__unused);
5502 CmdArgs.push_back("-pie");
5504 CmdArgs.push_back("-no_pie");
5507 Args.AddLastArg(CmdArgs, options::OPT_prebind);
5508 Args.AddLastArg(CmdArgs, options::OPT_noprebind);
5509 Args.AddLastArg(CmdArgs, options::OPT_nofixprebinding);
5510 Args.AddLastArg(CmdArgs, options::OPT_prebind__all__twolevel__modules);
5511 Args.AddLastArg(CmdArgs, options::OPT_read__only__relocs);
5512 Args.AddAllArgs(CmdArgs, options::OPT_sectcreate);
5513 Args.AddAllArgs(CmdArgs, options::OPT_sectorder);
5514 Args.AddAllArgs(CmdArgs, options::OPT_seg1addr);
5515 Args.AddAllArgs(CmdArgs, options::OPT_segprot);
5516 Args.AddAllArgs(CmdArgs, options::OPT_segaddr);
5517 Args.AddAllArgs(CmdArgs, options::OPT_segs__read__only__addr);
5518 Args.AddAllArgs(CmdArgs, options::OPT_segs__read__write__addr);
5519 Args.AddAllArgs(CmdArgs, options::OPT_seg__addr__table);
5520 Args.AddAllArgs(CmdArgs, options::OPT_seg__addr__table__filename);
5521 Args.AddAllArgs(CmdArgs, options::OPT_sub__library);
5522 Args.AddAllArgs(CmdArgs, options::OPT_sub__umbrella);
5528 CmdArgs.push_back("-syslibroot");
5529 CmdArgs.push_back(C.getArgs().MakeArgString(sysroot));
5531 CmdArgs.push_back("-syslibroot");
5532 CmdArgs.push_back(A->getValue());
5535 Args.AddLastArg(CmdArgs, options::OPT_twolevel__namespace);
5536 Args.AddLastArg(CmdArgs, options::OPT_twolevel__namespace__hints);
5537 Args.AddAllArgs(CmdArgs, options::OPT_umbrella);
5538 Args.AddAllArgs(CmdArgs, options::OPT_undefined);
5539 Args.AddAllArgs(CmdArgs, options::OPT_unexported__symbols__list);
5540 Args.AddAllArgs(CmdArgs, options::OPT_weak__reference__mismatches);
5541 Args.AddLastArg(CmdArgs, options::OPT_X_Flag);
5542 Args.AddAllArgs(CmdArgs, options::OPT_y);
5543 Args.AddLastArg(CmdArgs, options::OPT_w);
5544 Args.AddAllArgs(CmdArgs, options::OPT_pagezero__size);
5545 Args.AddAllArgs(CmdArgs, options::OPT_segs__read__);
5546 Args.AddLastArg(CmdArgs, options::OPT_seglinkedit);
5547 Args.AddLastArg(CmdArgs, options::OPT_noseglinkedit);
5548 Args.AddAllArgs(CmdArgs, options::OPT_sectalign);
5549 Args.AddAllArgs(CmdArgs, options::OPT_sectobjectsymbols);
5550 Args.AddAllArgs(CmdArgs, options::OPT_segcreate);
5551 Args.AddLastArg(CmdArgs, options::OPT_whyload);
5552 Args.AddLastArg(CmdArgs, options::OPT_whatsloaded);
5553 Args.AddAllArgs(CmdArgs, options::OPT_dylinker__install__name);
5554 Args.AddLastArg(CmdArgs, options::OPT_dylinker);
5555 Args.AddLastArg(CmdArgs, options::OPT_Mach);
5574 ArgStringList CmdArgs;
5583 CmdArgs.push_back(Output.getFilename());
5584 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5590 AddLinkArgs(C, Args, CmdArgs, Inputs);
5592 Args.AddAllArgs(CmdArgs, options::OPT_d_Flag);
5593 Args.AddAllArgs(CmdArgs, options::OPT_s);
5594 Args.AddAllArgs(CmdArgs, options::OPT_t);
5595 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
5596 Args.AddAllArgs(CmdArgs, options::OPT_u_Group);
5597 Args.AddLastArg(CmdArgs, options::OPT_e);
5598 Args.AddAllArgs(CmdArgs, options::OPT_r);
5604 CmdArgs.push_back("-ObjC");
5606 CmdArgs.push_back("-o");
5607 CmdArgs.push_back(Output.getFilename());
5611 getMachOToolChain().addStartObjectFileArgs(Args, CmdArgs);
5613 Args.AddAllArgs(CmdArgs, options::OPT_L);
5629 CmdArgs.push_back("-lgomp");
5632 CmdArgs.push_back("-liomp5");
5638 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
5644 getMachOToolChain().AddLinkARCArgs(Args, CmdArgs);
5646 CmdArgs.push_back("-framework");
5647 CmdArgs.push_back("Foundation");
5649 CmdArgs.push_back("-lobjc");
5653 CmdArgs.push_back("-arch_multiple");
5654 CmdArgs.push_back("-final_output");
5655 CmdArgs.push_back(LinkingOutput);
5659 CmdArgs.push_back("-allow_stack_execute");
5664 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
5669 getMachOToolChain().AddLinkRuntimeLibArgs(Args, CmdArgs);
5677 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
5678 Args.AddAllArgs(CmdArgs, options::OPT_F);
5682 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5690 ArgStringList CmdArgs;
5692 CmdArgs.push_back("-create");
5695 CmdArgs.push_back("-output");
5696 CmdArgs.push_back(Output.getFilename());
5700 CmdArgs.push_back(II.getFilename());
5704 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5712 ArgStringList CmdArgs;
5714 CmdArgs.push_back("-o");
5715 CmdArgs.push_back(Output.getFilename());
5720 CmdArgs.push_back(Input.getFilename());
5724 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5732 ArgStringList CmdArgs;
5733 CmdArgs.push_back("--verify");
5734 CmdArgs.push_back("--debug-info");
5735 CmdArgs.push_back("--eh-frame");
5736 CmdArgs.push_back("--quiet");
5743 CmdArgs.push_back(Input.getFilename());
5747 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5755 ArgStringList CmdArgs;
5757 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
5760 CmdArgs.push_back("-o");
5761 CmdArgs.push_back(Output.getFilename());
5764 CmdArgs.push_back(II.getFilename());
5767 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5794 ArgStringList CmdArgs;
5797 CmdArgs.push_back("-C");
5801 CmdArgs.push_back("-e");
5802 CmdArgs.push_back("_start");
5806 CmdArgs.push_back("-Bstatic");
5807 CmdArgs.push_back("-dn");
5809 CmdArgs.push_back("-Bdynamic");
5811 CmdArgs.push_back("-shared");
5813 CmdArgs.push_back("--dynamic-linker");
5814 CmdArgs.push_back(Args.MakeArgString(LibPath + "ld.so.1"));
5819 CmdArgs.push_back("-o");
5820 CmdArgs.push_back(Output.getFilename());
5828 CmdArgs.push_back(Args.MakeArgString(LibPath + "crt1.o"));
5829 CmdArgs.push_back(Args.MakeArgString(LibPath + "crti.o"));
5830 CmdArgs.push_back(Args.MakeArgString(LibPath + "values-Xa.o"));
5831 CmdArgs.push_back(Args.MakeArgString(GCCLibPath + "crtbegin.o"));
5833 CmdArgs.push_back(Args.MakeArgString(LibPath + "crti.o"));
5834 CmdArgs.push_back(Args.MakeArgString(LibPath + "values-Xa.o"));
5835 CmdArgs.push_back(Args.MakeArgString(GCCLibPath + "crtbegin.o"));
5838 CmdArgs.push_back(Args.MakeArgString(LibPath + "cxa_finalize.o"));
5841 CmdArgs.push_back(Args.MakeArgString("-L" + GCCLibPath));
5843 Args.AddAllArgs(CmdArgs, options::OPT_L);
5844 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
5845 Args.AddAllArgs(CmdArgs, options::OPT_e);
5846 Args.AddAllArgs(CmdArgs, options::OPT_r);
5848 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
5853 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
5854 CmdArgs.push_back("-lgcc_s");
5856 CmdArgs.push_back("-lgcc");
5857 CmdArgs.push_back("-lc");
5858 CmdArgs.push_back("-lm");
5864 CmdArgs.push_back(Args.MakeArgString(GCCLibPath + "crtend.o"));
5866 CmdArgs.push_back(Args.MakeArgString(LibPath + "crtn.o"));
5868 addProfileRT(getToolChain(), Args, CmdArgs);
5872 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5880 ArgStringList CmdArgs;
5882 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
5885 CmdArgs.push_back("-o");
5886 CmdArgs.push_back(Output.getFilename());
5889 CmdArgs.push_back(II.getFilename());
5892 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5900 ArgStringList CmdArgs;
5904 CmdArgs.push_back("-e");
5905 CmdArgs.push_back("_start");
5909 CmdArgs.push_back("-Bstatic");
5910 CmdArgs.push_back("-dn");
5912 // CmdArgs.push_back("--eh-frame-hdr");
5913 CmdArgs.push_back("-Bdynamic");
5915 CmdArgs.push_back("-shared");
5917 CmdArgs.push_back("--dynamic-linker");
5918 CmdArgs.push_back("/lib/ld.so.1"); // 64Bit Path /lib/amd64/ld.so.1
5923 CmdArgs.push_back("-o");
5924 CmdArgs.push_back(Output.getFilename());
5932 CmdArgs.push_back(Args.MakeArgString(
5934 CmdArgs.push_back(Args.MakeArgString(
5936 CmdArgs.push_back(Args.MakeArgString(
5939 CmdArgs.push_back(Args.MakeArgString(
5942 CmdArgs.push_back(Args.MakeArgString(
5946 CmdArgs.push_back(Args.MakeArgString("-L/opt/gcc4/lib/gcc/"
5950 Args.AddAllArgs(CmdArgs, options::OPT_L);
5951 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
5952 Args.AddAllArgs(CmdArgs, options::OPT_e);
5954 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
5960 CmdArgs.push_back("-lgcc");
5963 CmdArgs.push_back("-pthread");
5965 CmdArgs.push_back("-lc");
5966 CmdArgs.push_back("-lgcc");
5972 CmdArgs.push_back(Args.MakeArgString(
5976 addProfileRT(getToolChain(), Args, CmdArgs);
5980 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
5988 ArgStringList CmdArgs;
5995 CmdArgs.push_back("--32");
5999 CmdArgs.push_back("-mppc");
6000 CmdArgs.push_back("-many");
6004 CmdArgs.push_back("-32");
6009 CmdArgs.push_back("-64");
6010 CmdArgs.push_back("-Av9a");
6020 CmdArgs.push_back("-mabi");
6021 CmdArgs.push_back(getGnuCompatibleMipsABIName(ABIName).data());
6024 CmdArgs.push_back("-EB");
6026 CmdArgs.push_back("-EL");
6037 addAssemblerKPIC(Args, CmdArgs);
6039 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
6042 CmdArgs.push_back("-o");
6043 CmdArgs.push_back(Output.getFilename());
6046 CmdArgs.push_back(II.getFilename());
6050 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
6059 ArgStringList CmdArgs;
6070 CmdArgs.push_back("-EB");
6072 CmdArgs.push_back("-EL");
6076 CmdArgs.push_back("-e");
6077 CmdArgs.push_back("__start");
6081 CmdArgs.push_back("-Bstatic");
6084 CmdArgs.push_back("-export-dynamic");
6085 CmdArgs.push_back("--eh-frame-hdr");
6086 CmdArgs.push_back("-Bdynamic");
6088 CmdArgs.push_back("-shared");
6090 CmdArgs.push_back("-dynamic-linker");
6091 CmdArgs.push_back("/usr/libexec/ld.so");
6096 CmdArgs.push_back("-nopie");
6099 CmdArgs.push_back("-o");
6100 CmdArgs.push_back(Output.getFilename());
6109 CmdArgs.push_back(Args.MakeArgString(
6112 CmdArgs.push_back(Args.MakeArgString(
6114 CmdArgs.push_back(Args.MakeArgString(
6117 CmdArgs.push_back(Args.MakeArgString(
6125 CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc-lib/" + Triple +
6128 Args.AddAllArgs(CmdArgs, options::OPT_L);
6129 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
6130 Args.AddAllArgs(CmdArgs, options::OPT_e);
6131 Args.AddAllArgs(CmdArgs, options::OPT_s);
6132 Args.AddAllArgs(CmdArgs, options::OPT_t);
6133 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
6134 Args.AddAllArgs(CmdArgs, options::OPT_r);
6136 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
6141 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
6143 CmdArgs
6145 CmdArgs.push_back("-lm");
6150 CmdArgs.push_back("-lgcc");
6155 CmdArgs.push_back("-lpthread_p");
6157 CmdArgs.push_back("-lpthread");
6162 CmdArgs.push_back("-lc_p");
6164 CmdArgs.push_back("-lc");
6167 CmdArgs.push_back("-lgcc");
6173 CmdArgs.push_back(Args.MakeArgString(
6176 CmdArgs.push_back(Args.MakeArgString(
6182 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
6190 ArgStringList CmdArgs;
6192 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
6195 CmdArgs.push_back("-o");
6196 CmdArgs.push_back(Output.getFilename());
6199 CmdArgs.push_back(II.getFilename());
6202 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
6211 ArgStringList CmdArgs;
6215 CmdArgs.push_back("-e");
6216 CmdArgs.push_back("__start");
6220 CmdArgs.push_back("-Bstatic");
6223 CmdArgs.push_back("-export-dynamic");
6224 CmdArgs.push_back("--eh-frame-hdr");
6225 CmdArgs.push_back("-Bdynamic");
6227 CmdArgs.push_back("-shared");
6229 CmdArgs.push_back("-dynamic-linker");
6230 CmdArgs.push_back("/usr/libexec/ld.so");
6235 CmdArgs.push_back("-o");
6236 CmdArgs.push_back(Output.getFilename());
6245 CmdArgs.push_back(Args.MakeArgString(
6248 CmdArgs.push_back(Args.MakeArgString(
6250 CmdArgs.push_back(Args.MakeArgString(
6253 CmdArgs.push_back(Args.MakeArgString(
6258 Args.AddAllArgs(CmdArgs, options::OPT_L);
6259 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
6260 Args.AddAllArgs(CmdArgs, options::OPT_e);
6262 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
6267 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
6269 CmdArgs.push_back("-lm_p");
6271 CmdArgs.push_back("-lm");
6277 CmdArgs.push_back("-lpthread_p");
6279 CmdArgs.push_back("-lpthread");
6284 CmdArgs.push_back("-lc_p");
6286 CmdArgs.push_back("-lc");
6303 CmdArgs.push_back(Args.MakeArgString("-lclang_rt." + MyArch));
6309 CmdArgs.push_back(Args.MakeArgString(
6312 CmdArgs.push_back(Args.MakeArgString(
6318 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
6326 ArgStringList CmdArgs;
6331 CmdArgs.push_back("--32");
6333 CmdArgs.push_back("-a32");
6342 CmdArgs.push_back("-march");
6343 CmdArgs.push_back(CPUName.data());
6345 CmdArgs.push_back("-mabi");
6346 CmdArgs.push_back(getGnuCompatibleMipsABIName(ABIName).data());
6350 CmdArgs.push_back("-EB");
6352 CmdArgs.push_back("-EL");
6354 addAssemblerKPIC(Args, CmdArgs);
6364 CmdArgs.push_back("-mfpu=vfp");
6366 CmdArgs.push_back("-mfpu=softvfp");
6373 CmdArgs.push_back("-meabi=5");
6377 CmdArgs.push_back("-matpcs");
6382 CmdArgs.push_back("-Av8plusa");
6384 CmdArgs.push_back("-Av9a");
6386 addAssemblerKPIC(Args, CmdArgs);
6389 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
6392 CmdArgs.push_back("-o");
6393 CmdArgs.push_back(Output.getFilename());
6396 CmdArgs.push_back(II.getFilename());
6399 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
6413 ArgStringList CmdArgs;
6424 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
6427 CmdArgs.push_back("-pie");
6430 CmdArgs.push_back("-Bstatic");
6433 CmdArgs.push_back("-export-dynamic");
6434 CmdArgs.push_back("--eh-frame-hdr");
6436 CmdArgs.push_back("-Bshareable");
6438 CmdArgs.push_back("-dynamic-linker");
6439 CmdArgs.push_back("/libexec/ld-elf.so.1");
6445 CmdArgs.push_back("--hash-style=both");
6448 CmdArgs.push_back("--enable-new-dtags");
6454 CmdArgs.push_back("-m");
6455 CmdArgs.push_back("elf_i386_fbsd");
6459 CmdArgs.push_back("-m");
6460 CmdArgs.push_back("elf32ppc_fbsd");
6464 CmdArgs.push_back("-o");
6465 CmdArgs.push_back(Output.getFilename());
6482 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
6484 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
6494 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
6497 Args.AddAllArgs(CmdArgs, options::OPT_L);
6500 CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + Path));
6501 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
6502 Args.AddAllArgs(CmdArgs, options::OPT_e);
6503 Args.AddAllArgs(CmdArgs, options::OPT_s);
6504 Args.AddAllArgs(CmdArgs, options::OPT_t);
6505 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
6506 Args.AddAllArgs(CmdArgs, options::OPT_r);
6509 AddGoldPlugin(ToolChain, Args, CmdArgs);
6511 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
6516 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
6518 CmdArgs.push_back("-lm_p");
6520 CmdArgs.push_back("-lm");
6525 CmdArgs.push_back("-lgcc_p");
6527 CmdArgs.push_back("-lgcc");
6529 CmdArgs.push_back("-lgcc_eh");
6531 CmdArgs.push_back("-lgcc_eh_p");
6533 CmdArgs.push_back("--as-needed");
6534 CmdArgs.push_back("-lgcc_s");
6535 CmdArgs.push_back("--no-as-needed");
6540 CmdArgs.push_back("-lpthread_p");
6542 CmdArgs.push_back("-lpthread");
6547 CmdArgs.push_back("-lc");
6549 CmdArgs.push_back("-lc_p");
6550 CmdArgs.push_back("-lgcc_p");
6552 CmdArgs.push_back("-lc");
6553 CmdArgs.push_back("-lgcc");
6557 CmdArgs.push_back("-lgcc_eh");
6559 CmdArgs.push_back("-lgcc_eh_p");
6561 CmdArgs.push_back("--as-needed");
6562 CmdArgs.push_back("-lgcc_s");
6563 CmdArgs.push_back("--no-as-needed");
6570 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtendS.o")));
6572 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
6573 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
6576 addSanitizerRuntimes(getToolChain(), Args, CmdArgs);
6578 addProfileRT(ToolChain, Args, CmdArgs);
6582 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
6590 ArgStringList CmdArgs;
6596 CmdArgs.push_back("--32");
6603 CmdArgs.push_back(Args.MakeArgString("-mcpu=" + MArch));
6615 CmdArgs.push_back("-march");
6616 CmdArgs.push_back(CPUName.data());
6618 CmdArgs.push_back("-mabi");
6619 CmdArgs.push_back(getGnuCompatibleMipsABIName(ABIName).data());
6623 CmdArgs.push_back("-EB");
6625 CmdArgs.push_back("-EL");
6627 addAssemblerKPIC(Args, CmdArgs);
6632 CmdArgs.push_back("-32");
6633 addAssemblerKPIC(Args, CmdArgs);
6637 CmdArgs.push_back("-64");
6638 CmdArgs.push_back("-Av9");
6639 CmdArgs);
6646 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
6649 CmdArgs.push_back("-o");
6650 CmdArgs.push_back(Output.getFilename());
6653 CmdArgs.push_back(II.getFilename());
6656 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
6665 ArgStringList CmdArgs;
6668 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
6670 CmdArgs.push_back("--eh-frame-hdr");
6672 CmdArgs.push_back("-Bstatic");
6675 CmdArgs.push_back("-export-dynamic");
6677 CmdArgs.push_back("-Bshareable");
6679 CmdArgs.push_back("-dynamic-linker");
6680 CmdArgs.push_back("/libexec/ld.elf_so");
6688 CmdArgs.push_back("-m");
6689 CmdArgs.push_back("elf_i386");
6695 CmdArgs.push_back("-m");
6699 CmdArgs.push_back("armelf_nbsd_eabi");
6703 CmdArgs.push_back("armelf_nbsd_eabihf");
6706 CmdArgs.push_back("armelf_nbsd");
6713 CmdArgs.push_back("-m");
6715 CmdArgs.push_back("elf32btsmip");
6717 CmdArgs.push_back("elf32ltsmip");
6719 CmdArgs.push_back("-m");
6721 CmdArgs.push_back("elf64btsmip");
6723 CmdArgs.push_back("elf64ltsmip");
6728 CmdArgs.push_back("-m");
6729 CmdArgs.push_back("elf32_sparc");
6733 CmdArgs.push_back("-m");
6734 CmdArgs.push_back("elf64_sparc");
6742 CmdArgs.push_back("-o");
6743 CmdArgs.push_back(Output.getFilename());
6751 CmdArgs.push_back(Args.MakeArgString(
6753 CmdArgs.push_back(Args.MakeArgString(
6755 CmdArgs.push_back(Args.MakeArgString(
6758 CmdArgs.push_back(Args.MakeArgString(
6760 CmdArgs.push_back(Args.MakeArgString(
6765 Args.AddAllArgs(CmdArgs, options::OPT_L);
6766 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
6767 Args.AddAllArgs(CmdArgs, options::OPT_e);
6768 Args.AddAllArgs(CmdArgs, options::OPT_s);
6769 Args.AddAllArgs(CmdArgs, options::OPT_t);
6770 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
6771 Args.AddAllArgs(CmdArgs, options::OPT_r);
6773 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
6796 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
6797 CmdArgs.push_back("-lm");
6800 CmdArgs.push_back("-lpthread");
6801 CmdArgs.push_back("-lc");
6808 CmdArgs.push_back("-lgcc_eh");
6809 CmdArgs.push_back("-lc");
6810 CmdArgs.push_back("-lgcc");
6812 CmdArgs.push_back("-lgcc");
6813 CmdArgs.push_back("--as-needed");
6814 CmdArgs.push_back("-lgcc_s");
6815 CmdArgs.push_back("--no-as-needed");
6823 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath(
6826 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath(
6828 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath(
6832 addProfileRT(getToolChain(), Args, CmdArgs);
6835 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
6843 ArgStringList CmdArgs;
6849 CmdArgs.push_back("--32");
6852 CmdArgs.push_back("--x32");
6854 CmdArgs.push_back("--64");
6856 CmdArgs.push_back("-a32");
6857 CmdArgs.push_back("-mppc");
6858 CmdArgs.push_back("-many");
6860 CmdArgs.push_back("-a64");
6861 CmdArgs.push_back("-mppc64");
6862 CmdArgs.push_back("-many");
6864 CmdArgs.push_back("-a64");
6865 CmdArgs.push_back("-mppc64");
6866 CmdArgs.push_back("-many");
6867 CmdArgs.push_back("-mlittle-endian");
6869 CmdArgs.push_back("-32");
6870 CmdArgs.push_back("-Av8plusa");
6873 CmdArgs.push_back("-64");
6874 CmdArgs.push_back("-Av9a");
6880 CmdArgs.push_back("-mfpu=neon");
6883 CmdArgs.push_back("-mfpu=crypto-neon-fp-armv8");
6887 CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=" + ARMFloatABI));
6889 Args.AddLastArg(CmdArgs, options::OPT_march_EQ);
6897 CmdArgs.push_back("-march=armv7-a");
6899 Args.AddLastArg(CmdArgs, options::OPT_mcpu_EQ);
6900 Args.AddLastArg(CmdArgs, options::OPT_mfpu_EQ);
6909 CmdArgs.push_back("-march");
6910 CmdArgs.push_back(CPUName.data());
6912 CmdArgs.push_back("-mabi");
6913 CmdArgs.push_back(getGnuCompatibleMipsABIName(ABIName).data());
6917 CmdArgs.push_back("-EB");
6919 CmdArgs.push_back("-EL");
6923 CmdArgs.push_back(Args.MakeArgString("-mnan=2008"));
6926 Args.AddLastArg(CmdArgs, options::OPT_mfp32, options::OPT_mfp64);
6927 Args.AddLastArg(CmdArgs, options::OPT_mips16, options::OPT_mno_mips16);
6928 Args.AddLastArg(CmdArgs, options::OPT_mmicromips,
6930 Args.AddLastArg(CmdArgs, options::OPT_mdsp, options::OPT_mno_dsp);
6931 Args.AddLastArg(CmdArgs, options::OPT_mdspr2, options::OPT_mno_dspr2);
6937 CmdArgs.push_back(Args.MakeArgString("-mmsa"));
6945 CmdArgs.push_back(Args.MakeArgString("-march=" + CPUName));
6949 addAssemblerKPIC(Args, CmdArgs);
6951 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
6954 CmdArgs.push_back("-o");
6955 CmdArgs.push_back(Output.getFilename());
6958 CmdArgs.push_back(II.getFilename());
6961 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
6973 ArgStringList &CmdArgs, const ArgList &Args) {
6978 CmdArgs.push_back("-lgcc");
6982 CmdArgs.push_back("-lgcc");
6985 CmdArgs.push_back("--as-needed");
6986 CmdArgs.push_back("-lgcc_s");
6988 CmdArgs.push_back("--no-as-needed");
6992 CmdArgs.push_back("-lgcc_eh");
6994 CmdArgs.push_back("-lgcc");
7002 CmdArgs.push_back("-ldl");
7062 ArgStringList &CmdArgs, const ArgList &Args) {
7068 addClangRTLinux(TC, Args, CmdArgs);
7071 AddLibgcc(TC.getTriple(), D, CmdArgs, Args);
7095 ArgStringList CmdArgs;
7106 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
7109 CmdArgs.push_back("-pie");
7112 CmdArgs.push_back("-export-dynamic");
7115 CmdArgs.push_back("-s");
7118 CmdArgs.push_back(Opt.c_str());
7121 CmdArgs.push_back("--eh-frame-hdr");
7124 CmdArgs.push_back("-m");
7126 CmdArgs.push_back("elf_i386");
7129 CmdArgs.push_back("aarch64linux");
7132 CmdArgs.push_back("aarch64_be_linux");
7135 CmdArgs.push_back("armelf_linux_eabi");
7138 CmdArgs.push_back("armebelf_linux_eabi"); /* TODO: check which NAME. */
7140 CmdArgs.push_back("elf32ppclinux");
7142 CmdArgs.push_back("elf64ppc");
7144 CmdArgs.push_back("elf64lppc");
7146 CmdArgs.push_back("elf32_sparc");
7148 CmdArgs.push_back("elf64_sparc");
7150 CmdArgs.push_back("elf32btsmip");
7152 CmdArgs.push_back("elf32ltsmip");
7155 CmdArgs.push_back("elf32btsmipn32");
7157 CmdArgs.push_back("elf64btsmip");
7161 CmdArgs.push_back("elf32ltsmipn32");
7163 CmdArgs.push_back("elf64ltsmip");
7166 CmdArgs.push_back("elf64_s390");
7169 CmdArgs.push_back("elf32_x86_64");
7171 CmdArgs.push_back("elf_x86_64");
7178 CmdArgs.push_back("-Bstatic");
7180 CmdArgs.push_back("-static");
7182 CmdArgs.push_back("-shared");
7191 CmdArgs.push_back("-dynamic-linker");
7192 CmdArgs.push_back(Args.MakeArgString(
7196 CmdArgs.push_back("-o");
7197 CmdArgs.push_back(Output.getFilename());
7212 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
7214 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
7226 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
7229 ToolChain.AddFastMathRuntimeIfAvailable(Args, CmdArgs);
7232 Args.AddAllArgs(CmdArgs, options::OPT_L);
7233 Args.AddAllArgs(CmdArgs, options::OPT_u);
7238 CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + Path));
7241 AddGoldPlugin(ToolChain, Args, CmdArgs);
7244 CmdArgs.push_back("--no-demangle");
7246 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
7248 addSanitizerRuntimes(getToolChain(), Args, CmdArgs);
7250 addProfileRT(getToolChain(), Args, CmdArgs);
7258 CmdArgs.push_back("-Bstatic");
7259 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
7261 CmdArgs.push_back("-Bdynamic");
7262 CmdArgs.push_back("-lm");
7268 CmdArgs.push_back("--start-group");
7284 CmdArgs.push_back("-lgomp");
7288 CmdArgs.push_back("-lrt");
7291 CmdArgs.push_back("-liomp5");
7296 AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
7301 CmdArgs.push_back("-lpthread");
7303 CmdArgs.push_back("-lc");
7306 CmdArgs.push_back("--end-group");
7308 AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
7320 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
7322 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
7326 C.addCommand(new Command(JA, *this, ToolChain.Linker.c_str(), CmdArgs));
7334 ArgStringList CmdArgs;
7336 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
7338 CmdArgs.push_back("-o");
7339 CmdArgs.push_back(Output.getFilename());
7342 CmdArgs.push_back(II.getFilename());
7345 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
7354 ArgStringList CmdArgs;
7357 CmdArgs.push_back("-o");
7358 CmdArgs.push_back(Output.getFilename());
7365 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crt1.o")));
7366 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crti.o")));
7367 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
7368 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
7371 Args.AddAllArgs(CmdArgs, options::OPT_L);
7372 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
7373 Args.AddAllArgs(CmdArgs, options::OPT_e);
7375 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
7377 addProfileRT(getToolChain(), Args, CmdArgs);
7382 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
7383 CmdArgs.push_back("-lm");
7390 CmdArgs.push_back("-lpthread");
7391 CmdArgs.push_back("-lc");
7392 CmdArgs.push_back("-lCompilerRT-Generic");
7393 CmdArgs.push_back("-L/usr/pkg/compiler-rt/lib");
7394 CmdArgs.push_back(
7399 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
7411 ArgStringList CmdArgs;
7416 CmdArgs.push_back("--32");
7418 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
7420 CmdArgs.push_back("-o");
7421 CmdArgs.push_back(Output.getFilename());
7424 CmdArgs.push_back(II.getFilename());
7427 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
7437 ArgStringList CmdArgs;
7443 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
7445 CmdArgs.push_back("--eh-frame-hdr");
7447 CmdArgs.push_back("-Bstatic");
7450 CmdArgs.push_back("-export-dynamic");
7452 CmdArgs.push_back("-Bshareable");
7454 CmdArgs.push_back("-dynamic-linker");
7455 CmdArgs.push_back("/usr/libexec/ld-elf.so.2");
7457 CmdArgs.push_back("--hash-style=both");
7463 CmdArgs.push_back("-m");
7464 CmdArgs.push_back("elf_i386");
7468 CmdArgs.push_back("-o");
7469 CmdArgs.push_back(Output.getFilename());
7478 CmdArgs.push_back(Args.MakeArgString(
7482 CmdArgs.push_back(Args.MakeArgString(
7485 CmdArgs.push_back(Args.MakeArgString(
7489 CmdArgs.push_back(Args.MakeArgString(
7492 CmdArgs.push_back(Args.MakeArgString(
7495 CmdArgs.push_back(Args.MakeArgString(
7499 Args.AddAllArgs(CmdArgs, options::OPT_L);
7500 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
7501 Args.AddAllArgs(CmdArgs, options::OPT_e);
7503 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
7510 CmdArgs.push_back("-L/usr/lib/gcc47");
7512 CmdArgs.push_back("-L/usr/lib/gcc44");
7516 CmdArgs.push_back("-rpath");
7517 CmdArgs.push_back("/usr/lib/gcc47");
7519 CmdArgs.push_back("-rpath");
7520 CmdArgs.push_back("/usr/lib/gcc44");
7525 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
7526 CmdArgs.push_back("-lm");
7530 CmdArgs.push_back("-lpthread");
7533 CmdArgs.push_back("-lc");
7539 CmdArgs.push_back("-lgcc");
7540 CmdArgs.push_back("-lgcc_eh");
7543 CmdArgs.push_back("-lgcc_pic");
7545 CmdArgs.push_back("-lgcc");
7547 CmdArgs.push_back("-lgcc");
7548 CmdArgs.push_back("--as-needed");
7549 CmdArgs.push_back("-lgcc_pic");
7550 CmdArgs.push_back("--no-as-needed");
7555 CmdArgs.push_back("-lgcc_pic");
7557 CmdArgs.push_back("-lgcc");
7565 CmdArgs.push_back(Args.MakeArgString(
7568 CmdArgs.push_back(Args.MakeArgString(
7570 CmdArgs.push_back(Args.MakeArgString(
7574 addProfileRT(getToolChain(), Args, CmdArgs);
7577 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
7581 ArgStringList &CmdArgs,
7586 CmdArgs.push_back(Args.MakeArgString(LibSanitizer));
7594 ArgStringList CmdArgs;
7597 CmdArgs.push_back(Args.MakeArgString(std::string("-out:") +
7606 CmdArgs.push_back("-defaultlib:libcmt");
7609 CmdArgs.push_back("-nologo");
7612 CmdArgs.push_back("-debug");
7618 CmdArgs.push_back(Args.MakeArgString("-dll"));
7622 CmdArgs.push_back(Args.MakeArgString(std::string("-implib:") +
7627 CmdArgs.push_back(Args.MakeArgString("-debug"));
7628 CmdArgs.push_back(Args.MakeArgString("-incremental:no"));
7631 addSanitizerRTWindows(getToolChain(), Args, CmdArgs,
7634 addSanitizerRTWindows(getToolChain(), Args, CmdArgs, "asan-i386");
7635 addSanitizerRTWindows(getToolChain(), Args, CmdArgs, "asan_cxx-i386");
7639 Args.AddAllArgValues(CmdArgs, options::OPT_l);
7640 Args.AddAllArgValues(CmdArgs, options::OPT__SLASH_link);
7645 CmdArgs.push_back(Input.getFilename());
7647 Input.getInputArg().renderAsInput(Args, CmdArgs);
7651 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
7696 ArgStringList CmdArgs;
7697 CmdArgs.push_back("/nologo");
7698 CmdArgs.push_back("/c"); // Compile only.
7699 CmdArgs.push_back("/W0"); // No warnings.
7705 Args.AddAllArgs(CmdArgs, options::OPT_D, options::OPT_U);
7706 Args.AddAllArgs(CmdArgs, options::OPT_I);
7711 CmdArgs.push_back("/Od");
7715 A->render(Args, CmdArgs);
7717 CmdArgs.push_back("/Ox");
7726 CmdArgs.push_back("/GR-");
7729 CmdArgs.push_back(A->getOption().getID() == options::OPT_ffunction_sections
7734 CmdArgs.push_back(
7737 CmdArgs.push_back("/Zs");
7739 CmdArgs.push_back("/Z7");
7743 CmdArgs.push_back(Args.MakeArgString(std::string("/FI") + Include));
7746 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_LD);
7747 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_LDd);
7748 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_EH);
7753 A->render(Args, CmdArgs);
7760 CmdArgs.push_back(II.getType() == types::TY_C ? "/Tc" : "/Tp");
7762 CmdArgs.push_back(II.getFilename());
7764 II.getInputArg().renderAsInput(Args, CmdArgs);
7770 CmdArgs.push_back(Fo);
7774 return new Command(JA, *this, Args.MakeArgString(Exec), CmdArgs);
7786 ArgStringList CmdArgs;
7788 CmdArgs.push_back("-o");
7789 CmdArgs.push_back(Output.getFilename());
7791 CmdArgs.push_back("-c");
7794 CmdArgs.push_back("-v");
7798 CmdArgs.push_back("-g");
7802 CmdArgs.push_back("-fverbose-asm");
7804 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
7808 CmdArgs.push_back(II.getFilename());
7811 C.addCommand(new Command(JA, *this, Exec, CmdArgs));
7819 ArgStringList CmdArgs;
7822 CmdArgs.push_back("-o");
7823 CmdArgs.push_back(Output.getFilename());
7829 CmdArgs.push_back("-v");
7833 CmdArgs.push_back("-fexceptions");
7835 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
7838 C.addCommand(new Command(JA, *this, Exec, CmdArgs));