Home | History | Annotate | Download | only in Driver

Lines Matching defs:CmdArgs

155 static void addDirectoryList(const ArgList &Args, ArgStringList &CmdArgs,
175 CmdArgs.push_back(Args.MakeArgString(std::string(ArgName) + "."));
177 CmdArgs.push_back(ArgName);
178 CmdArgs.push_back(".");
182 CmdArgs.push_back(
185 CmdArgs.push_back(ArgName);
186 CmdArgs.push_back(Args.MakeArgString(Dirs.substr(0, Delim)));
194 CmdArgs.push_back(Args.MakeArgString(std::string(ArgName) + "."));
196 CmdArgs.push_back(ArgName);
197 CmdArgs.push_back(".");
201 CmdArgs.push_back(Args.MakeArgString(std::string(ArgName) + Dirs));
203 CmdArgs.push_back(ArgName);
204 CmdArgs.push_back(Args.MakeArgString(Dirs));
210 const ArgList &Args, ArgStringList &CmdArgs) {
215 Args.AddAllArgValues(CmdArgs, options::OPT_Zlinker_input);
224 CmdArgs.push_back(II.getFilename());
233 TC.AddCXXStdlibLibArgs(Args, CmdArgs);
235 TC.AddCCKextLibArgs(Args, CmdArgs);
239 A.render(Args, CmdArgs);
241 A.renderAsInput(Args, CmdArgs);
248 addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH");
275 ArgStringList &CmdArgs,
283 Args.AddLastArg(CmdArgs, options::OPT_C);
284 Args.AddLastArg(CmdArgs, options::OPT_CC);
304 CmdArgs.push_back("-dependency-file");
305 CmdArgs.push_back(DepFile);
325 CmdArgs.push_back("-MT");
328 CmdArgs.push_back(Args.MakeArgString(Quoted));
333 CmdArgs.push_back("-sys-header-deps");
337 CmdArgs.push_back("-module-file-deps");
344 CmdArgs.push_back("-MG");
347 Args.AddLastArg(CmdArgs, options::OPT_MP);
348 Args.AddLastArg(CmdArgs, options::OPT_MV);
355 CmdArgs.push_back("-MT");
358 CmdArgs.push_back(Args.MakeArgString(Quoted));
362 A->render(Args, CmdArgs);
410 CmdArgs.push_back("-include-pch");
412 CmdArgs.push_back("-include-pth");
413 CmdArgs.push_back(Args.MakeArgString(P));
425 A->render(Args, CmdArgs);
428 Args.AddAllArgs(CmdArgs,
438 Args.AddAllArgValues(CmdArgs, options::OPT_Wp_COMMA,
450 CmdArgs.push_back("-isysroot");
451 CmdArgs.push_back(C.getArgs().MakeArgString(sysroot));
460 addDirectoryList(Args, CmdArgs, "-I", "CPATH");
462 addDirectoryList(Args, CmdArgs, "-c-isystem", "C_INCLUDE_PATH");
464 addDirectoryList(Args, CmdArgs, "-cxx-isystem", "CPLUS_INCLUDE_PATH");
466 addDirectoryList(Args, CmdArgs, "-objc-isystem", "OBJC_INCLUDE_PATH");
468 CmdArgs, "-objcxx-isystem", "OBJCPLUS_INCLUDE_PATH");
477 getToolChain().AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
479 AuxToolChain->AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
483 getToolChain().AddClangSystemIncludeArgs(Args, CmdArgs);
485 AuxToolChain->AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
489 getToolChain().AddCudaIncludeArgs(Args, CmdArgs);
929 ArgStringList &CmdArgs, bool KernelOrKext) const {
967 CmdArgs.push_back("-target-abi");
968 CmdArgs.push_back(ABIName);
975 CmdArgs.push_back("-msoft-float");
976 CmdArgs.push_back("-mfloat-abi");
977 CmdArgs.push_back("soft");
980 CmdArgs.push_back("-mfloat-abi");
981 CmdArgs.push_back("soft");
985 CmdArgs.push_back("-mfloat-abi");
986 CmdArgs.push_back("hard");
992 CmdArgs.push_back("-backend-option");
994 CmdArgs.push_back("-arm-global-merge=false");
996 CmdArgs.push_back("-arm-global-merge=true");
1001 CmdArgs.push_back("-no-implicit-float");
1033 ArgStringList &CmdArgs) const {
1040 CmdArgs.push_back("-disable-red-zone");
1044 CmdArgs.push_back("-no-implicit-float");
1054 CmdArgs.push_back("-target-abi");
1055 CmdArgs.push_back(ABIName);
1059 CmdArgs.push_back("-backend-option");
1061 CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1");
1063 CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=0");
1066 CmdArgs.push_back("-backend-option");
1067 CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1");
1073 CmdArgs.push_back("-backend-option");
1075 CmdArgs.push_back("-aarch64-global-merge=false");
1077 CmdArgs.push_back("-aarch64-global-merge=true");
1292 ArgStringList &CmdArgs) const {
1299 CmdArgs.push_back("-target-abi");
1300 CmdArgs.push_back(ABIName.data());
1305 CmdArgs.push_back("-msoft-float");
1306 CmdArgs.push_back("-mfloat-abi");
1307 CmdArgs.push_back("soft");
1311 CmdArgs.push_back("-mfloat-abi");
1312 CmdArgs.push_back("hard");
1317 CmdArgs.push_back("-mllvm");
1318 CmdArgs.push_back("-mxgot");
1325 CmdArgs.push_back("-mllvm");
1326 CmdArgs.push_back("-mno-ldc1-sdc1");
1333 CmdArgs.push_back("-mllvm");
1334 CmdArgs.push_back("-mno-check-zero-division");
1340 CmdArgs.push_back("-mllvm");
1341 CmdArgs.push_back(Args.MakeArgString("-mips-ssection-threshold=" + v));
1473 ArgStringList &CmdArgs) const {
1513 CmdArgs.push_back("-msoft-float");
1514 CmdArgs.push_back("-mfloat-abi");
1515 CmdArgs.push_back("soft");
1519 CmdArgs.push_back("-mfloat-abi");
1520 CmdArgs.push_back("hard");
1524 CmdArgs.push_back("-target-abi");
1525 CmdArgs.push_back(ABIName);
1552 ArgStringList &CmdArgs) const {
1782 ArgStringList &CmdArgs, bool IsThinLTO) {
1786 CmdArgs.push_back("-plugin");
1789 CmdArgs.push_back(Args.MakeArgString(Plugin));
1797 CmdArgs.push_back(Args.MakeArgString(Twine("-plugin-opt=mcpu=") + CPU));
1809 CmdArgs.push_back(Args.MakeArgString(Twine("-plugin-opt=O") + OOpt));
1813 CmdArgs.push_back("-plugin-opt=thinlto");
2025 ArgStringList &CmdArgs) const {
2029 CmdArgs.push_back("-disable-red-zone");
2043 CmdArgs.push_back("-no-implicit-float");
2048 CmdArgs.push_back("-mllvm");
2049 CmdArgs.push_back(Args.MakeArgString("-x86-asm-syntax=" + Value));
2058 ArgStringList &CmdArgs) const {
2059 CmdArgs.push_back("-mqdsp6-compat");
2060 CmdArgs.push_back("-Wreturn-type");
2065 CmdArgs.push_back("-mllvm");
2066 CmdArgs.push_back(Args.MakeArgString(Opt));
2070 CmdArgs.push_back("-fshort-enums");
2072 CmdArgs.push_back("-mllvm");
2073 CmdArgs.push_back("-enable-hexagon-ieee-rnd-near");
2075 CmdArgs.push_back("-mllvm");
2076 CmdArgs.push_back("-machine-sink-split=0");
2288 const ArgList &Args, ArgStringList &CmdArgs,
2351 CmdArgs.push_back("-target-feature");
2352 CmdArgs.push_back(Name);
2380 ArgStringList &CmdArgs) {
2405 CmdArgs.push_back("-fobjc-exceptions");
2440 CmdArgs.push_back("-fcxx-exceptions");
2447 CmdArgs.push_back("-fexceptions");
2528 static void RenderDebugEnablingArgs(const ArgList &Args, ArgStringList &CmdArgs,
2534 CmdArgs.push_back("-debug-info-kind=line-tables-only");
2537 CmdArgs.push_back("-debug-info-kind=limited");
2540 CmdArgs.push_back("-debug-info-kind=standalone");
2546 CmdArgs.push_back(
2550 CmdArgs.push_back("-debugger-tuning=gdb");
2553 CmdArgs.push_back("-debugger-tuning=lldb");
2556 CmdArgs.push_back("-debugger-tuning=sce");
2565 ArgStringList &CmdArgs,
2568 CmdArgs.push_back("-mrelax-all");
2577 CmdArgs.push_back("-mincremental-linker-compatible");
2595 CmdArgs.push_back(Value.data());
2608 CmdArgs.push_back("-target-feature");
2609 CmdArgs.push_back("+use-tcc-in-div");
2613 CmdArgs.push_back("-target-feature");
2614 CmdArgs.push_back("-use-tcc-in-div");
2618 CmdArgs.push_back("-target-feature");
2619 CmdArgs.push_back("+soft-float");
2623 CmdArgs.push_back("-target-feature");
2624 CmdArgs.push_back("-soft-float");
2633 CmdArgs.push_back("-msave-temp-labels");
2635 CmdArgs.push_back("-massembler-fatal-warnings");
2637 CmdArgs.push_back("-mnoexecstack");
2645 CmdArgs.push_back(Value.data());
2654 CmdArgs.push_back(Value.data());
2657 Args, CmdArgs, CodeGenOptions::LimitedDebugInfo, DwarfVersion,
2671 CmdArgs.push_back("-compress-debug-sections");
2681 ArgStringList &CmdArgs) {
2682 CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins"));
2734 static void addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC,
2742 CmdArgs.push_back("-lomp");
2745 CmdArgs.push_back("-lgomp");
2748 CmdArgs.push_back("-liomp5");
2757 ArgStringList &CmdArgs, StringRef Sanitizer,
2761 if (!IsShared) CmdArgs.push_back("-whole-archive");
2762 CmdArgs.push_back(TC.getCompilerRTArgString(Args, Sanitizer, IsShared));
2763 if (!IsShared) CmdArgs.push_back("-no-whole-archive");
2769 ArgStringList &CmdArgs,
2773 CmdArgs.push_back(Args.MakeArgString("--dynamic-list=" + SanRT + ".syms"));
2780 ArgStringList &CmdArgs) {
2783 CmdArgs.push_back("--no-as-needed");
2784 CmdArgs.push_back("-lpthread");
2785 CmdArgs.push_back("-lrt");
2786 CmdArgs.push_back("-lm");
2789 CmdArgs.push_back("-ldl");
2847 ArgStringList &CmdArgs) {
2853 addSanitizerRuntime(TC, Args, CmdArgs, RT, true);
2855 addSanitizerRuntime(TC, Args, CmdArgs, RT, false);
2858 addSanitizerRuntime(TC, Args, CmdArgs, RT, false);
2859 AddExportDynamic |= !addSanitizerDynamicList(TC, Args, CmdArgs, RT);
2864 CmdArgs.push_back("-export-dynamic");
2949 static void addDebugCompDirArg(const ArgList &Args, ArgStringList &CmdArgs) {
2952 CmdArgs.push_back("-fdebug-compilation-dir");
2953 CmdArgs.push_back(Args.MakeArgString(cwd));
3030 /// Add -x lang to \p CmdArgs for \p Input.
3032 ArgStringList &CmdArgs) {
3038 CmdArgs.push_back("-x");
3040 CmdArgs.push_back(types::getTypeName(types::TY_PP_ObjCXX));
3042 CmdArgs.push_back(types::getTypeName(Input.getType()));
3150 ArgStringList &CmdArgs) {
3176 ProfileGenerateArg->render(Args, CmdArgs);
3181 CmdArgs.push_back(
3184 Args.AddAllArgs(CmdArgs, options::OPT_fprofile_instr_generate);
3189 ProfileUseArg->render(Args, CmdArgs);
3198 CmdArgs.push_back(
3205 CmdArgs.push_back("-femit-coverage-notes");
3209 CmdArgs.push_back("-femit-coverage-data");
3220 CmdArgs.push_back("-fcoverage-mapping");
3225 CmdArgs.push_back("-coverage-file");
3239 CmdArgs.push_back(Args.MakeArgString(CoverageFilename));
3245 ArgStringList &CmdArgs) {
3258 CmdArgs.push_back("--dependent-lib=libclang_rt.profile-x86_64.a");
3413 ArgStringList &CmdArgs) {
3421 CmdArgs.push_back("-KPIC");
3433 ArgStringList CmdArgs;
3453 CmdArgs.push_back("-cc1");
3456 CmdArgs.push_back("-triple");
3457 CmdArgs.push_back(Args.MakeArgString(TripleStr));
3472 CmdArgs.push_back("-aux-triple");
3473 CmdArgs.push_back(Args.MakeArgString(AuxToolChain->getTriple().str()));
3474 CmdArgs.push_back("-fcuda-target-overloads");
3475 CmdArgs.push_back("-fcuda-disable-target-call-checks");
3491 getToolChain().addClangWarningOptions(CmdArgs);
3498 CmdArgs.push_back("-analyze");
3500 CmdArgs.push_back("-migrate");
3503 CmdArgs.push_back("-Eonly");
3505 CmdArgs.push_back("-E");
3508 CmdArgs.push_back("-P");
3511 CmdArgs.push_back("-emit-obj");
3513 CollectArgsForIntegratedAssembler(C, Args, CmdArgs, D);
3522 CmdArgs.push_back("-fsyntax-only");
3524 CmdArgs.push_back("-emit-pch");
3526 CmdArgs.push_back("-emit-pth");
3528 CmdArgs.push_back("-verify-pch");
3533 CmdArgs.push_back("-fsyntax-only");
3536 CmdArgs.push_back("-emit-llvm");
3539 CmdArgs.push_back("-emit-llvm-bc");
3541 CmdArgs.push_back("-S");
3543 CmdArgs.push_back("-emit-pch");
3545 CmdArgs.push_back("-module-file-info");
3547 CmdArgs.push_back("-rewrite-objc");
3550 CmdArgs.push_back("-rewrite-objc");
3561 CmdArgs.push_back("-emit-llvm-uselists");
3564 Args.AddLastArg(CmdArgs, options::OPT_flto, options::OPT_flto_EQ);
3571 Args.AddLastArg(CmdArgs, options::OPT_fthinlto_index_EQ);
3578 CmdArgs.push_back("-disable-free");
3582 CmdArgs.push_back("-disable-llvm-verifier");
3587 CmdArgs.push_back("-main-file-name");
3588 CmdArgs.push_back(getBaseInputName(Args, Input));
3593 CmdArgs.push_back("-static-define");
3597 CmdArgs.push_back("-analyzer-store=region");
3600 CmdArgs.push_back("-analyzer-opt-analyze-nested-blocks");
3602 CmdArgs.push_back("-analyzer-eagerly-assume");
3606 CmdArgs.push_back("-analyzer-checker=core");
3609 CmdArgs.push_back("-analyzer-checker=unix");
3612 CmdArgs.push_back("-analyzer-checker=osx");
3614 CmdArgs.push_back("-analyzer-checker=deadcode");
3617 CmdArgs.push_back("-analyzer-checker=cplusplus");
3620 CmdArgs.push_back(
3622 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.getpw");
3623 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.gets");
3624 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mktemp");
3625 CmdArgs
3626 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.vfork");
3629 CmdArgs.push_back("-analyzer-checker=nullability.NullPassedToNonnull");
3630 CmdArgs.push_back(
3636 CmdArgs.push_back("-analyzer-output");
3638 CmdArgs.push_back(A->getValue());
3640 CmdArgs.push_back("plist");
3645 CmdArgs.push_back("-w");
3648 Args.AddAllArgValues(CmdArgs, options::OPT_Xanalyzer);
3661 CmdArgs.push_back("-mrelocation-model");
3662 CmdArgs.push_back(RMName);
3665 CmdArgs.push_back("-pic-level");
3666 CmdArgs.push_back(PICLevel == 1 ? "1" : "2");
3668 CmdArgs.push_back("-pie-level");
3669 CmdArgs.push_back(PICLevel == 1 ? "1" : "2");
3674 CmdArgs.push_back("-meabi");
3675 CmdArgs.push_back(A->getValue());
3678 CmdArgs.push_back("-mthread-model");
3680 CmdArgs.push_back(A->getValue());
3682 CmdArgs.push_back(Args.MakeArgString(getToolChain().getThreadModel()));
3684 Args.AddLastArg(CmdArgs, options::OPT_fveclib);
3688 CmdArgs.push_back("-fno-merge-all-constants");
3696 CmdArgs.push_back("-frewrite-map-file");
3697 CmdArgs.push_back(A->getValue());
3704 CmdArgs.push_back("-mllvm");
3705 CmdArgs.push_back(Args.MakeArgString("-warn-stack-size=" + v));
3710 CmdArgs.push_back("-mregparm");
3711 CmdArgs.push_back(A->getValue());
3720 CmdArgs.push_back("-fpcc-struct-return");
3723 CmdArgs.push_back("-freg-struct-return");
3728 CmdArgs.push_back("-mrtd");
3731 CmdArgs.push_back("-mdisable-fp-elim");
3734 CmdArgs.push_back("-mno-zero-initialized-in-bss");
3746 CmdArgs.push_back("-relaxed-aliasing");
3749 CmdArgs.push_back("-no-struct-path-tbaa");
3752 CmdArgs.push_back("-fstrict-enums");
3756 CmdArgs.push_back("-fstrict-vtable-pointers");
3759 CmdArgs.push_back("-mdisable-tail-calls");
3763 CmdArgs.push_back("-split-stacks");
3783 CmdArgs.push_back("-menable-no-infs");
3792 CmdArgs.push_back("-menable-no-nans");
3811 CmdArgs.push_back("-fmath-errno");
3859 CmdArgs.push_back("-menable-unsafe-fp-math");
3862 CmdArgs.push_back("-fno-signed-zeros");
3865 CmdArgs.push_back("-freciprocal-math");
3874 CmdArgs.push_back(Args.MakeArgString("-ffp-contract=" + Val));
3882 CmdArgs.push_back(Args.MakeArgString("-ffp-contract=fast"));
3886 ParseMRecip(getToolChain().getDriver(), Args, CmdArgs);
3896 CmdArgs.push_back("-ffast-math");
3900 CmdArgs.push_back("-ffinite-math-only");
3909 CmdArgs.push_back("-masm-verbose");
3913 CmdArgs.push_back("-no-integrated-as");
3916 CmdArgs.push_back("-mdebug-pass");
3917 CmdArgs.push_back("Structure");
3920 CmdArgs.push_back("-mdebug-pass");
3921 CmdArgs.push_back("Arguments");
3927 CmdArgs.push_back("-mconstructor-aliases");
3932 CmdArgs.push_back("-fforbid-guard-variables");
3936 CmdArgs.push_back("-mms-bitfields");
3950 CmdArgs.push_back("-munwind-tables");
3952 getToolChain().addClangTargetOptions(Args, CmdArgs);
3955 CmdArgs.push_back("-mlimit-float-precision");
3956 CmdArgs.push_back(A->getValue());
3963 CmdArgs.push_back("-mcode-model");
3964 CmdArgs.push_back(A->getValue());
3970 CmdArgs.push_back("-target-cpu");
3971 CmdArgs.push_back(Args.MakeArgString(CPU));
3975 CmdArgs.push_back("-mfpmath");
3976 CmdArgs.push_back(A->getValue());
3980 getTargetFeatures(getToolChain(), Triple, Args, CmdArgs, false);
3992 AddARMTargetArgs(Triple, Args, CmdArgs, KernelOrKext);
3997 AddAArch64TargetArgs(Args, CmdArgs);
4004 AddMIPSTargetArgs(Args, CmdArgs);
4010 AddPPCTargetArgs(Args, CmdArgs);
4016 AddSparcTargetArgs(Args, CmdArgs);
4021 CmdArgs);
4025 AddHexagonTargetArgs(Args, CmdArgs);
4047 AddClangCLArgs(Args, CmdArgs, &DebugInfoKind, &EmitCodeView);
4051 CmdArgs.push_back("-target-linker-version");
4052 CmdArgs.push_back(A->getValue());
4056 CmdArgs.push_back("-momit-leaf-frame-pointer");
4072 Args.AddAllArgs(CmdArgs, options::OPT_v);
4073 Args.AddLastArg(CmdArgs, options::OPT_H);
4075 CmdArgs.push_back("-header-include-file");
4076 CmdArgs.push_back(D.CCPrintHeadersFilename ? D.CCPrintHeadersFilename
4079 Args.AddLastArg(CmdArgs, options::OPT_P);
4080 Args.AddLastArg(CmdArgs, options::OPT_print_ivar_layout);
4083 CmdArgs.push_back("-diagnostic-log-file");
4084 CmdArgs.push_back(D.CCLogDiagnosticsFilename ? D.CCLogDiagnosticsFilename
4125 CmdArgs.push_back("-gcodeview");
4137 CmdArgs.push_back("-dwarf-column-info");
4142 CmdArgs.push_back("-dwarf-ext-refs");
4143 CmdArgs.push_back("-fmodule-format=obj");
4151 CmdArgs.push_back("-backend-option");
4152 CmdArgs.push_back("-split-dwarf=Enable");
4165 RenderDebugEnablingArgs(Args, CmdArgs, DebugInfoKind, DwarfVersion,
4170 CmdArgs.push_back("-backend-option");
4171 CmdArgs.push_back("-generate-gnu-dwarf-pub-sections");
4178 CmdArgs.push_back("-backend-option");
4179 CmdArgs.push_back("-generate-arange-section");
4184 CmdArgs.push_back("-backend-option");
4185 CmdArgs.push_back("-generate-type-units");
4193 CmdArgs.push_back("-ffunction-sections");
4198 CmdArgs.push_back("-fdata-sections");
4203 CmdArgs.push_back("-fno-unique-section-names");
4205 Args.AddAllArgs(CmdArgs, options::OPT_finstrument_functions);
4207 addPGOAndCoverageFlags(C, D, Output, Args, CmdArgs);
4211 addPS4ProfileRTArgs(getToolChain(), Args, CmdArgs);
4215 CmdArgs.push_back("-nostdsysteminc");
4216 CmdArgs.push_back("-nobuiltininc");
4219 CmdArgs.push_back("-nostdsysteminc");
4220 Args.AddLastArg(CmdArgs, options::OPT_nostdincxx);
4221 Args.AddLastArg(CmdArgs, options::OPT_nobuiltininc);
4225 CmdArgs.push_back("-resource-dir");
4226 CmdArgs.push_back(D.ResourceDir.c_str());
4228 Args.AddLastArg(CmdArgs, options::OPT_working_directory);
4240 CmdArgs.push_back("-arcmt-check");
4243 CmdArgs.push_back("-arcmt-modify");
4246 CmdArgs.push_back("-arcmt-migrate");
4247 CmdArgs.push_back("-mt-migrate-directory");
4248 CmdArgs.push_back(A->getValue());
4250 Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_report_output);
4251 Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_emit_arc_errors);
4266 CmdArgs.push_back("-mt-migrate-directory");
4267 CmdArgs.push_back(A->getValue());
4273 CmdArgs.push_back("-objcmt-migrate-literals");
4274 CmdArgs.push_back("-objcmt-migrate-subscripting");
4275 CmdArgs.push_back("-objcmt-migrate-property");
4277 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_literals);
4278 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_subscripting);
4279 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property);
4282 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_literals);
4283 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_subscripting);
4284 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property);
4285 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_all);
4286 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readonly_property);
4287 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readwrite_property);
4288 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property_dot_syntax);
4289 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_annotation);
4290 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_instancetype);
4291 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_nsmacros);
4292 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_protocol_conformance);
4293 Args.AddLastArg(CmdArgs, options::OPT_objcmt_atomic_property);
4294 Args.AddLastArg(CmdArgs, options::OPT_objcmt_returns_innerpointer_property);
4295 Args.AddLastArg(CmdArgs, options::OPT_objcmt_ns_nonatomic_iosonly);
4296 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_designated_init);
4297 Args.AddLastArg(CmdArgs, options::OPT_objcmt_whitelist_dir_path);
4305 AddPreprocessingOptions(C, JA, D, Args, CmdArgs, Output, Inputs,
4317 CmdArgs.push_back("-O3");
4320 A->render(Args, CmdArgs);
4333 Args.AddAllArgs(CmdArgs, options::OPT_R_Group);
4334 Args.AddAllArgs(CmdArgs, options::OPT_W_Group);
4336 CmdArgs.push_back("-pedantic");
4337 Args.AddLastArg(CmdArgs, options::OPT_pedantic_errors);
4338 Args.AddLastArg(CmdArgs, options::OPT_w);
4349 CmdArgs.push_back("-std=c++98");
4351 CmdArgs.push_back("-std=c89");
4353 Std->render(Args, CmdArgs);
4360 A->render(Args, CmdArgs);
4369 Args.AddAllArgsTranslated(CmdArgs, options::OPT_std_default_EQ, "-std=",
4374 Args.AddLastArg(CmdArgs, options::OPT_ftrigraphs,
4395 CmdArgs.push_back("-fconst-strings");
4404 CmdArgs.push_back("-fdeprecated-macro");
4410 CmdArgs.push_back("-fgnu-keywords");
4412 CmdArgs.push_back("-fno-gnu-keywords");
4416 CmdArgs.push_back("-fno-dwarf-directory-asm");
4419 CmdArgs.push_back("-fno-autolink");
4422 addDebugCompDirArg(Args, CmdArgs);
4429 CmdArgs.push_back(Args.MakeArgString("-fdebug-prefix-map=" + Map));
4435 CmdArgs.push_back("-ftemplate-depth");
4436 CmdArgs.push_back(A->getValue());
4440 CmdArgs.push_back("-foperator-arrow-depth");
4441 CmdArgs.push_back(A->getValue());
4445 CmdArgs.push_back("-fconstexpr-depth");
4446 CmdArgs.push_back(A->getValue());
4450 CmdArgs.push_back("-fconstexpr-steps");
4451 CmdArgs.push_back(A->getValue());
4455 CmdArgs.push_back("-fbracket-depth");
4456 CmdArgs.push_back(A->getValue());
4463 CmdArgs.push_back(Args.MakeArgString("-Wlarge-by-value-copy=" + bytes));
4465 CmdArgs.push_back("-Wlarge-by-value-copy=64"); // default value
4469 CmdArgs.push_back("-relocatable-pch");
4472 CmdArgs.push_back("-fconstant-string-class");
4473 CmdArgs.push_back(A->getValue());
4477 CmdArgs.push_back("-ftabstop");
4478 CmdArgs.push_back(A->getValue());
4481 CmdArgs.push_back("-ferror-limit");
4483 CmdArgs.push_back(A->getValue());
4485 CmdArgs.push_back("19");
4488 CmdArgs.push_back("-fmacro-backtrace-limit");
4489 CmdArgs.push_back(A->getValue());
4493 CmdArgs.push_back("-ftemplate-backtrace-limit");
4494 CmdArgs.push_back(A->getValue());
4498 CmdArgs.push_back("-fconstexpr-backtrace-limit");
4499 CmdArgs.push_back(A->getValue());
4503 CmdArgs.push_back("-fspell-checking-limit");
4504 CmdArgs.push_back(A->getValue());
4508 CmdArgs.push_back("-fmessage-length");
4510 CmdArgs.push_back(A->getValue());
4515 CmdArgs.push_back(Args.MakeArgString(Twine(N)));
4522 CmdArgs.push_back("-fvisibility");
4523 CmdArgs.push_back(A->getValue());
4526 CmdArgs.push_back("-fvisibility");
4527 CmdArgs.push_back("hidden");
4528 CmdArgs.push_back("-ftype-visibility");
4529 CmdArgs.push_back("default");
4533 Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden);
4535 Args.AddLastArg(CmdArgs, options::OPT_ftlsmodel_EQ);
4540 CmdArgs.push_back("-ffreestanding");
4543 Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls);
4544 Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions);
4545 Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);
4551 CmdArgs.push_back("-femulated-tls");
4554 Args.AddLastArg(CmdArgs, options::OPT_faltivec);
4555 Args.AddLastArg(CmdArgs, options::OPT_fzvector);
4557 Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_show_template_tree);
4558 Args.AddLastArg(CmdArgs, options::OPT_fno_elide_type);
4567 CmdArgs.push_back("-fopenmp");
4574 CmdArgs.push_back("-fnoopenmp-use-tls");
4587 Sanitize.addArgs(getToolChain(), Args, CmdArgs, InputType);
4605 Args.AddLastArg(CmdArgs, options::OPT_pg);
4610 CmdArgs.push_back("-fno-lax-vector-conversions");
4614 CmdArgs.push_back("-fapple-kext");
4616 Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch);
4617 Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info);
4618 Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_parseable_fixits);
4619 Args.AddLastArg(CmdArgs, options::OPT_ftime_report);
4620 Args.AddLastArg(CmdArgs, options::OPT_ftrapv);
4623 CmdArgs.push_back("-ftrapv-handler");
4624 CmdArgs.push_back(A->getValue());
4627 Args.AddLastArg(CmdArgs, options::OPT_ftrap_function_EQ);
4633 CmdArgs.push_back("-fwrapv");
4637 CmdArgs.push_back("-fwrapv");
4643 CmdArgs.push_back("-freroll-loops");
4645 Args.AddLastArg(CmdArgs, options::OPT_fwritable_strings);
4646 Args.AddLastArg(CmdArgs, options::OPT_funroll_loops,
4649 Args.AddLastArg(CmdArgs, options::OPT_pthread);
4675 CmdArgs.push_back("-stack-protector");
4676 CmdArgs.push_back(Args.MakeArgString(Twine(StackProtectorLevel)));
4684 CmdArgs.push_back("-stack-protector-buffer-size");
4686 CmdArgs.push_back(Args.MakeArgString(Str.drop_front(16)));
4695 CmdArgs.push_back(Args.MakeArgString("-mstackrealign"));
4699 CmdArgs.push_back(Args.MakeArgString("-mstack-alignment=" + alignment));
4706 CmdArgs.push_back(Args.MakeArgString("-mstack-probe-size=" + Size));
4708 CmdArgs.push_back("-mstack-probe-size=0");
4718 CmdArgs.push_back("-fallow-half-arguments-and-returns");
4728 CmdArgs.push_back("-backend-option");
4729 CmdArgs.push_back("-arm-restrict-it");
4731 CmdArgs.push_back("-backend-option");
4732 CmdArgs.push_back("-arm-no-restrict-it");
4738 CmdArgs.push_back("-backend-option");
4739 CmdArgs.push_back("-arm-restrict-it");
4749 A->render(Args, CmdArgs);
4755 CmdArgs.push_back("-fno-builtin");
4759 CmdArgs.push_back("-fno-assume-sane-operator-new");
4767 CmdArgs.push_back("-fblocks");
4771 CmdArgs.push_back("-fblocks-runtime-optional");
4782 CmdArgs.push_back("-fmodules");
4791 CmdArgs.push_back("-fimplicit-module-maps");
4798 CmdArgs.push_back("-fmodules-decluse");
4805 CmdArgs.push_back("-fmodules-strict-decluse");
4811 CmdArgs.push_back("-fno-implicit-modules");
4816 Args.AddLastArg(CmdArgs, options::OPT_fmodule_name);
4820 Args.AddAllArgs(CmdArgs, options::OPT_fmodule_map_file);
4824 Args.AddAllArgs(CmdArgs, options::OPT_fmodule_file);
4849 CmdArgs.push_back(Args.MakeArgString(Path));
4861 CmdArgs.push_back("-module-dependency-dir");
4862 CmdArgs.push_back(Args.MakeArgString(VFSDir));
4866 Args.AddLastArg(CmdArgs, options::OPT_fmodules_user_build_path);
4869 Args.AddAllArgs(CmdArgs, options::OPT_fmodules_ignore_macro);
4870 Args.AddLastArg(CmdArgs, options::OPT_fmodules_prune_interval);
4871 Args.AddLastArg(CmdArgs, options::OPT_fmodules_prune_after);
4873 Args.AddLastArg(CmdArgs, options::OPT_fbuild_session_timestamp);
4883 CmdArgs.push_back(Args.MakeArgString(
4893 Args.AddLastArg(CmdArgs,
4897 Args.AddLastArg(CmdArgs, options::OPT_fmodules_validate_system_headers);
4902 CmdArgs.push_back("-fno-access-control");
4907 CmdArgs.push_back("-fno-elide-constructors");
4914 CmdArgs.push_back("-fno-rtti");
4919 CmdArgs.push_back("-fshort-enums");
4927 CmdArgs.push_back("-fno-signed-char");
4930 CmdArgs.push_back("-fno-signed-char");
4944 CmdArgs.push_back("-fno-use-cxa-atexit");
4949 CmdArgs.push_back("-fms-extensions");
4954 CmdArgs.push_back("-fuse-line-directives");
4962 CmdArgs.push_back("-fms-compatibility");
4968 CmdArgs.push_back(
4974 CmdArgs.push_back("-std=c++14");
4976 CmdArgs.push_back("-std=c++11");
4982 CmdArgs.push_back("-fborland-extensions");
4987 CmdArgs.push_back("-fdeclspec");
4989 CmdArgs.push_back("-fno-declspec"); // Explicitly disabling __declspec.
4996 CmdArgs.push_back("-fno-threadsafe-statics");
5002 CmdArgs.push_back("-fdelayed-template-parsing");
5008 A->render(Args, CmdArgs);
5012 CmdArgs.push_back("-fgnu89-inline");
5015 CmdArgs.push_back("-fno-inline");
5018 CmdArgs.push_back("-fno-inline-functions");
5020 ObjCRuntime objcRuntime = AddObjCRuntimeArgs(Args, CmdArgs, rewriteKind);
5032 CmdArgs.push_back("-fobjc-dispatch-method=mixed");
5034 CmdArgs.push_back("-fobjc-dispatch-method=non-legacy");
5046 CmdArgs.push_back("-fobjc-subscripting-legacy-runtime");
5050 CmdArgs.push_back("-fencode-extended-block-signature");
5059 CmdArgs.push_back("-fobjc-arc");
5066 CmdArgs.push_back("-fobjc-arc-cxxlib=libc++");
5068 CmdArgs.push_back("-fobjc-arc-cxxlib=libstdc++");
5076 CmdArgs.push_back("-fobjc-arc-exceptions");
5083 CmdArgs.push_back("-fno-objc-infer-related-result-type");
5094 GCArg->render(Args, CmdArgs);
5114 WeakArg->render(Args, CmdArgs);
5120 CmdArgs.push_back("-fapplication-extension");
5125 CmdArgs);
5128 CmdArgs.push_back("-fsjlj-exceptions");
5133 CmdArgs.push_back("-fno-assume-sane-operator-new");
5139 CmdArgs.push_back("-fsized-deallocation");
5147 CmdArgs.push_back("-fno-constant-cfstrings");
5153 A->render(Args, CmdArgs);
5158 CmdArgs.push_back("-fpascal-strings");
5165 CmdArgs.push_back(Args.MakeArgString(PackStructStr));
5168 CmdArgs.push_back("-fpack-struct=1");
5177 CmdArgs.push_back(Args.MakeArgString(MaxTypeAlignStr));
5182 CmdArgs.push_back(Args.MakeArgString(MaxTypeAlignStr));
5191 CmdArgs.push_back("-fno-common");
5224 CmdArgs.push_back("-fno-caret-diagnostics");
5229 CmdArgs.push_back("-fno-diagnostics-fixit-info");
5234 CmdArgs.push_back("-fdiagnostics-show-option");
5238 CmdArgs.push_back("-fdiagnostics-show-category");
5239 CmdArgs.push_back(A->getValue());
5243 CmdArgs.push_back("-fdiagnostics-format");
5244 CmdArgs.push_back(A->getValue());
5252 CmdArgs.push_back("-fdiagnostics-show-note-include-stack");
5254 CmdArgs.push_back("-fno-diagnostics-show-note-include-stack");
5294 CmdArgs.push_back("-fcolor-diagnostics");
5297 CmdArgs.push_back("-fansi-escape-codes");
5301 CmdArgs.push_back("-fno-show-source-location");
5305 CmdArgs.push_back("-fno-show-column");
5309 CmdArgs.push_back("-fno-spell-checking");
5314 CmdArgs.push_back("-fasm-blocks");
5319 CmdArgs.push_back("-fno-gnu-inline-asm");
5329 CmdArgs.push_back("-vectorize-loops");
5337 CmdArgs.push_back("-vectorize-slp");
5342 CmdArgs.push_back("-vectorize-slp-aggressive");
5345 A->render(Args, CmdArgs);
5352 CmdArgs.push_back("-fdollars-in-identifiers");
5354 CmdArgs.push_back("-fno-dollars-in-identifiers");
5367 CmdArgs.push_back("-fapple-pragma-pack");
5373 CmdArgs.push_back("-fno-math-builtin");
5384 CmdArgs.push_back("-fno-builtin-strcat");
5386 CmdArgs.push_back("-fno-builtin-strcpy");
5397 CmdArgs.push_back("-frewrite-includes");
5403 CmdArgs.push_back("-traditional-cpp");
5408 Args.AddLastArg(CmdArgs, options::OPT_dM);
5409 Args.AddLastArg(CmdArgs, options::OPT_dD);
5413 CmdArgs.push_back("-serialize-diagnostic-file");
5414 CmdArgs.push_back(Args.MakeArgString(A->getValue()));
5418 CmdArgs.push_back("-fretain-comments-from-system-headers");
5421 Args.AddAllArgs(CmdArgs, options::OPT_fcomment_block_commands);
5423 Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments);
5427 CmdArgs.push_back("-load");
5428 CmdArgs.push_back(A->getValue());
5434 Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
5441 CmdArgs.push_back("-disable-llvm-optzns");
5443 A->render(Args, CmdArgs);
5450 CmdArgs.push_back("-disable-llvm-passes");
5455 CmdArgs.push_back("-o");
5456 CmdArgs.push_back(Output.getFilename());
5461 addDashXForInput(Args, Input, CmdArgs);
5464 CmdArgs.push_back(Input.getFilename());
5466 Input.getInputArg().renderAsInput(Args, CmdArgs);
5468 Args.AddAllArgs(CmdArgs, options::OPT_undef);
5487 CmdArgs.push_back("-dwarf-debug-flags");
5488 CmdArgs.push_back(Args.MakeArgString(Flags));
5498 CmdArgs.push_back("-split-dwarf-file");
5500 CmdArgs.push_back(SplitDwarfOut);
5507 CmdArgs.push_back("-fcuda-include-gpubinary");
5508 CmdArgs.push_back(I->getFilename());
5518 JA, *this, Exec, CmdArgs, Inputs, std::move(CLCommand)));
5520 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
5554 ArgStringList &cmdArgs,
5572 runtimeArg->render(args, cmdArgs);
5669 cmdArgs.push_back(
5725 void Clang::AddClangCLArgs(const ArgList &Args, ArgStringList &CmdArgs,
5742 CmdArgs.push_back("-D_DEBUG");
5743 CmdArgs.push_back("-D_MT");
5744 CmdArgs.push_back("-D_DLL");
5748 CmdArgs.push_back("-D_DEBUG");
5749 CmdArgs.push_back("-D_MT");
5750 CmdArgs.push_back("-D_DLL");
5755 CmdArgs.push_back("-D_DEBUG");
5756 CmdArgs.push_back("-D_MT");
5760 CmdArgs.push_back("-D_DEBUG");
5761 CmdArgs.push_back("-D_MT");
5769 CmdArgs.push_back("-D_VC_NODEFAULTLIB");
5771 CmdArgs.push_back(FlagForCRT.data());
5776 CmdArgs.push_back("--dependent-lib=oldnames");
5783 A->render(Args, CmdArgs);
5788 CmdArgs.push_back("-fno-rtti-data");
5798 CmdArgs.push_back("-gcodeview");
5804 CmdArgs.push_back("-fcxx-exceptions");
5805 CmdArgs.push_back("-fexceptions");
5810 CmdArgs.push_back("-E");
5811 CmdArgs.push_back("-P");
5825 CmdArgs.push_back("-fms-volatile");
5846 CmdArgs.push_back("-fms-memptr-rep=single");
5848 CmdArgs.push_back("-fms-memptr-rep=multiple");
5850 CmdArgs.push_back("-fms-memptr-rep=virtual");
5854 A->render(Args, CmdArgs);
5857 CmdArgs.push_back("-fdiagnostics-format");
5859 CmdArgs.push_back("msvc-fallback");
5861 CmdArgs.push_back("msvc");
5872 ArgStringList &CmdArgs) const {
5878 CmdArgs.push_back("-target-abi");
5879 CmdArgs.push_back(ABIName.data());
5886 ArgStringList CmdArgs;
5905 CmdArgs.push_back("-cc1as");
5908 CmdArgs.push_back("-triple");
5909 CmdArgs.push_back(Args.MakeArgString(TripleStr));
5913 CmdArgs.push_back("-filetype");
5914 CmdArgs.push_back("obj");
5918 CmdArgs.push_back("-main-file-name");
5919 CmdArgs.push_back(Clang::getBaseInputName(Args, Input));
5924 CmdArgs.push_back("-target-cpu");
5925 CmdArgs.push_back(Args.MakeArgString(CPU));
5929 getTargetFeatures(getToolChain(), Triple, Args, CmdArgs, true);
5935 Args.AddAllArgs(CmdArgs, options::OPT_I_Group);
5959 RenderDebugEnablingArgs(Args, CmdArgs,
5965 addDebugCompDirArg(Args, CmdArgs);
5969 CmdArgs.push_back("-dwarf-debug-producer");
5970 CmdArgs.push_back(Args.MakeArgString(getClangFullVersion()));
5973 Args.AddAllArgs(CmdArgs, options::OPT_I);
5986 CmdArgs.push_back("-mrelocation-model");
5987 CmdArgs.push_back(RMName);
6006 CmdArgs.push_back("-dwarf-debug-flags");
6007 CmdArgs.push_back(Args.MakeArgString(Flags));
6021 AddMIPSTargetArgs(Args, CmdArgs);
6033 CollectArgsForIntegratedAssembler(C, Args, CmdArgs,
6036 Args.AddAllArgs(CmdArgs, options::OPT_mllvm);
6039 CmdArgs.push_back("-o");
6040 CmdArgs.push_back(Output.getFilename());
6043 CmdArgs.push_back(Input.getFilename());
6046 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
6064 ArgStringList CmdArgs;
6083 A->render(Args, CmdArgs);
6087 RenderExtraToolArgs(JA, CmdArgs);
6091 CmdArgs.push_back("-arch");
6092 CmdArgs.push_back(
6106 CmdArgs.push_back("-m32");
6111 CmdArgs.push_back("-m64");
6114 CmdArgs.push_back("-EL");
6119 CmdArgs.push_back("-o");
6120 CmdArgs.push_back(Output.getFilename());
6123 CmdArgs.push_back("-fsyntax-only");
6126 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
6148 CmdArgs.push_back("-x");
6149 CmdArgs.push_back(types::getTypeName(II.getType()));
6153 CmdArgs.push_back(II.getFilename());
6159 CmdArgs.push_back("-lstdc++");
6164 A.render(Args, CmdArgs);
6178 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
6182 ArgStringList &CmdArgs) const {
6183 CmdArgs.push_back("-E");
6187 ArgStringList &CmdArgs) const {
6196 CmdArgs.push_back("-c");
6199 CmdArgs.push_back("-S");
6202 CmdArgs.push_back("-fsyntax-only");
6210 ArgStringList &CmdArgs) const {
6216 ArgStringList &CmdArgs) const {
6228 ArgStringList CmdArgs;
6231 CmdArgs.push_back(Args.MakeArgString(MArchString));
6233 RenderExtraToolArgs(JA, CmdArgs);
6238 CmdArgs.push_back("-filetype=obj");
6239 CmdArgs.push_back(Args.MakeArgString(MCpuString));
6242 CmdArgs.push_back("-o");
6243 CmdArgs.push_back(Output.getFilename());
6246 CmdArgs.push_back("-fsyntax-only");
6251 CmdArgs.push_back(Args.MakeArgString(std::string("-gpsize=") + N));
6254 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
6277 CmdArgs.push_back(II.getFilename());
6281 II.getInputArg().render(Args, CmdArgs);
6285 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
6289 ArgStringList &CmdArgs) const {
6296 const ArgList &Args, ArgStringList &CmdArgs,
6326 CmdArgs.push_back("-s");
6329 CmdArgs.push_back("-r");
6332 CmdArgs.push_back(Opt.c_str());
6334 CmdArgs.push_back("-march=hexagon");
6338 CmdArgs.push_back(Args.MakeArgString(MCpuString));
6341 CmdArgs.push_back("-shared");
6343 CmdArgs.push_back("-call_shared");
6347 CmdArgs.push_back("-static");
6350 CmdArgs.push_back("-pie");
6354 CmdArgs.push_back(Args.MakeArgString(std::string("-G") + N));
6361 CmdArgs.push_back("-o");
6362 CmdArgs.push_back(Output.getFilename());
6403 CmdArgs.push_back(Args.MakeArgString(Crt0SA));
6406 CmdArgs.push_back(Args.MakeArgString(Crt0));
6411 CmdArgs.push_back(Args.MakeArgString(Init));
6419 CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
6424 Args.AddAllArgs(CmdArgs,
6428 AddLinkerInputs(HTC, Inputs, Args, CmdArgs);
6435 HTC.AddCXXStdlibLibArgs(Args, CmdArgs);
6436 CmdArgs.push_back("-lm");
6439 CmdArgs.push_back("--start-group");
6443 CmdArgs.push_back(Args.MakeArgString("-l" + Lib));
6444 CmdArgs.push_back("-lc");
6446 CmdArgs.push_back("-lgcc");
6448 CmdArgs.push_back("--end-group");
6458 CmdArgs.push_back(Args.MakeArgString(Fini));
6469 ArgStringList CmdArgs;
6470 constructHexagonLinkArgs(C, JA, HTC, Output, Inputs, Args, CmdArgs,
6475 CmdArgs, Inputs));
6486 ArgStringList CmdArgs;
6487 CmdArgs.push_back("-flavor");
6488 CmdArgs.push_back("old-gnu");
6489 CmdArgs.push_back("-target");
6490 CmdArgs.push_back(Args.MakeArgString(getToolChain().getTripleString()));
6491 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
6492 CmdArgs.push_back("-o");
6493 CmdArgs.push_back(Output.getFilename());
6495 CmdArgs, Inputs));
6516 ArgStringList CmdArgs;
6517 CmdArgs.push_back("-flavor");
6518 CmdArgs.push_back("ld");
6519 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
6520 CmdArgs.push_back("-o");
6521 CmdArgs.push_back(Output.getFilename());
6522 C.addCommand(llvm::make_unique<Command>(JA, *this, Linker, CmdArgs, Inputs));
6606 void arm::appendEBLinkFlags(const ArgList &Args, ArgStringList &CmdArgs,
6614 CmdArgs.push_back("--be8");
6783 ArgStringList CmdArgs;
6794 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
6797 CmdArgs.push_back("-Bstatic");
6798 CmdArgs.push_back("--eh-frame-hdr");
6799 CmdArgs.push_back("--gc-sections");
6802 CmdArgs.push_back("-o");
6803 CmdArgs.push_back(Output.getFilename());
6809 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crt0.o")));
6810 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtbegin.o")));
6813 Args.AddAllArgs(CmdArgs, options::OPT_L);
6814 ToolChain.AddFilePathLibArgs(Args, CmdArgs);
6815 Args.AddAllArgs(CmdArgs,
6820 AddGoldPlugin(ToolChain, Args, CmdArgs, D.getLTOMode() == LTOK_Thin);
6822 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
6826 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
6827 CmdArgs.push_back("-lc");
6828 CmdArgs.push_back("-lcompiler_rt");
6832 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
6835 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
6843 ArgStringList CmdArgs;
6863 CmdArgs.push_back("-Q");
6870 CmdArgs.push_back("--gstabs");
6872 CmdArgs.push_back("-g");
6876 AddMachOArch(Args, CmdArgs);
6882 CmdArgs.push_back("-force_cpusubtype_ALL");
6889 CmdArgs.push_back("-static");
6891 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
6894 CmdArgs.push_back("-o");
6895 CmdArgs.push_back(Output.getFilename());
6898 CmdArgs.push_back(Input.getFilename());
6903 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
6909 ArgStringList &CmdArgs) const {
6913 CmdArgs.push_back("-arch");
6914 CmdArgs.push_back(Args.MakeArgString(ArchName));
6918 CmdArgs.push_back("-force_cpusubtype_ALL");
6933 ArgStringList &CmdArgs,
6950 CmdArgs.push_back("-demangle");
6953 CmdArgs.push_back("-export_dynamic");
6959 CmdArgs.push_back("-application_extension");
6969 CmdArgs.push_back("-object_path_lto");
6970 CmdArgs.push_back(TmpPath);
6983 CmdArgs.push_back("-lto_library");
6984 CmdArgs.push_back(C.getArgs().MakeArgString(LibLTOPath));
6992 Args.AddAllArgs(CmdArgs, options::OPT_static);
6994 CmdArgs.push_back("-dynamic");
7001 AddMachOArch(Args, CmdArgs);
7003 Args.AddLastArg(CmdArgs, options::OPT_force__cpusubtype__ALL);
7005 Args.AddLastArg(CmdArgs, options::OPT_bundle);
7006 Args.AddAllArgs(CmdArgs, options::OPT_bundle__loader);
7007 Args.AddAllArgs(CmdArgs, options::OPT_client__name);
7016 Args.AddLastArg(CmdArgs, options::OPT_force__flat__namespace);
7017 Args.AddLastArg(CmdArgs, options::OPT_keep__private__externs);
7018 Args.AddLastArg(CmdArgs, options::OPT_private__bundle);
7020 CmdArgs.push_back("-dylib");
7032 Args.AddAllArgsTranslated(CmdArgs, options::OPT_compatibility__version,
7034 Args.AddAllArgsTranslated(CmdArgs, options::OPT_current__version,
7037 AddMachOArch(Args, CmdArgs);
7039 Args.AddAllArgsTranslated(CmdArgs, options::OPT_install__name,
7043 Args.AddLastArg(CmdArgs, options::OPT_all__load);
7044 Args.AddAllArgs(CmdArgs, options::OPT_allowable__client);
7045 Args.AddLastArg(CmdArgs, options::OPT_bind__at__load);
7047 Args.AddLastArg(CmdArgs, options::OPT_arch__errors__fatal);
7048 Args.AddLastArg(CmdArgs, options::OPT_dead__strip);
7049 Args.AddLastArg(CmdArgs, options::OPT_no__dead__strip__inits__and__terms);
7050 Args.AddAllArgs(CmdArgs, options::OPT_dylib__file);
7051 Args.AddLastArg(CmdArgs, options::OPT_dynamic);
7052 Args.AddAllArgs(CmdArgs, options::OPT_exported__symbols__list);
7053 Args.AddLastArg(CmdArgs, options::OPT_flat__namespace);
7054 Args.AddAllArgs(CmdArgs, options::OPT_force__load);
7055 Args.AddAllArgs(CmdArgs, options::OPT_headerpad__max__install__names);
7056 Args.AddAllArgs(CmdArgs, options::OPT_image__base);
7057 Args.AddAllArgs(CmdArgs, options::OPT_init);
7060 MachOTC.addMinVersionArgs(Args, CmdArgs);
7062 Args.AddLastArg(CmdArgs, options::OPT_nomultidefs);
7063 Args.AddLastArg(CmdArgs, options::OPT_multi__module);
7064 Args.AddLastArg(CmdArgs, options::OPT_single__module);
7065 Args.AddAllArgs(CmdArgs, options::OPT_multiply__defined);
7066 Args.AddAllArgs(CmdArgs, options::OPT_multiply__defined__unused);
7073 CmdArgs.push_back("-pie");
7075 CmdArgs.push_back("-no_pie");
7078 Args.AddLastArg(CmdArgs, options::OPT_prebind);
7079 Args.AddLastArg(CmdArgs, options::OPT_noprebind);
7080 Args.AddLastArg(CmdArgs, options::OPT_nofixprebinding);
7081 Args.AddLastArg(CmdArgs, options::OPT_prebind__all__twolevel__modules);
7082 Args.AddLastArg(CmdArgs, options::OPT_read__only__relocs);
7083 Args.AddAllArgs(CmdArgs, options::OPT_sectcreate);
7084 Args.AddAllArgs(CmdArgs, options::OPT_sectorder);
7085 Args.AddAllArgs(CmdArgs, options::OPT_seg1addr);
7086 Args.AddAllArgs(CmdArgs, options::OPT_segprot);
7087 Args.AddAllArgs(CmdArgs, options::OPT_segaddr);
7088 Args.AddAllArgs(CmdArgs, options::OPT_segs__read__only__addr);
7089 Args.AddAllArgs(CmdArgs, options::OPT_segs__read__write__addr);
7090 Args.AddAllArgs(CmdArgs, options::OPT_seg__addr__table);
7091 Args.AddAllArgs(CmdArgs, options::OPT_seg__addr__table__filename);
7092 Args.AddAllArgs(CmdArgs, options::OPT_sub__library);
7093 Args.AddAllArgs(CmdArgs, options::OPT_sub__umbrella);
7099 CmdArgs.push_back("-syslibroot");
7100 CmdArgs.push_back(C.getArgs().MakeArgString(sysroot));
7102 CmdArgs.push_back("-syslibroot");
7103 CmdArgs.push_back(A->getValue());
7106 Args.AddLastArg(CmdArgs, options::OPT_twolevel__namespace);
7107 Args.AddLastArg(CmdArgs, options::OPT_twolevel__namespace__hints);
7108 Args.AddAllArgs(CmdArgs, options::OPT_umbrella);
7109 Args.AddAllArgs(CmdArgs, options::OPT_undefined);
7110 Args.AddAllArgs(CmdArgs, options::OPT_unexported__symbols__list);
7111 Args.AddAllArgs(CmdArgs, options::OPT_weak__reference__mismatches);
7112 Args.AddLastArg(CmdArgs, options::OPT_X_Flag);
7113 Args.AddAllArgs(CmdArgs, options::OPT_y);
7114 Args.AddLastArg(CmdArgs, options::OPT_w);
7115 Args.AddAllArgs(CmdArgs, options::OPT_pagezero__size);
7116 Args.AddAllArgs(CmdArgs, options::OPT_segs__read__);
7117 Args.AddLastArg(CmdArgs, options::OPT_seglinkedit);
7118 Args.AddLastArg(CmdArgs, options::OPT_noseglinkedit);
7119 Args.AddAllArgs(CmdArgs, options::OPT_sectalign);
7120 Args.AddAllArgs(CmdArgs, options::OPT_sectobjectsymbols);
7121 Args.AddAllArgs(CmdArgs, options::OPT_segcreate);
7122 Args.AddLastArg(CmdArgs, options::OPT_whyload);
7123 Args.AddLastArg(CmdArgs, options::OPT_whatsloaded);
7124 Args.AddAllArgs(CmdArgs, options::OPT_dylinker__install__name);
7125 Args.AddLastArg(CmdArgs, options::OPT_dylinker);
7126 Args.AddLastArg(CmdArgs, options::OPT_Mach);
7145 ArgStringList CmdArgs;
7154 CmdArgs.push_back(Output.getFilename());
7155 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, None));
7161 AddLinkArgs(C, Args, CmdArgs, Inputs);
7165 Args.AddAllArgs(CmdArgs, {options::OPT_d_Flag, options::OPT_s, options::OPT_t,
7173 CmdArgs.push_back("-ObjC");
7175 CmdArgs.push_back("-o");
7176 CmdArgs.push_back(Output.getFilename());
7179 getMachOToolChain().addStartObjectFileArgs(Args, CmdArgs);
7185 getMachOToolChain().AddLinkRuntimeLib(Args, CmdArgs,
7190 Args.AddAllArgs(CmdArgs, options::OPT_L);
7192 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
7211 addOpenMPRuntime(CmdArgs, getToolChain(), Args);
7216 getMachOToolChain().AddLinkARCArgs(Args, CmdArgs);
7218 CmdArgs.push_back("-framework");
7219 CmdArgs.push_back("Foundation");
7221 CmdArgs.push_back("-lobjc");
7225 CmdArgs.push_back("-arch_multiple");
7226 CmdArgs.push_back("-final_output");
7227 CmdArgs.push_back(LinkingOutput);
7231 CmdArgs.push_back("-allow_stack_execute");
7233 getMachOToolChain().addProfileRTLibs(Args, CmdArgs);
7237 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
7242 getMachOToolChain().AddLinkRuntimeLibArgs(Args, CmdArgs);
7249 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
7250 Args.AddAllArgs(CmdArgs, options::OPT_F);
7254 CmdArgs.push_back(Args.MakeArgString(std::string("-F") + A->getValue()));
7259 CmdArgs.push_back("-framework");
7260 CmdArgs.push_back("Accelerate");
7267 llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs);
7277 ArgStringList CmdArgs;
7279 CmdArgs.push_back("-create");
7282 CmdArgs.push_back("-output");
7283 CmdArgs.push_back(Output.getFilename());
7287 CmdArgs.push_back(II.getFilename());
7291 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7299 ArgStringList CmdArgs;
7301 CmdArgs.push_back("-o");
7302 CmdArgs.push_back(Output.getFilename());
7307 CmdArgs.push_back(Input.getFilename());
7311 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7319 ArgStringList CmdArgs;
7320 CmdArgs.push_back("--verify");
7321 CmdArgs.push_back("--debug-info");
7322 CmdArgs.push_back("--eh-frame");
7323 CmdArgs.push_back("--quiet");
7330 CmdArgs.push_back(Input.getFilename());
7334 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7343 ArgStringList CmdArgs;
7345 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
7347 CmdArgs.push_back("-o");
7348 CmdArgs.push_back(Output.getFilename());
7351 CmdArgs.push_back(II.getFilename());
7354 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7362 ArgStringList CmdArgs;
7365 CmdArgs.push_back("-C");
7368 CmdArgs.push_back("-e");
7369 CmdArgs.push_back("_start");
7373 CmdArgs.push_back("-Bstatic");
7374 CmdArgs.push_back("-dn");
7376 CmdArgs.push_back("-Bdynamic");
7378 CmdArgs.push_back("-shared");
7380 CmdArgs.push_back("--dynamic-linker");
7381 CmdArgs.push_back(
7387 CmdArgs.push_back("-o");
7388 CmdArgs.push_back(Output.getFilename());
7395 CmdArgs.push_back(
7398 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crti.o")));
7399 CmdArgs.push_back(
7401 CmdArgs.push_back(
7405 getToolChain().AddFilePathLibArgs(Args, CmdArgs);
7407 Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
7410 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
7414 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
7415 CmdArgs.push_back("-lgcc_s");
7416 CmdArgs.push_back("-lc");
7418 CmdArgs.push_back("-lgcc");
7419 CmdArgs.push_back("-lm");
7424 CmdArgs.push_back(
7427 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
7429 getToolChain().addProfileRTLibs(Args, CmdArgs);
7432 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7441 ArgStringList CmdArgs;
7447 CmdArgs.push_back("--32");
7451 CmdArgs.push_back("-mppc");
7452 CmdArgs.push_back("-many");
7457 CmdArgs.push_back("-32");
7459 CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
7460 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
7465 CmdArgs.push_back("-64");
7467 CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
7468 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
7478 CmdArgs.push_back("-mabi");
7479 CmdArgs.push_back(getGnuCompatibleMipsABIName(ABIName).data());
7482 CmdArgs.push_back("-EB");
7484 CmdArgs.push_back("-EL");
7486 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
7494 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
7496 CmdArgs.push_back("-o");
7497 CmdArgs.push_back(Output.getFilename());
7500 CmdArgs.push_back(II.getFilename());
7503 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7512 ArgStringList CmdArgs;
7523 CmdArgs.push_back("-EB");
7525 CmdArgs.push_back("-EL");
7528 CmdArgs.push_back("-e");
7529 CmdArgs.push_back("__start");
7533 CmdArgs.push_back("-Bstatic");
7536 CmdArgs.push_back("-export-dynamic");
7537 CmdArgs.push_back("--eh-frame-hdr");
7538 CmdArgs.push_back("-Bdynamic");
7540 CmdArgs.push_back("-shared");
7542 CmdArgs.push_back("-dynamic-linker");
7543 CmdArgs.push_back("/usr/libexec/ld.so");
7548 CmdArgs.push_back("-nopie");
7551 CmdArgs.push_back("-o");
7552 CmdArgs.push_back(Output.getFilename());
7560 CmdArgs.push_back(
7563 CmdArgs.push_back(
7565 CmdArgs.push_back(
7568 CmdArgs.push_back(
7576 CmdArgs.push_back(
7579 Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
7583 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
7587 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
7589 CmdArgs.push_back("-lm_p");
7591 CmdArgs.push_back("-lm");
7596 CmdArgs.push_back("-lgcc");
7600 CmdArgs.push_back("-lpthread_p");
7602 CmdArgs.push_back("-lpthread");
7607 CmdArgs.push_back("-lc_p");
7609 CmdArgs.push_back("-lc");
7612 CmdArgs.push_back("-lgcc");
7617 CmdArgs.push_back(
7620 CmdArgs.push_back(
7625 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7634 ArgStringList CmdArgs;
7636 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
7638 CmdArgs.push_back("-o");
7639 CmdArgs.push_back(Output.getFilename());
7642 CmdArgs.push_back(II.getFilename());
7645 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7654 ArgStringList CmdArgs;
7657 CmdArgs.push_back("-e");
7658 CmdArgs.push_back("__start");
7662 CmdArgs.push_back("-Bstatic");
7665 CmdArgs.push_back("-export-dynamic");
7666 CmdArgs.push_back("--eh-frame-hdr");
7667 CmdArgs.push_back("-Bdynamic");
7669 CmdArgs.push_back("-shared");
7671 CmdArgs.push_back("-dynamic-linker");
7672 CmdArgs.push_back("/usr/libexec/ld.so");
7677 CmdArgs.push_back("-o");
7678 CmdArgs.push_back(Output.getFilename());
7686 CmdArgs.push_back(
7689 CmdArgs.push_back(
7691 CmdArgs.push_back(
7694 CmdArgs.push_back(
7699 Args.AddAllArgs(CmdArgs,
7702 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
7706 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
7708 CmdArgs.push_back("-lm_p");
7710 CmdArgs.push_back("-lm");
7715 CmdArgs.push_back("-lpthread_p");
7717 CmdArgs.push_back("-lpthread");
7722 CmdArgs.push_back("-lc_p");
7724 CmdArgs.push_back("-lc");
7741 CmdArgs.push_back(Args.MakeArgString("-lclang_rt." + MyArch));
7746 CmdArgs.push_back(
7749 CmdArgs.push_back(
7754 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7763 ArgStringList CmdArgs;
7771 CmdArgs.push_back("--32");
7774 CmdArgs.push_back("-a32");
7784 CmdArgs.push_back("-march");
7785 CmdArgs.push_back(CPUName.data());
7787 CmdArgs.push_back("-mabi");
7788 CmdArgs.push_back(getGnuCompatibleMipsABIName(ABIName).data());
7792 CmdArgs.push_back("-EB");
7794 CmdArgs.push_back("-EL");
7796 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
7806 CmdArgs.push_back("-mfpu=vfp");
7808 CmdArgs.push_back("-mfpu=softvfp");
7814 CmdArgs.push_back("-meabi=5");
7818 CmdArgs.push_back("-matpcs");
7826 CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
7827 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
7832 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
7834 CmdArgs.push_back("-o");
7835 CmdArgs.push_back(Output.getFilename());
7838 CmdArgs.push_back(II.getFilename());
7841 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
7856 ArgStringList CmdArgs;
7867 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
7870 CmdArgs.push_back("-pie");
7873 CmdArgs.push_back("-Bstatic");
7876 CmdArgs.push_back("-export-dynamic");
7877 CmdArgs.push_back("--eh-frame-hdr");
7879 CmdArgs.push_back("-Bshareable");
7881 CmdArgs.push_back("-dynamic-linker");
7882 CmdArgs.push_back("/libexec/ld-elf.so.1");
7887 CmdArgs.push_back("--hash-style=both");
7890 CmdArgs.push_back("--enable-new-dtags");
7896 CmdArgs.push_back("-m");
7897 CmdArgs.push_back("elf_i386_fbsd");
7901 CmdArgs.push_back("-m");
7902 CmdArgs.push_back("elf32ppc_fbsd");
7906 CmdArgs.push_back("-o");
7907 CmdArgs.push_back(Output.getFilename());
7923 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
7925 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
7935 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
7938 Args.AddAllArgs(CmdArgs, options::OPT_L);
7939 ToolChain.AddFilePathLibArgs(Args, CmdArgs);
7940 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
7941 Args.AddAllArgs(CmdArgs, options::OPT_e);
7942 Args.AddAllArgs(CmdArgs, options::OPT_s);
7943 Args.AddAllArgs(CmdArgs, options::OPT_t);
7944 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
7945 Args.AddAllArgs(CmdArgs, options::OPT_r);
7948 AddGoldPlugin(ToolChain, Args, CmdArgs, D.getLTOMode() == LTOK_Thin);
7950 bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
7951 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
7954 addOpenMPRuntime(CmdArgs, ToolChain, Args);
7956 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
7958 CmdArgs.push_back("-lm_p");
7960 CmdArgs.push_back("-lm");
7963 linkSanitizerRuntimeDeps(ToolChain, CmdArgs);
7967 CmdArgs.push_back("-lgcc_p");
7969 CmdArgs.push_back("-lgcc");
7971 CmdArgs.push_back("-lgcc_eh");
7973 CmdArgs.push_back("-lgcc_eh_p");
7975 CmdArgs.push_back("--as-needed");
7976 CmdArgs.push_back("-lgcc_s");
7977 CmdArgs.push_back("--no-as-needed");
7982 CmdArgs.push_back("-lpthread_p");
7984 CmdArgs.push_back("-lpthread");
7989 CmdArgs.push_back("-lc");
7991 CmdArgs.push_back("-lc_p");
7992 CmdArgs.push_back("-lgcc_p");
7994 CmdArgs.push_back("-lc");
7995 CmdArgs.push_back("-lgcc");
7999 CmdArgs.push_back("-lgcc_eh");
8001 CmdArgs.push_back("-lgcc_eh_p");
8003 CmdArgs.push_back("--as-needed");
8004 CmdArgs.push_back("-lgcc_s");
8005 CmdArgs.push_back("--no-as-needed");
8011 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtendS.o")));
8013 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
8014 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
8017 ToolChain.addProfileRTLibs(Args, CmdArgs);
8020 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
8029 ArgStringList CmdArgs;
8035 CmdArgs.push_back("--32");
8045 CmdArgs.push_back(Args.MakeArgString("-mcpu=" + Arch));
8057 CmdArgs.push_back("-march");
8058 CmdArgs.push_back(CPUName.data());
8060 CmdArgs.push_back("-mabi");
8061 CmdArgs.push_back(getGnuCompatibleMipsABIName(ABIName).data());
8065 CmdArgs.push_back("-EB");
8067 CmdArgs.push_back("-EL");
8069 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
8075 CmdArgs.push_back("-32");
8077 CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
8078 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
8083 CmdArgs.push_back("-64");
8085 CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
8086 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
8094 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
8096 CmdArgs.push_back("-o");
8097 CmdArgs.push_back(Output.getFilename());
8100 CmdArgs.push_back(II.getFilename());
8103 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
8112 ArgStringList CmdArgs;
8115 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
8117 CmdArgs.push_back("--eh-frame-hdr");
8119 CmdArgs.push_back("-Bstatic");
8122 CmdArgs.push_back("-export-dynamic");
8124 CmdArgs.push_back("-Bshareable");
8126 CmdArgs.push_back("-dynamic-linker");
8127 CmdArgs.push_back("/libexec/ld.elf_so");
8135 CmdArgs.push_back("-m");
8136 CmdArgs.push_back("elf_i386");
8140 CmdArgs.push_back("-m");
8144 CmdArgs.push_back("armelf_nbsd_eabi");
8148 CmdArgs.push_back("armelf_nbsd_eabihf");
8151 CmdArgs.push_back("armelf_nbsd");
8158 Args, CmdArgs,
8160 CmdArgs.push_back("-m");
8164 CmdArgs.push_back("armelfb_nbsd_eabi");
8168 CmdArgs.push_back("armelfb_nbsd_eabihf");
8171 CmdArgs.push_back("armelfb_nbsd");
8178 CmdArgs.push_back("-m");
8180 CmdArgs.push_back("elf32btsmip");
8182 CmdArgs.push_back("elf32ltsmip");
8184 CmdArgs.push_back("-m");
8186 CmdArgs.push_back("elf64btsmip");
8188 CmdArgs.push_back("elf64ltsmip");
8192 CmdArgs.push_back("-m");
8193 CmdArgs.push_back("elf32ppc_nbsd");
8198 CmdArgs.push_back("-m");
8199 CmdArgs.push_back("elf64ppc");
8203 CmdArgs.push_back("-m");
8204 CmdArgs.push_back("elf32_sparc");
8208 CmdArgs.push_back("-m");
8209 CmdArgs.push_back("elf64_sparc");
8217 CmdArgs.push_back("-o");
8218 CmdArgs.push_back(Output.getFilename());
8225 CmdArgs.push_back(
8227 CmdArgs.push_back(
8229 CmdArgs.push_back(
8232 CmdArgs.push_back(
8234 CmdArgs.push_back(
8239 Args.AddAllArgs(CmdArgs, options::OPT_L);
8240 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
8241 Args.AddAllArgs(CmdArgs, options::OPT_e);
8242 Args.AddAllArgs(CmdArgs, options::OPT_s);
8243 Args.AddAllArgs(CmdArgs, options::OPT_t);
8244 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
8245 Args.AddAllArgs(CmdArgs, options::OPT_r);
8247 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
8272 addOpenMPRuntime(CmdArgs, getToolChain(), Args);
8274 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
8275 CmdArgs.push_back("-lm");
8278 CmdArgs.push_back("-lpthread");
8279 CmdArgs.push_back("-lc");
8286 CmdArgs.push_back("-lgcc_eh");
8287 CmdArgs.push_back("-lc");
8288 CmdArgs.push_back("-lgcc");
8290 CmdArgs.push_back("-lgcc");
8291 CmdArgs.push_back("--as-needed");
8292 CmdArgs.push_back("-lgcc_s");
8293 CmdArgs.push_back("--no-as-needed");
8300 CmdArgs.push_back(
8303 CmdArgs.push_back(
8305 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
8308 getToolChain().addProfileRTLibs(Args, CmdArgs);
8311 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
8324 ArgStringList CmdArgs;
8338 CmdArgs.push_back("--32");
8342 CmdArgs.push_back("--x32");
8344 CmdArgs.push_back("--64");
8347 CmdArgs.push_back("-a32");
8348 CmdArgs.push_back("-mppc");
8349 CmdArgs.push_back("-many");
8352 CmdArgs.push_back("-a64");
8353 CmdArgs.push_back("-mppc64");
8354 CmdArgs.push_back("-many");
8357 CmdArgs.push_back("-a64");
8358 CmdArgs.push_back("-mppc64");
8359 CmdArgs.push_back("-many");
8360 CmdArgs.push_back("-mlittle-endian");
8364 CmdArgs.push_back("-32");
8366 CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
8367 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
8371 CmdArgs.push_back("-64");
8373 CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
8374 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
8384 CmdArgs.push_back("-mfpu=neon");
8387 CmdArgs.push_back("-mfpu=crypto-neon-fp-armv8");
8396 CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=soft"));
8399 CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=softfp"));
8402 CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=hard"));
8406 Args.AddLastArg(CmdArgs, options::OPT_march_EQ);
8414 CmdArgs.push_back("-mcpu=cortex-a15");
8416 Args.AddLastArg(CmdArgs, options::OPT_mcpu_EQ);
8417 Args.AddLastArg(CmdArgs, options::OPT_mfpu_EQ);
8429 CmdArgs.push_back("-march");
8430 CmdArgs.push_back(CPUName.data());
8432 CmdArgs.push_back("-mabi");
8433 CmdArgs.push_back(ABIName.data());
8438 CmdArgs.push_back("-mno-shared");
8442 CmdArgs.push_back(ABIName == "64" ? "-KPIC" : "-call_nonpic");
8446 CmdArgs.push_back("-EB");
8448 CmdArgs.push_back("-EL");
8452 CmdArgs.push_back(Args.MakeArgString("-mnan=2008"));
8459 A->render(Args, CmdArgs);
8463 CmdArgs.push_back("-mfpxx");
8471 A->render(Args, CmdArgs);
8474 CmdArgs.push_back("-no-mips16");
8478 Args.AddLastArg(CmdArgs, options::OPT_mmicromips,
8480 Args.AddLastArg(CmdArgs, options::OPT_mdsp, options::OPT_mno_dsp);
8481 Args.AddLastArg(CmdArgs, options::OPT_mdspr2, options::OPT_mno_dspr2);
8487 CmdArgs.push_back(Args.MakeArgString("-mmsa"));
8490 Args.AddLastArg(CmdArgs, options::OPT_mhard_float,
8493 Args.AddLastArg(CmdArgs, options::OPT_mdouble_float,
8496 Args.AddLastArg(CmdArgs, options::OPT_modd_spreg,
8499 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
8506 CmdArgs.push_back(Args.MakeArgString("-march=" + CPUName));
8511 Args.AddAllArgs(CmdArgs, options::OPT_I);
8512 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
8514 CmdArgs.push_back("-o");
8515 CmdArgs.push_back(Output.getFilename());
8518 CmdArgs.push_back(II.getFilename());
8521 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
8533 ArgStringList &CmdArgs, const ArgList &Args) {
8539 CmdArgs.push_back("-lgcc");
8543 CmdArgs.push_back("-lgcc");
8546 CmdArgs.push_back("--as-needed");
8547 CmdArgs.push_back("-lgcc_s");
8549 CmdArgs.push_back("--no-as-needed");
8553 CmdArgs.push_back("-lgcc_eh");
8555 CmdArgs.push_back("-lgcc");
8563 CmdArgs.push_back("-ldl");
8633 ArgStringList &CmdArgs, const ArgList &Args) {
8644 addClangRT(TC, Args, CmdArgs);
8649 AddLibgcc(TC.getTriple(), D, CmdArgs, Args);
8723 ArgStringList CmdArgs;
8735 CmdArgs.push_back("-flavor");
8736 CmdArgs.push_back("old-gnu");
8737 CmdArgs.push_back("-target");
8738 CmdArgs.push_back(Args.MakeArgString(getToolChain().getTripleString()));
8742 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
8745 CmdArgs.push_back("-pie");
8748 CmdArgs.push_back("-export-dynamic");
8751 CmdArgs.push_back("-s");
8754 arm::appendEBLinkFlags(Args, CmdArgs, Triple);
8757 CmdArgs.push_back(Opt.c_str());
8760 CmdArgs.push_back("--eh-frame-hdr");
8763 CmdArgs.push_back("-m");
8764 CmdArgs.push_back(getLDMOption(ToolChain.getTriple(), Args));
8769 CmdArgs.push_back("-Bstatic");
8771 CmdArgs.push_back("-static");
8773 CmdArgs.push_back("-shared");
8780 CmdArgs.push_back("-dynamic-linker");
8781 CmdArgs.push_back(Args.MakeArgString(
8785 CmdArgs.push_back("-o");
8786 CmdArgs.push_back(Output.getFilename());
8800 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
8802 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
8816 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
8819 ToolChain.AddFastMathRuntimeIfAvailable(Args, CmdArgs);
8822 Args.AddAllArgs(CmdArgs, options::OPT_L);
8823 Args.AddAllArgs(CmdArgs, options::OPT_u);
8825 ToolChain.AddFilePathLibArgs(Args, CmdArgs);
8828 CmdArgs, D.getLTOMode() == LTOK_Thin);
8831 CmdArgs.push_back("--no-demangle");
8833 bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
8834 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
8836 getToolChain().addProfileRTLibs(Args, CmdArgs);
8843 CmdArgs.push_back("-Bstatic");
8844 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
8846 CmdArgs.push_back("-Bdynamic");
8847 CmdArgs.push_back("-lm");
8855 CmdArgs.push_back("--start-group");
8858 linkSanitizerRuntimeDeps(ToolChain, CmdArgs);
8872 CmdArgs.push_back("-lomp");
8875 CmdArgs.push_back("-lgomp");
8879 CmdArgs.push_back("-lrt");
8882 CmdArgs.push_back("-liomp5");
8890 AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
8893 CmdArgs.push_back("-lpthread");
8895 CmdArgs.push_back("-lc");
8898 CmdArgs.push_back("--end-group");
8900 AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
8913 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
8915 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
8919 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
8959 ArgStringList CmdArgs;
8970 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
8973 CmdArgs.push_back("-export-dynamic");
8976 CmdArgs.push_back("-s");
8980 CmdArgs.push_back("--build-id");
8983 CmdArgs.push_back("--eh-frame-hdr");
8985 CmdArgs.push_back("-m");
8987 CmdArgs.push_back("elf_i386_nacl");
8989 CmdArgs.push_back("armelf_nacl");
8991 CmdArgs.push_back("elf_x86_64_nacl");
8993 CmdArgs.push_back("mipselelf_nacl");
8999 CmdArgs.push_back("-static");
9001 CmdArgs.push_back("-shared");
9003 CmdArgs.push_back("-o");
9004 CmdArgs.push_back(Output.getFilename());
9007 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crt1.o")));
9008 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
9017 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
9020 Args.AddAllArgs(CmdArgs, options::OPT_L);
9021 Args.AddAllArgs(CmdArgs, options::OPT_u);
9023 ToolChain.AddFilePathLibArgs(Args, CmdArgs);
9026 CmdArgs.push_back("--no-demangle");
9028 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
9035 CmdArgs.push_back("-Bstatic");
9036 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
9038 CmdArgs.push_back("-Bdynamic");
9039 CmdArgs.push_back("-lm");
9045 CmdArgs.push_back("--start-group");
9046 CmdArgs.push_back("-lc");
9056 CmdArgs.push_back("-lnacl");
9058 CmdArgs.push_back("-lpthread");
9061 CmdArgs.push_back("-lgcc");
9062 CmdArgs.push_back("--as-needed");
9064 CmdArgs.push_back("-lgcc_eh");
9066 CmdArgs.push_back("-lgcc_s");
9067 CmdArgs.push_back("--no-as-needed");
9073 CmdArgs.push_back("-lpnacl_legacy");
9075 CmdArgs.push_back("--end-group");
9085 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
9086 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
9091 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9100 ArgStringList CmdArgs;
9102 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
9104 CmdArgs.push_back("-o");
9105 CmdArgs.push_back(Output.getFilename());
9108 CmdArgs.push_back(II.getFilename());
9111 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9120 ArgStringList CmdArgs;
9123 CmdArgs.push_back("-o");
9124 CmdArgs.push_back(Output.getFilename());
9130 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crt1.o")));
9131 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crti.o")));
9132 CmdArgs.push_back(
9134 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
9137 Args.AddAllArgs(CmdArgs,
9140 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
9142 getToolChain().addProfileRTLibs(Args, CmdArgs);
9146 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
9147 CmdArgs.push_back("-lm");
9153 CmdArgs.push_back("-lpthread");
9154 CmdArgs.push_back("-lc");
9155 CmdArgs.push_back("-lCompilerRT-Generic");
9156 CmdArgs.push_back("-L/usr/pkg/compiler-rt/lib");
9157 CmdArgs.push_back(
9162 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9175 ArgStringList CmdArgs;
9180 CmdArgs.push_back("--32");
9182 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
9184 CmdArgs.push_back("-o");
9185 CmdArgs.push_back(Output.getFilename());
9188 CmdArgs.push_back(II.getFilename());
9191 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9200 ArgStringList CmdArgs;
9204 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
9206 CmdArgs.push_back("--eh-frame-hdr");
9208 CmdArgs.push_back("-Bstatic");
9211 CmdArgs.push_back("-export-dynamic");
9213 CmdArgs.push_back("-Bshareable");
9215 CmdArgs.push_back("-dynamic-linker");
9216 CmdArgs.push_back("/usr/libexec/ld-elf.so.2");
9218 CmdArgs.push_back("--hash-style=both");
9224 CmdArgs.push_back("-m");
9225 CmdArgs.push_back("elf_i386");
9229 CmdArgs.push_back("-o");
9230 CmdArgs.push_back(Output.getFilename());
9238 CmdArgs.push_back(
9242 CmdArgs.push_back(
9245 CmdArgs.push_back(
9249 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crti.o")));
9251 CmdArgs.push_back(
9254 CmdArgs.push_back(
9258 Args.AddAllArgs(CmdArgs,
9261 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
9267 CmdArgs.push_back("-L/usr/lib/gcc47");
9269 CmdArgs.push_back("-L/usr/lib/gcc44");
9273 CmdArgs.push_back("-rpath");
9274 CmdArgs.push_back("/usr/lib/gcc47");
9276 CmdArgs.push_back("-rpath");
9277 CmdArgs.push_back("/usr/lib/gcc44");
9282 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
9283 CmdArgs.push_back("-lm");
9287 CmdArgs.push_back("-lpthread");
9290 CmdArgs.push_back("-lc");
9296 CmdArgs.push_back("-lgcc");
9297 CmdArgs.push_back("-lgcc_eh");
9300 CmdArgs.push_back("-lgcc_pic");
9302 CmdArgs.push_back("-lgcc");
9304 CmdArgs.push_back("-lgcc");
9305 CmdArgs.push_back("--as-needed");
9306 CmdArgs.push_back("-lgcc_pic");
9307 CmdArgs.push_back("--no-as-needed");
9312 CmdArgs.push_back("-lgcc_pic");
9314 CmdArgs.push_back("-lgcc");
9321 CmdArgs.push_back(
9324 CmdArgs.push_back(
9326 CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
9329 getToolChain().addProfileRTLibs(Args, CmdArgs);
9332 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9360 ArgStringList CmdArgs;
9365 CmdArgs.push_back(
9370 CmdArgs.push_back("-defaultlib:libcmt");
9395 CmdArgs.push_back(
9401 CmdArgs.push_back(Args.MakeArgString(std::string("-libpath:") +
9408 CmdArgs.push_back(Args.MakeArgString(std::string("-libpath:") +
9412 CmdArgs.push_back("-nologo");
9415 CmdArgs.push_back("-debug");
9420 CmdArgs.push_back(Args.MakeArgString("-dll"));
9424 CmdArgs.push_back(Args.MakeArgString(std::string("-implib:") + ImplibName));
9428 CmdArgs.push_back(Args.MakeArgString("-debug"));
9429 CmdArgs.push_back(Args.MakeArgString("-incremental:no"));
9432 CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib));
9435 CmdArgs.push_back(Args.MakeArgString("-include:___asan_seh_interceptor"));
9437 CmdArgs.push_back(TC.getCompilerRTArgString(Args, "asan_dll_thunk"));
9440 CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib));
9444 Args.AddAllArgValues(CmdArgs, options::OPT__SLASH_link);
9448 CmdArgs.push_back("-nodefaultlib:vcomp.lib");
9449 CmdArgs.push_back("-nodefaultlib:vcompd.lib");
9450 CmdArgs.push_back(Args.MakeArgString(std::string("-libpath:") +
9454 CmdArgs.push_back("-defaultlib:libomp.lib");
9457 CmdArgs.push_back("-defaultlib:libiomp5md.lib");
9470 CmdArgs.push_back(Input.getFilename());
9484 CmdArgs.push_back(LinkLibArg);
9490 A.renderAsInput(Args, CmdArgs);
9514 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9529 ArgStringList CmdArgs;
9530 CmdArgs.push_back("/nologo");
9531 CmdArgs.push_back("/c"); // Compile only.
9532 CmdArgs.push_back("/W0"); // No warnings.
9538 Args.AddAllArgs(CmdArgs, {options::OPT_D, options::OPT_U, options::OPT_I});
9542 CmdArgs.push_back(A->getOption().getID() == options::OPT_fbuiltin ? "/Oi"
9546 CmdArgs.push_back("/Od");
9548 CmdArgs.push_back("/Og");
9552 CmdArgs.push_back("/Os");
9554 CmdArgs.push_back("/Ot");
9556 CmdArgs.push_back("/Ob2");
9561 CmdArgs.push_back(A->getOption().getID() == options::OPT_fomit_frame_pointer
9565 CmdArgs.push_back("/GF");
9572 CmdArgs.push_back("/GR-");
9575 CmdArgs.push_back(A->getOption().getID() == options::OPT_ffunction_sections
9580 CmdArgs.push_back(
9583 CmdArgs.push_back("/Zs");
9586 CmdArgs.push_back("/Z7");
9591 CmdArgs.push_back(Args.MakeArgString(std::string("/FI") + Include));
9594 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_LD);
9595 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_LDd);
9596 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_EH);
9597 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_Zl);
9602 A->render(Args, CmdArgs);
9608 CmdArgs.push_back(II.getType() == types::TY_C ? "/Tc" : "/Tp");
9610 CmdArgs.push_back(II.getFilename());
9612 II.getInputArg().renderAsInput(Args, CmdArgs);
9618 CmdArgs.push_back(Fo);
9624 CmdArgs, Inputs);
9634 ArgStringList CmdArgs;
9637 CmdArgs.push_back("--32");
9639 CmdArgs.push_back("--64");
9642 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
9644 CmdArgs.push_back("-o");
9645 CmdArgs.push_back(Output.getFilename());
9648 CmdArgs.push_back(II.getFilename());
9651 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9659 ArgStringList &CmdArgs) const {
9661 CmdArgs.push_back("-lmingwthrd");
9662 CmdArgs.push_back("-lmingw32");
9673 CmdArgs.push_back("-lgcc");
9674 CmdArgs.push_back("-lgcc_eh");
9676 CmdArgs.push_back("-lgcc_s");
9677 CmdArgs.push_back("-lgcc");
9680 AddRunTimeLibs(getToolChain(), getToolChain().getDriver(), CmdArgs, Args);
9683 CmdArgs.push_back("-lmoldname");
9684 CmdArgs.push_back("-lmingwex");
9685 CmdArgs.push_back("-lmsvcrt");
9697 ArgStringList CmdArgs;
9709 CmdArgs.push_back("-flavor");
9710 CmdArgs.push_back("gnu");
9716 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
9719 CmdArgs.push_back("-s");
9721 CmdArgs.push_back("-m");
9723 CmdArgs.push_back("i386pe");
9725 CmdArgs.push_back("i386pep");
9727 CmdArgs.push_back("thumb2pe");
9730 CmdArgs.push_back("--subsystem");
9731 CmdArgs.push_back("windows");
9733 CmdArgs.push_back("--subsystem");
9734 CmdArgs.push_back("console");
9738 CmdArgs.push_back("-Bstatic");
9741 CmdArgs.push_back("--dll");
9743 CmdArgs.push_back("--shared");
9744 CmdArgs.push_back("-Bdynamic");
9746 CmdArgs.push_back("-e");
9748 CmdArgs.push_back("_DllMainCRTStartup@12");
9750 CmdArgs.push_back("DllMainCRTStartup");
9751 CmdArgs.push_back("--enable-auto-image-base");
9755 CmdArgs.push_back("-o");
9756 CmdArgs.push_back(Output.getFilename());
9758 Args.AddAllArgs(CmdArgs, options::OPT_e);
9760 Args.AddLastArg(CmdArgs, options::OPT_r);
9761 Args.AddLastArg(CmdArgs, options::OPT_s);
9762 Args.AddLastArg(CmdArgs, options::OPT_t);
9763 Args.AddAllArgs(CmdArgs, options::OPT_u_Group);
9764 Args.AddLastArg(CmdArgs, options::OPT_Z_Flag);
9768 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("dllcrt2.o")));
9771 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crt2u.o")));
9773 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crt2.o")));
9776 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("gcrt2.o")));
9777 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtbegin.o")));
9780 Args.AddAllArgs(CmdArgs, options::OPT_L);
9781 TC.AddFilePathLibArgs(Args, CmdArgs);
9782 AddLinkerInputs(TC, Inputs, Args, CmdArgs);
9793 CmdArgs.push_back("-Bstatic");
9794 TC.AddCXXStdlibLibArgs(Args, CmdArgs);
9796 CmdArgs.push_back("-Bdynamic");
9802 CmdArgs.push_back("--start-group");
9807 CmdArgs.push_back("-lssp_nonshared");
9808 CmdArgs.push_back("-lssp");
9811 CmdArgs.push_back("-lgomp");
9813 AddLibGCC(Args, CmdArgs);
9816 CmdArgs.push_back("-lgmon");
9819 CmdArgs.push_back("-lpthread");
9823 CmdArgs.push_back("-lgdi32");
9824 CmdArgs.push_back("-lcomdlg32");
9826 CmdArgs.push_back("-ladvapi32");
9827 CmdArgs.push_back("-lshell32");
9828 CmdArgs.push_back("-luser32");
9829 CmdArgs.push_back("-lkernel32");
9832 CmdArgs.push_back("--end-group");
9834 AddLibGCC(Args, CmdArgs);
9839 TC.AddFastMathRuntimeIfAvailable(Args, CmdArgs);
9841 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend.o")));
9845 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9857 ArgStringList CmdArgs;
9859 CmdArgs.push_back("-o");
9860 CmdArgs.push_back(Output.getFilename());
9862 CmdArgs.push_back("-c");
9865 CmdArgs.push_back("-v");
9869 CmdArgs.push_back("-g");
9873 CmdArgs.push_back("-fverbose-asm");
9875 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
9878 CmdArgs.push_back(II.getFilename());
9881 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9889 ArgStringList CmdArgs;
9892 CmdArgs.push_back("-o");
9893 CmdArgs.push_back(Output.getFilename());
9899 CmdArgs.push_back("-v");
9904 CmdArgs.push_back("-fexceptions");
9906 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
9909 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9920 ArgStringList CmdArgs;
9930 CmdArgs.push_back("--32");
9933 CmdArgs.push_back("--64");
9937 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
9939 CmdArgs.push_back("-o");
9940 CmdArgs.push_back(Output.getFilename());
9943 CmdArgs.push_back(Input.getFilename());
9948 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
9961 ArgStringList CmdArgs;
9973 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
9976 CmdArgs.push_back("-pie");
9978 CmdArgs.push_back("-export-dynamic");
9980 CmdArgs.push_back("--strip-all");
9982 CmdArgs.push_back("-m");
9989 CmdArgs.push_back("thumb2pe");
9992 CmdArgs.push_back("i386pe");
9996 CmdArgs.push_back("i386pep");
10014 CmdArgs.push_back("-shared");
10015 CmdArgs.push_back("-Bdynamic");
10017 CmdArgs.push_back("--enable-auto-image-base");
10019 CmdArgs.push_back("--entry");
10020 CmdArgs.push_back(Args.MakeArgString(EntryPoint));
10024 CmdArgs.push_back(Args.hasArg(options::OPT_static) ? "-Bstatic"
10028 CmdArgs.push_back("--entry");
10029 CmdArgs.push_back(Args.MakeArgString(EntryPoint));
10036 CmdArgs.push_back("--allow-multiple-definition");
10038 CmdArgs.push_back("-o");
10039 CmdArgs.push_back(Output.getFilename());
10045 CmdArgs.push_back("--out-implib");
10046 CmdArgs.push_back(Args.MakeArgString(ImpLib));
10055 CmdArgs.push_back(Args.MakeArgString(CRTPath + CRTBegin));
10058 Args.AddAllArgs(CmdArgs, options::OPT_L);
10059 TC.AddFilePathLibArgs(Args, CmdArgs);
10060 AddLinkerInputs(TC, Inputs, Args, CmdArgs);
10067 CmdArgs.push_back("-Bstatic");
10068 TC.AddCXXStdlibLibArgs(Args, CmdArgs);
10070 CmdArgs.push_back("-Bdynamic");
10076 CmdArgs.push_back("-lmsvcrt");
10077 AddRunTimeLibs(TC, D, CmdArgs, Args);
10084 CmdArgs.push_back(TC.getCompilerRTArgString(Args, "asan_dll_thunk"));
10087 CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib));
10090 CmdArgs.push_back(Args.MakeArgString("--undefined"));
10091 CmdArgs.push_back(Args.MakeArgString(TC.getArch() == llvm::Triple::x86
10099 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
10107 ArgStringList CmdArgs;
10115 CmdArgs.push_back("-E");
10118 CmdArgs.push_back("-S");
10119 CmdArgs.push_back("-fno-exceptions"); // Always do this even if unspecified.
10121 CmdArgs.push_back("-mcpu=myriad2");
10122 CmdArgs.push_back("-DMYRIAD2");
10127 Args.AddAllArgs(CmdArgs, {options::OPT_I_Group, options::OPT_clang_i_Group,
10143 CmdArgs.push_back("-MT");
10144 CmdArgs.push_back(Args.MakeArgString(A->getValue()));
10148 CmdArgs.push_back(II.getFilename());
10149 CmdArgs.push_back("-o");
10150 CmdArgs.push_back(Output.getFilename());
10155 CmdArgs, Inputs));
10163 ArgStringList CmdArgs;
10170 CmdArgs.push_back("-no6thSlotCompression");
10171 CmdArgs.push_back("-cv:myriad2"); // Chip Version
10172 CmdArgs.push_back("-noSPrefixing");
10173 CmdArgs.push_back("-a"); // Mystery option.
10174 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
10177 CmdArgs.push_back(
10180 CmdArgs.push_back("-elf"); // Output format.
10181 CmdArgs.push_back(II.getFilename());
10182 CmdArgs.push_back(
10188 CmdArgs, Inputs));
10199 ArgStringList CmdArgs;
10206 CmdArgs.push_back("-EB");
10208 CmdArgs.push_back("-EL");
10220 CmdArgs.push_back("-s");
10222 CmdArgs.push_back("-o");
10223 CmdArgs.push_back(Output.getFilename());
10228 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crti.o")));
10229 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtbegin.o")));
10232 Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
10236 TC.AddFilePathLibArgs(Args, CmdArgs);
10238 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
10242 CmdArgs.push_back("-lstdc++");
10244 CmdArgs.push_back("--start-group");
10245 CmdArgs.push_back("-lc");
10247 CmdArgs.push_back("-lrtemscpu");
10248 CmdArgs.push_back("-lrtemsbsp");
10249 CmdArgs.push_back("--end-group");
10251 CmdArgs.push_back("-lc");
10253 CmdArgs.push_back("-lgcc");
10256 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend.o")));
10257 CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtn.o")));
10263 CmdArgs, Inputs));
10272 ArgStringList CmdArgs;
10274 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
10276 CmdArgs.push_back("-o");
10277 CmdArgs.push_back(Output.getFilename());
10282 CmdArgs.push_back(Input.getFilename());
10286 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
10289 static void AddPS4SanitizerArgs(const ToolChain &TC, ArgStringList &CmdArgs) {
10292 CmdArgs.push_back("-lSceDbgUBSanitizer_stub_weak");
10295 CmdArgs.push_back("-lSceDbgAddressSanitizer_stub_weak");
10307 ArgStringList CmdArgs;
10318 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
10321 CmdArgs.push_back("-pie");
10324 CmdArgs.push_back("-export-dynamic");
10326 CmdArgs.push_back("--oformat=so");
10329 CmdArgs.push_back("-o");
10330 CmdArgs.push_back(Output.getFilename());
10335 AddPS4SanitizerArgs(ToolChain, CmdArgs);
10337 Args.AddAllArgs(CmdArgs, options::OPT_L);
10338 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
10339 Args.AddAllArgs(CmdArgs, options::OPT_e);
10340 Args.AddAllArgs(CmdArgs, options::OPT_s);
10341 Args.AddAllArgs(CmdArgs, options::OPT_t);
10342 Args.AddAllArgs(CmdArgs, options::OPT_r);
10345 CmdArgs.push_back("--no-demangle");
10347 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
10350 CmdArgs.push_back("-lpthread");
10355 C.addCommand(llvm::make_unique<Command>(JA, T, Exec, CmdArgs, Inputs));
10366 ArgStringList CmdArgs;
10377 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
10380 CmdArgs.push_back("-pie");
10383 CmdArgs.push_back("-Bstatic");
10386 CmdArgs.push_back("-export-dynamic");
10387 CmdArgs.push_back("--eh-frame-hdr");
10389 CmdArgs.push_back("-Bshareable");
10391 CmdArgs.push_back("-dynamic-linker");
10392 CmdArgs.push_back("/libexec/ld-elf.so.1");
10394 CmdArgs.push_back("--enable-new-dtags");
10398 CmdArgs.push_back("-o");
10399 CmdArgs.push_back(Output.getFilename());
10404 AddPS4SanitizerArgs(ToolChain, CmdArgs);
10417 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
10419 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
10429 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
10432 Args.AddAllArgs(CmdArgs, options::OPT_L);
10433 ToolChain.AddFilePathLibArgs(Args, CmdArgs);
10434 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
10435 Args.AddAllArgs(CmdArgs, options::OPT_e);
10436 Args.AddAllArgs(CmdArgs, options::OPT_s);
10437 Args.AddAllArgs(CmdArgs, options::OPT_t);
10438 Args.AddAllArgs(CmdArgs, options::OPT_r);
10441 CmdArgs.push_back("--no-demangle");
10443 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
10448 CmdArgs.push_back("-lkernel");
10450 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
10452 CmdArgs.push_back("-lm_p");
10454 CmdArgs.push_back("-lm");
10459 CmdArgs.push_back("-lgcc_p");
10461 CmdArgs.push_back("-lcompiler_rt");
10463 CmdArgs.push_back("-lstdc++");
10465 CmdArgs.push_back("-lgcc_eh_p");
10467 CmdArgs.push_back("--as-needed");
10468 CmdArgs.push_back("-lstdc++");
10469 CmdArgs.push_back("--no-as-needed");
10474 CmdArgs.push_back("-lpthread_p");
10476 CmdArgs.push_back("-lpthread");
10481 CmdArgs.push_back("-lc");
10484 CmdArgs.push_back("--start-group");
10485 CmdArgs.push_back("-lc_p");
10486 CmdArgs.push_back("-lpthread_p");
10487 CmdArgs.push_back("--end-group");
10489 CmdArgs.push_back("-lc_p");
10492 CmdArgs.push_back("-lgcc_p");
10495 CmdArgs.push_back("--start-group");
10496 CmdArgs.push_back("-lc");
10497 CmdArgs.push_back("-lpthread");
10498 CmdArgs.push_back("--end-group");
10500 CmdArgs.push_back("-lc");
10502 CmdArgs.push_back("-lcompiler_rt");
10506 CmdArgs.push_back("-lstdc++");
10508 CmdArgs.push_back("-lgcc_eh_p");
10510 CmdArgs.push_back("--as-needed");
10511 CmdArgs.push_back("-lstdc++");
10512 CmdArgs.push_back("--no-as-needed");
10518 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtendS.o")));
10520 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
10521 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
10531 C.addCommand(llvm::make_unique<Command>(JA, T, Exec, CmdArgs, Inputs));