Lines Matching full:options
23 #include "clang/Driver/Options.h"
114 if (Arg *A = Args.getLastArg(options::OPT_C, options::OPT_CC)) { in CheckPreprocessingOptions()
115 if (!Args.hasArg(options::OPT_E) && !Args.hasArg(options::OPT__SLASH_P) && in CheckPreprocessingOptions()
116 !Args.hasArg(options::OPT__SLASH_EP) && !D.CCCIsCPP()) { in CheckPreprocessingOptions()
128 if (Args.hasArg(options::OPT_static)) in CheckCodeGenerationOptions()
130 Args.getLastArg(options::OPT_dynamic, options::OPT_mdynamic_no_pic)) in CheckCodeGenerationOptions()
241 Args.AddAllArgValues(CmdArgs, options::OPT_Zlinker_input); in AddLinkerInputs()
257 // Handle reserved library options. in AddLinkerInputs()
258 if (A.getOption().matches(options::OPT_Z_reserved_lib_stdcxx)) in AddLinkerInputs()
260 else if (A.getOption().matches(options::OPT_Z_reserved_lib_cckext)) in AddLinkerInputs()
262 else if (A.getOption().matches(options::OPT_z)) { in AddLinkerInputs()
280 return Args.hasFlag(options::OPT_fobjc_arc, options::OPT_fno_objc_arc, false); in isObjCAutoRefCount()
286 Args.ClaimAllArgs(options::OPT_fobjc_link_runtime); in isObjCRuntimeLinked()
289 return Args.hasArg(options::OPT_fobjc_link_runtime); in isObjCRuntimeLinked()
296 !O.hasFlag(options::DriverOption) && !O.hasFlag(options::LinkerInput); in forwardToGCC()
310 Args.AddLastArg(CmdArgs, options::OPT_C); in AddPreprocessingOptions()
311 Args.AddLastArg(CmdArgs, options::OPT_CC); in AddPreprocessingOptions()
314 if ((A = Args.getLastArg(options::OPT_M, options::OPT_MM)) || in AddPreprocessingOptions()
315 (A = Args.getLastArg(options::OPT_MD)) || in AddPreprocessingOptions()
316 (A = Args.getLastArg(options::OPT_MMD))) { in AddPreprocessingOptions()
319 if (Arg *MF = Args.getLastArg(options::OPT_MF)) { in AddPreprocessingOptions()
324 } else if (A->getOption().matches(options::OPT_M) || in AddPreprocessingOptions()
325 A->getOption().matches(options::OPT_MM)) { in AddPreprocessingOptions()
335 if (!Args.hasArg(options::OPT_MT) && !Args.hasArg(options::OPT_MQ)) { in AddPreprocessingOptions()
340 Arg *OutputOpt = Args.getLastArg(options::OPT_o); in AddPreprocessingOptions()
358 if (A->getOption().matches(options::OPT_M) || in AddPreprocessingOptions()
359 A->getOption().matches(options::OPT_MD)) in AddPreprocessingOptions()
362 !Args.hasArg(options::OPT_fno_module_file_deps)) || in AddPreprocessingOptions()
363 Args.hasArg(options::OPT_fmodule_file_deps)) in AddPreprocessingOptions()
367 if (Args.hasArg(options::OPT_MG)) { in AddPreprocessingOptions()
368 if (!A || A->getOption().matches(options::OPT_MD) || in AddPreprocessingOptions()
369 A->getOption().matches(options::OPT_MMD)) in AddPreprocessingOptions()
374 Args.AddLastArg(CmdArgs, options::OPT_MP); in AddPreprocessingOptions()
375 Args.AddLastArg(CmdArgs, options::OPT_MV); in AddPreprocessingOptions()
378 for (const Arg *A : Args.filtered(options::OPT_MT, options::OPT_MQ)) { in AddPreprocessingOptions()
381 if (A->getOption().matches(options::OPT_MQ)) { in AddPreprocessingOptions()
393 // Add -i* options, and automatically translate to in AddPreprocessingOptions()
401 const Arg *YcArg = Args.getLastArg(options::OPT__SLASH_Yc); in AddPreprocessingOptions()
402 const Arg *YuArg = Args.getLastArg(options::OPT__SLASH_Yu); in AddPreprocessingOptions()
403 for (const Arg *A : Args.filtered(options::OPT_clang_i_Group)) { in AddPreprocessingOptions()
407 if (!A->getOption().matches(options::OPT_include)) in AddPreprocessingOptions()
425 for (const Arg *A : Args.filtered(options::OPT_clang_i_Group)) { in AddPreprocessingOptions()
429 A->getOption().matches(options::OPT_include)) { in AddPreprocessingOptions()
464 } else if (A->getOption().matches(options::OPT_include)) { in AddPreprocessingOptions()
513 } else if (A->getOption().matches(options::OPT_isystem_after)) { in AddPreprocessingOptions()
528 {options::OPT_D, options::OPT_U, options::OPT_I_Group, in AddPreprocessingOptions()
529 options::OPT_F, options::OPT_index_header_map}); in AddPreprocessingOptions()
534 // souls abuse -Wp, to pass preprocessor options in gcc syntax. To in AddPreprocessingOptions()
536 // those options. :( in AddPreprocessingOptions()
537 Args.AddAllArgValues(CmdArgs, options::OPT_Wp_COMMA, in AddPreprocessingOptions()
538 options::OPT_Xpreprocessor); in AddPreprocessingOptions()
541 if (Arg *A = Args.getLastArg(options::OPT_I_)) in AddPreprocessingOptions()
548 if (!Args.hasArg(options::OPT_isysroot)) { in AddPreprocessingOptions()
656 if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) in getARMArchCPUFromArgs()
658 if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) in getARMArchCPUFromArgs()
664 Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) { in getARMArchCPUFromArgs()
751 Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float, in getARMFloatABI()
752 options::OPT_mfloat_abi_EQ)) { in getARMFloatABI()
753 if (A->getOption().matches(options::OPT_msoft_float)) { in getARMFloatABI()
755 } else if (A->getOption().matches(options::OPT_mhard_float)) { in getARMFloatABI()
855 Args.hasArg(options::OPT_mkernel, options::OPT_fapple_kext); in getARMTargetFeatures()
862 // yet (it uses the -mfloat-abi and -msoft-float options), and it is in getARMTargetFeatures()
868 // currently do that for the assembler, we pass the options directly to the in getARMTargetFeatures()
884 Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) { in getARMTargetFeatures()
899 const Arg *ArchArg = Args.getLastArg(options::OPT_march_EQ); in getARMTargetFeatures()
915 const Arg *CPUArg = Args.getLastArg(options::OPT_mcpu_EQ); in getARMTargetFeatures()
938 const Arg *FPUArg = Args.getLastArg(options::OPT_mfpu_EQ); in getARMTargetFeatures()
950 const Arg *HDivArg = Args.getLastArg(options::OPT_mhwdiv_EQ); in getARMTargetFeatures()
969 if (Arg *A = Args.getLastArg(options::OPT_mcrc, options::OPT_mnocrc)) { in getARMTargetFeatures()
970 if (A->getOption().matches(options::OPT_mcrc)) in getARMTargetFeatures()
977 // neither options are specified, see if we are compiling for kernel/kext and in getARMTargetFeatures()
979 if (Arg *A = Args.getLastArg(options::OPT_mlong_calls, in getARMTargetFeatures()
980 options::OPT_mno_long_calls)) { in getARMTargetFeatures()
981 if (A->getOption().matches(options::OPT_mlong_calls)) in getARMTargetFeatures()
991 else if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access, in getARMTargetFeatures()
992 options::OPT_munaligned_access)) { in getARMTargetFeatures()
993 if (A->getOption().matches(options::OPT_munaligned_access)) { in getARMTargetFeatures()
1032 if (Args.hasArg(options::OPT_ffixed_r9)) in getARMTargetFeatures()
1036 if (KernelOrKext || Args.hasArg(options::OPT_mno_movt)) in getARMTargetFeatures()
1046 if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) { in AddARMTargetArgs()
1084 // Determine floating point ABI from the options & target defaults. in AddARMTargetArgs()
1104 if (Arg *A = Args.getLastArg(options::OPT_mglobal_merge, in AddARMTargetArgs()
1105 options::OPT_mno_global_merge)) { in AddARMTargetArgs()
1107 if (A->getOption().matches(options::OPT_mno_global_merge)) in AddARMTargetArgs()
1113 if (!Args.hasFlag(options::OPT_mimplicit_float, in AddARMTargetArgs()
1114 options::OPT_mno_implicit_float, true)) in AddARMTargetArgs()
1125 if ((A = Args.getLastArg(options::OPT_mtune_EQ))) { in getAArch64TargetCPU()
1127 } else if ((A = Args.getLastArg(options::OPT_mcpu_EQ))) { in getAArch64TargetCPU()
1140 if (Args.getLastArg(options::OPT_arch)) in getAArch64TargetCPU()
1151 if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true) || in AddAArch64TargetArgs()
1152 Args.hasArg(options::OPT_mkernel) || in AddAArch64TargetArgs()
1153 Args.hasArg(options::OPT_fapple_kext)) in AddAArch64TargetArgs()
1156 if (!Args.hasFlag(options::OPT_mimplicit_float, in AddAArch64TargetArgs()
1157 options::OPT_mno_implicit_float, true)) in AddAArch64TargetArgs()
1161 if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) in AddAArch64TargetArgs()
1171 if (Arg *A = Args.getLastArg(options::OPT_mfix_cortex_a53_835769, in AddAArch64TargetArgs()
1172 options::OPT_mno_fix_cortex_a53_835769)) { in AddAArch64TargetArgs()
1174 if (A->getOption().matches(options::OPT_mfix_cortex_a53_835769)) in AddAArch64TargetArgs()
1185 if (Arg *A = Args.getLastArg(options::OPT_mglobal_merge, in AddAArch64TargetArgs()
1186 options::OPT_mno_global_merge)) { in AddAArch64TargetArgs()
1188 if (A->getOption().matches(options::OPT_mno_global_merge)) in AddAArch64TargetArgs()
1220 if (Arg *A = Args.getLastArg(options::OPT_march_EQ, options::OPT_mcpu_EQ)) in getMipsCPUAndABI()
1223 if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) { in getMipsCPUAndABI()
1316 Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float, in getMipsFloatABI()
1317 options::OPT_mfloat_abi_EQ)) { in getMipsFloatABI()
1318 if (A->getOption().matches(options::OPT_msoft_float)) in getMipsFloatABI()
1320 else if (A->getOption().matches(options::OPT_mhard_float)) in getMipsFloatABI()
1366 AddTargetFeature(Args, Features, options::OPT_mno_abicalls, in getMIPSTargetFeatures()
1367 options::OPT_mabicalls, "noabicalls"); in getMIPSTargetFeatures()
1377 if (Arg *A = Args.getLastArg(options::OPT_mnan_EQ)) { in getMIPSTargetFeatures()
1398 AddTargetFeature(Args, Features, options::OPT_msingle_float, in getMIPSTargetFeatures()
1399 options::OPT_mdouble_float, "single-float"); in getMIPSTargetFeatures()
1400 AddTargetFeature(Args, Features, options::OPT_mips16, options::OPT_mno_mips16, in getMIPSTargetFeatures()
1402 AddTargetFeature(Args, Features, options::OPT_mmicromips, in getMIPSTargetFeatures()
1403 options::OPT_mno_micromips, "micromips"); in getMIPSTargetFeatures()
1404 AddTargetFeature(Args, Features, options::OPT_mdsp, options::OPT_mno_dsp, in getMIPSTargetFeatures()
1406 AddTargetFeature(Args, Features, options::OPT_mdspr2, options::OPT_mno_dspr2, in getMIPSTargetFeatures()
1408 AddTargetFeature(Args, Features, options::OPT_mmsa, options::OPT_mno_msa, in getMIPSTargetFeatures()
1414 if (Arg *A = Args.getLastArg(options::OPT_mfp32, options::OPT_mfpxx, in getMIPSTargetFeatures()
1415 options::OPT_mfp64)) { in getMIPSTargetFeatures()
1416 if (A->getOption().matches(options::OPT_mfp32)) in getMIPSTargetFeatures()
1418 else if (A->getOption().matches(options::OPT_mfpxx)) { in getMIPSTargetFeatures()
1431 AddTargetFeature(Args, Features, options::OPT_mno_odd_spreg, in getMIPSTargetFeatures()
1432 options::OPT_modd_spreg, "nooddspreg"); in getMIPSTargetFeatures()
1459 if (Arg *A = Args.getLastArg(options::OPT_mxgot, options::OPT_mno_xgot)) { in AddMIPSTargetArgs()
1460 if (A->getOption().matches(options::OPT_mxgot)) { in AddMIPSTargetArgs()
1466 if (Arg *A = Args.getLastArg(options::OPT_mldc1_sdc1, in AddMIPSTargetArgs()
1467 options::OPT_mno_ldc1_sdc1)) { in AddMIPSTargetArgs()
1468 if (A->getOption().matches(options::OPT_mno_ldc1_sdc1)) { in AddMIPSTargetArgs()
1474 if (Arg *A = Args.getLastArg(options::OPT_mcheck_zero_division, in AddMIPSTargetArgs()
1475 options::OPT_mno_check_zero_division)) { in AddMIPSTargetArgs()
1476 if (A->getOption().matches(options::OPT_mno_check_zero_division)) { in AddMIPSTargetArgs()
1482 if (Arg *A = Args.getLastArg(options::OPT_G)) { in AddMIPSTargetArgs()
1489 if (Arg *A = Args.getLastArg(options::OPT_mcompact_branches_EQ)) { in AddMIPSTargetArgs()
1505 if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { in getPPCTargetCPU()
1572 handleTargetFeaturesGroup(Args, Features, options::OPT_m_ppc_Features_Group); in getPPCTargetFeatures()
1586 AddTargetFeature(Args, Features, options::OPT_faltivec, in getPPCTargetFeatures()
1587 options::OPT_fno_altivec, "altivec"); in getPPCTargetFeatures()
1593 Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float, in getPPCFloatABI()
1594 options::OPT_mfloat_abi_EQ)) { in getPPCFloatABI()
1595 if (A->getOption().matches(options::OPT_msoft_float)) in getPPCFloatABI()
1597 else if (A->getOption().matches(options::OPT_mhard_float)) in getPPCFloatABI()
1630 if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) in AddPPCTargetArgs()
1632 HasQPX = Args.hasFlag(options::OPT_mqpx, options::OPT_mno_qpx, HasQPX); in AddPPCTargetArgs()
1648 if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) in AddPPCTargetArgs()
1677 Arg *A = Args.getLastArg(options::OPT_mabi_EQ); in hasPPCAbiArg()
1683 if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { in getR600TargetGPU()
1699 if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { in getLanaiTargetCPU()
1709 Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float, in getSparcFloatABI()
1710 options::OPT_mfloat_abi_EQ)) { in getSparcFloatABI()
1711 if (A->getOption().matches(options::OPT_msoft_float)) in getSparcFloatABI()
1713 else if (A->getOption().matches(options::OPT_mhard_float)) in getSparcFloatABI()
1767 if (Args.hasFlag(options::OPT_mbackchain, options::OPT_mno_backchain, false)) in AddSystemZTargetArgs()
1772 if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) in getSystemZTargetCPU()
1780 if (Arg *A = Args.getLastArg(options::OPT_mhtm, options::OPT_mno_htm)) { in getSystemZTargetFeatures()
1781 if (A->getOption().matches(options::OPT_mhtm)) in getSystemZTargetFeatures()
1787 if (Arg *A = Args.getLastArg(options::OPT_mvx, options::OPT_mno_vx)) { in getSystemZTargetFeatures()
1788 if (A->getOption().matches(options::OPT_mvx)) in getSystemZTargetFeatures()
1797 if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) { in getX86TargetCPU()
1815 if (const Arg *A = Args.getLastArg(options::OPT__SLASH_arch)) { in getX86TargetCPU()
1882 if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { in getWebAssemblyTargetCPU()
1928 if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) in getCPUName()
1953 if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) in getCPUName()
1999 if (Arg *A = Args.getLastArg(options::OPT_O_Group)) { in AddGoldPlugin()
2001 if (A->getOption().matches(options::OPT_O4) || in AddGoldPlugin()
2002 A->getOption().matches(options::OPT_Ofast)) in AddGoldPlugin()
2004 else if (A->getOption().matches(options::OPT_O)) in AddGoldPlugin()
2006 else if (A->getOption().matches(options::OPT_O0)) in AddGoldPlugin()
2016 if (Arg *A = Args.getLastArg(options::OPT_gTune_Group, in AddGoldPlugin()
2017 options::OPT_ggdbN_Group)) { in AddGoldPlugin()
2018 if (A->getOption().matches(options::OPT_glldb)) in AddGoldPlugin()
2020 else if (A->getOption().matches(options::OPT_gsce)) in AddGoldPlugin()
2066 Arg *A = Args.getLastArg(options::OPT_mrecip, options::OPT_mrecip_EQ); in ParseMRecip()
2162 if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) { in getX86TargetFeatures()
2194 if (Arg *A = Args.getLastArg(options::OPT__SLASH_arch)) { in getX86TargetFeatures()
2219 handleTargetFeaturesGroup(Args, Features, options::OPT_m_x86_Features_Group); in getX86TargetFeatures()
2224 if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true) || in AddX86TargetArgs()
2225 Args.hasArg(options::OPT_mkernel) || in AddX86TargetArgs()
2226 Args.hasArg(options::OPT_fapple_kext)) in AddX86TargetArgs()
2231 bool NoImplicitFloat = (Args.hasArg(options::OPT_mkernel) || in AddX86TargetArgs()
2232 Args.hasArg(options::OPT_fapple_kext)); in AddX86TargetArgs()
2234 options::OPT_msoft_float, options::OPT_mno_soft_float, in AddX86TargetArgs()
2235 options::OPT_mimplicit_float, options::OPT_mno_implicit_float)) { in AddX86TargetArgs()
2237 NoImplicitFloat = (O.matches(options::OPT_mno_implicit_float) || in AddX86TargetArgs()
2238 O.matches(options::OPT_msoft_float)); in AddX86TargetArgs()
2243 if (Arg *A = Args.getLastArg(options::OPT_masm_EQ)) { in AddX86TargetArgs()
2255 if (Args.hasFlag(options::OPT_miamcu, options::OPT_mno_iamcu, false)) { in AddX86TargetArgs()
2274 if (!Args.hasArg(options::OPT_fno_short_enums)) in AddHexagonTargetArgs()
2276 if (Args.getLastArg(options::OPT_mieee_rnd_near)) { in AddHexagonTargetArgs()
2286 if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { in AddLanaiTargetArgs()
2292 if (Arg *A = Args.getLastArg(options::OPT_mregparm_EQ)) { in AddLanaiTargetArgs()
2310 if (!Args.hasArg(options::OPT_fvisibility_EQ, in AddWebAssemblyTargetArgs()
2311 options::OPT_fvisibility_ms_compat)) { in AddWebAssemblyTargetArgs()
2446 if ((A = Args.getLastArg(options::OPT_march_EQ))) in getAArch64TargetFeatures()
2448 else if ((A = Args.getLastArg(options::OPT_mcpu_EQ))) in getAArch64TargetFeatures()
2450 else if (Args.hasArg(options::OPT_arch)) in getAArch64TargetFeatures()
2454 if (success && (A = Args.getLastArg(options::OPT_mtune_EQ))) in getAArch64TargetFeatures()
2457 else if (success && (A = Args.getLastArg(options::OPT_mcpu_EQ))) in getAArch64TargetFeatures()
2460 else if (Args.hasArg(options::OPT_arch)) in getAArch64TargetFeatures()
2467 if (Args.getLastArg(options::OPT_mgeneral_regs_only)) { in getAArch64TargetFeatures()
2474 if (Arg *A = Args.getLastArg(options::OPT_mcrc, options::OPT_mnocrc)) { in getAArch64TargetFeatures()
2475 if (A->getOption().matches(options::OPT_mcrc)) in getAArch64TargetFeatures()
2481 if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access, in getAArch64TargetFeatures()
2482 options::OPT_munaligned_access)) in getAArch64TargetFeatures()
2483 if (A->getOption().matches(options::OPT_mno_unaligned_access)) in getAArch64TargetFeatures()
2486 if (Args.hasArg(options::OPT_ffixed_x18)) in getAArch64TargetFeatures()
2499 if (Opt.matches(options::OPT_mhexagon_hvx)) in getHexagonTargetFeatures()
2501 else if (Opt.matches(options::OPT_mno_hexagon_hvx)) in getHexagonTargetFeatures()
2503 else if (Opt.matches(options::OPT_mhexagon_hvx_double)) in getHexagonTargetFeatures()
2505 else if (Opt.matches(options::OPT_mno_hexagon_hvx_double)) in getHexagonTargetFeatures()
2518 handleTargetFeaturesGroup(Args, Features, options::OPT_m_wasm_Features_Group); in getWebAssemblyTargetFeatures()
2523 if (const Arg *dAbi = Args.getLastArg(options::OPT_mamdgpu_debugger_abi)) { in getAMDGPUTargetFeatures()
2535 Args, Features, options::OPT_m_amdgpu_Features_Group); in getAMDGPUTargetFeatures()
2647 Args.ClaimAllArgs(options::OPT_fexceptions); in addExceptionArgs()
2648 Args.ClaimAllArgs(options::OPT_fno_exceptions); in addExceptionArgs()
2649 Args.ClaimAllArgs(options::OPT_fobjc_exceptions); in addExceptionArgs()
2650 Args.ClaimAllArgs(options::OPT_fno_objc_exceptions); in addExceptionArgs()
2651 Args.ClaimAllArgs(options::OPT_fcxx_exceptions); in addExceptionArgs()
2652 Args.ClaimAllArgs(options::OPT_fno_cxx_exceptions); in addExceptionArgs()
2657 bool EH = Args.hasFlag(options::OPT_fexceptions, options::OPT_fno_exceptions, in addExceptionArgs()
2663 Args.hasFlag(options::OPT_fobjc_exceptions, in addExceptionArgs()
2664 options::OPT_fno_objc_exceptions, true)) { in addExceptionArgs()
2675 options::OPT_fcxx_exceptions, options::OPT_fno_cxx_exceptions, in addExceptionArgs()
2676 options::OPT_fexceptions, options::OPT_fno_exceptions); in addExceptionArgs()
2679 ExceptionArg->getOption().matches(options::OPT_fcxx_exceptions) || in addExceptionArgs()
2680 ExceptionArg->getOption().matches(options::OPT_fexceptions); in addExceptionArgs()
2715 return !Args.hasFlag(options::OPT_fautolink, options::OPT_fno_autolink, in ShouldDisableAutolink()
2722 Args.hasFlag(options::OPT_fdwarf_directory_asm, in ShouldDisableDwarfDirectory()
2723 options::OPT_fno_dwarf_directory_asm, TC.useIntegratedAs()); in ShouldDisableDwarfDirectory()
2744 if (Arg *A = Args.getLastArg(options::OPT_O_Group)) in UseRelaxAll()
2745 RelaxDefault = A->getOption().matches(options::OPT_O0); in UseRelaxAll()
2757 return Args.hasFlag(options::OPT_mrelax_all, options::OPT_mno_relax_all, in UseRelaxAll()
2764 assert(A.getOption().matches(options::OPT_gN_Group) && in DebugLevelToInfoKind()
2766 if (A.getOption().matches(options::OPT_g0) || in DebugLevelToInfoKind()
2767 A.getOption().matches(options::OPT_ggdb0)) in DebugLevelToInfoKind()
2769 if (A.getOption().matches(options::OPT_gline_tables_only) || in DebugLevelToInfoKind()
2770 A.getOption().matches(options::OPT_ggdb1)) in DebugLevelToInfoKind()
2833 if (Args.hasFlag(options::OPT_mincremental_linker_compatible, in CollectArgsForIntegratedAssembler()
2834 options::OPT_mno_incremental_linker_compatible, in CollectArgsForIntegratedAssembler()
2846 // options. in CollectArgsForIntegratedAssembler()
2852 Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) { in CollectArgsForIntegratedAssembler()
2938 // "-gdwarf-N" options are not cc1as options. in CollectArgsForIntegratedAssembler()
3005 const Arg *A = Args.getLastArg(options::OPT_fopenmp_EQ); in getOpenMPRuntime()
3029 if (!Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ, in addOpenMPRuntime()
3030 options::OPT_fno_openmp, false)) in addOpenMPRuntime()
3102 if (Args.hasArg(options::OPT_shared) || TC.getTriple().isAndroid()) { in collectSanitizerRuntimes()
3186 if (Args.hasFlag(options::OPT_fxray_instrument, in addXRayRuntime()
3187 options::OPT_fnoxray_instrument, false)) { in addXRayRuntime()
3213 if (Arg *A = Args.getLastArg(options::OPT_O_Group)) in areOptimizationsEnabled()
3214 return !A->getOption().matches(options::OPT_O0); in areOptimizationsEnabled()
3270 if (Arg *A = Args.getLastArg(options::OPT_fno_omit_frame_pointer, in shouldUseFramePointer()
3271 options::OPT_fomit_frame_pointer)) in shouldUseFramePointer()
3272 return A->getOption().matches(options::OPT_fno_omit_frame_pointer); in shouldUseFramePointer()
3273 if (Args.hasArg(options::OPT_pg)) in shouldUseFramePointer()
3281 if (Arg *A = Args.getLastArg(options::OPT_mno_omit_leaf_frame_pointer, in shouldUseLeafFramePointer()
3282 options::OPT_momit_leaf_frame_pointer)) in shouldUseLeafFramePointer()
3283 return A->getOption().matches(options::OPT_mno_omit_leaf_frame_pointer); in shouldUseLeafFramePointer()
3284 if (Args.hasArg(options::OPT_pg)) in shouldUseLeafFramePointer()
3303 Arg *FinalOutput = Args.getLastArg(options::OPT_o); in SplitDebugName()
3304 if (FinalOutput && Args.hasArg(options::OPT_c)) { in SplitDebugName()
3311 Args.getLastArgValue(options::OPT_fdebug_compilation_dir)); in SplitDebugName()
3346 if (Arg *A = Args.getLastArg(options::OPT_O_Group)) { in shouldEnableVectorizerAtOLevel()
3347 if (A->getOption().matches(options::OPT_O4) || in shouldEnableVectorizerAtOLevel()
3348 A->getOption().matches(options::OPT_Ofast)) in shouldEnableVectorizerAtOLevel()
3351 if (A->getOption().matches(options::OPT_O0)) in shouldEnableVectorizerAtOLevel()
3354 assert(A->getOption().matches(options::OPT_O) && "Must have a -O flag"); in shouldEnableVectorizerAtOLevel()
3380 if (Args.hasArg(options::OPT_verify_pch) && Input.getType() == types::TY_PCH) in addDashXForInput()
3384 if (Args.hasArg(options::OPT_rewrite_objc)) in addDashXForInput()
3403 // Claim options we don't want to warn if they are unused. We do this for
3404 // options that build systems might add but are unused when assembling or only
3409 Args.ClaimAllArgs(options::OPT_flto_EQ); in claimNoWarnArgs()
3410 Args.ClaimAllArgs(options::OPT_flto); in claimNoWarnArgs()
3411 Args.ClaimAllArgs(options::OPT_fno_lto); in claimNoWarnArgs()
3450 if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions, in getMSVCVersion()
3452 Args.hasArg(options::OPT_fmsc_version) || in getMSVCVersion()
3453 Args.hasArg(options::OPT_fms_compatibility_version)) { in getMSVCVersion()
3454 const Arg *MSCVersion = Args.getLastArg(options::OPT_fmsc_version); in getMSVCVersion()
3456 Args.getLastArg(options::OPT_fms_compatibility_version); in getMSVCVersion()
3504 options::OPT_fprofile_instr_generate, in addPGOAndCoverageFlags()
3505 options::OPT_fprofile_instr_generate_EQ, options::OPT_fprofile_generate, in addPGOAndCoverageFlags()
3506 options::OPT_fprofile_generate_EQ, in addPGOAndCoverageFlags()
3507 options::OPT_fno_profile_instr_generate); in addPGOAndCoverageFlags()
3510 options::OPT_fno_profile_instr_generate)) in addPGOAndCoverageFlags()
3514 options::OPT_fprofile_instr_use, options::OPT_fprofile_instr_use_EQ, in addPGOAndCoverageFlags()
3515 options::OPT_fprofile_use, options::OPT_fprofile_use_EQ, in addPGOAndCoverageFlags()
3516 options::OPT_fno_profile_instr_use); in addPGOAndCoverageFlags()
3518 ProfileUseArg->getOption().matches(options::OPT_fno_profile_instr_use)) in addPGOAndCoverageFlags()
3527 options::OPT_fprofile_instr_generate_EQ)) in addPGOAndCoverageFlags()
3531 options::OPT_fprofile_generate_EQ)) { in addPGOAndCoverageFlags()
3542 if (ProfileUseArg->getOption().matches(options::OPT_fprofile_instr_use_EQ)) in addPGOAndCoverageFlags()
3546 options::OPT_fprofile_use_EQ) || in addPGOAndCoverageFlags()
3548 options::OPT_fprofile_instr_use))) { in addPGOAndCoverageFlags()
3558 if (Args.hasArg(options::OPT_ftest_coverage) || in addPGOAndCoverageFlags()
3559 Args.hasArg(options::OPT_coverage)) in addPGOAndCoverageFlags()
3561 if (Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs, in addPGOAndCoverageFlags()
3563 Args.hasArg(options::OPT_coverage)) in addPGOAndCoverageFlags()
3566 if (Args.hasFlag(options::OPT_fcoverage_mapping, in addPGOAndCoverageFlags()
3567 options::OPT_fno_coverage_mapping, false) && in addPGOAndCoverageFlags()
3573 if (Args.hasFlag(options::OPT_fcoverage_mapping, in addPGOAndCoverageFlags()
3574 options::OPT_fno_coverage_mapping, false)) in addPGOAndCoverageFlags()
3577 if (C.getArgs().hasArg(options::OPT_c) || in addPGOAndCoverageFlags()
3578 C.getArgs().hasArg(options::OPT_S)) { in addPGOAndCoverageFlags()
3582 if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o)) { in addPGOAndCoverageFlags()
3601 if ((Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs, in addPS4ProfileRTArgs()
3603 Args.hasFlag(options::OPT_fprofile_generate, in addPS4ProfileRTArgs()
3604 options::OPT_fno_profile_instr_generate, false) || in addPS4ProfileRTArgs()
3605 Args.hasFlag(options::OPT_fprofile_generate_EQ, in addPS4ProfileRTArgs()
3606 options::OPT_fno_profile_instr_generate, false) || in addPS4ProfileRTArgs()
3607 Args.hasFlag(options::OPT_fprofile_instr_generate, in addPS4ProfileRTArgs()
3608 options::OPT_fno_profile_instr_generate, false) || in addPS4ProfileRTArgs()
3609 Args.hasFlag(options::OPT_fprofile_instr_generate_EQ, in addPS4ProfileRTArgs()
3610 options::OPT_fno_profile_instr_generate, false) || in addPS4ProfileRTArgs()
3611 Args.hasArg(options::OPT_fcreate_profile) || in addPS4ProfileRTArgs()
3612 Args.hasArg(options::OPT_coverage))) in addPS4ProfileRTArgs()
3629 Args.hasArg(options::OPT_static)) in ParsePICArgs()
3634 Args.hasArg(options::OPT_mkernel, options::OPT_fapple_kext); in ParsePICArgs()
3688 Arg *LastPICArg = Args.getLastArg(options::OPT_fPIC, options::OPT_fno_PIC, in ParsePICArgs()
3689 options::OPT_fpic, options::OPT_fno_pic, in ParsePICArgs()
3690 options::OPT_fPIE, options::OPT_fno_PIE, in ParsePICArgs()
3691 options::OPT_fpie, options::OPT_fno_pie); in ParsePICArgs()
3697 if (O.matches(options::OPT_fPIC) || O.matches(options::OPT_fpic) || in ParsePICArgs()
3698 O.matches(options::OPT_fPIE) || O.matches(options::OPT_fpie)) { in ParsePICArgs()
3699 PIE = O.matches(options::OPT_fPIE) || O.matches(options::OPT_fpie); in ParsePICArgs()
3701 PIE || O.matches(options::OPT_fPIC) || O.matches(options::OPT_fpic); in ParsePICArgs()
3703 O.matches(options::OPT_fPIE) || O.matches(options::OPT_fPIC); in ParsePICArgs()
3707 Arg *ModelArg = Args.getLastArg(options::OPT_mcmodel_EQ); in ParsePICArgs()
3731 if (Arg *A = Args.getLastArg(options::OPT_mdynamic_no_pic)) { in ParsePICArgs()
3785 Args.hasArg(options::OPT_mkernel, options::OPT_fapple_kext); in ConstructJob()
3846 // the given target. These come before user provided warning options in ConstructJob()
3863 if (Args.hasArg(options::OPT_rewrite_objc) && in ConstructJob()
3864 !Args.hasArg(options::OPT_g_Group)) in ConstructJob()
3873 (void)Args.hasArg(options::OPT_force__cpusubtype__ALL); in ConstructJob()
3921 Args.AddLastArg(CmdArgs, options::OPT_flto, options::OPT_flto_EQ); in ConstructJob()
3924 if (const Arg *A = Args.getLastArg(options::OPT_fthinlto_index_EQ)) { in ConstructJob()
3928 Args.AddLastArg(CmdArgs, options::OPT_fthinlto_index_EQ); in ConstructJob()
3935 Args.AddLastArg(CmdArgs, options::OPT_fembed_bitcode_EQ); in ConstructJob()
3962 if (Args.hasArg(options::OPT_static)) in ConstructJob()
3975 if (!Args.hasArg(options::OPT__analyzer_no_default_checks)) { in ConstructJob()
4023 if (Arg *A = Args.getLastArg(options::OPT__analyzer_output)) in ConstructJob()
4034 Args.AddAllArgValues(CmdArgs, options::OPT_Xanalyzer); in ConstructJob()
4057 if (Arg *A = Args.getLastArg(options::OPT_meabi)) { in ConstructJob()
4063 if (Arg *A = Args.getLastArg(options::OPT_mthread_model)) in ConstructJob()
4068 Args.AddLastArg(CmdArgs, options::OPT_fveclib); in ConstructJob()
4070 if (!Args.hasFlag(options::OPT_fmerge_all_constants, in ConstructJob()
4071 options::OPT_fno_merge_all_constants)) in ConstructJob()
4074 // LLVM Code Generator Options. in ConstructJob()
4076 if (Args.hasArg(options::OPT_frewrite_map_file) || in ConstructJob()
4077 Args.hasArg(options::OPT_frewrite_map_file_EQ)) { in ConstructJob()
4078 for (const Arg *A : Args.filtered(options::OPT_frewrite_map_file, in ConstructJob()
4079 options::OPT_frewrite_map_file_EQ)) { in ConstructJob()
4086 if (Arg *A = Args.getLastArg(options::OPT_Wframe_larger_than_EQ)) { in ConstructJob()
4093 if (!Args.hasFlag(options::OPT_fjump_tables, options::OPT_fno_jump_tables, in ConstructJob()
4097 if (Arg *A = Args.getLastArg(options::OPT_mregparm_EQ)) { in ConstructJob()
4102 if (Arg *A = Args.getLastArg(options::OPT_fpcc_struct_return, in ConstructJob()
4103 options::OPT_freg_struct_return)) { in ConstructJob()
4107 } else if (A->getOption().matches(options::OPT_fpcc_struct_return)) { in ConstructJob()
4110 assert(A->getOption().matches(options::OPT_freg_struct_return)); in ConstructJob()
4115 if (Args.hasFlag(options::OPT_mrtd, options::OPT_mno_rtd, false)) in ConstructJob()
4120 if (!Args.hasFlag(options::OPT_fzero_initialized_in_bss, in ConstructJob()
4121 options::OPT_fno_zero_initialized_in_bss)) in ConstructJob()
4128 OFastEnabled ? options::OPT_Ofast : options::OPT_fstrict_aliasing; in ConstructJob()
4132 if (!Args.hasFlag(options::OPT_fstrict_aliasing, StrictAliasingAliasOption, in ConstructJob()
4133 options::OPT_fno_strict_aliasing, TBAAOnByDefault)) in ConstructJob()
4135 if (!Args.hasFlag(options::OPT_fstruct_path_tbaa, in ConstructJob()
4136 options::OPT_fno_struct_path_tbaa)) in ConstructJob()
4138 if (Args.hasFlag(options::OPT_fstrict_enums, options::OPT_fno_strict_enums, in ConstructJob()
4141 if (Args.hasFlag(options::OPT_fstrict_vtable_pointers, in ConstructJob()
4142 options::OPT_fno_strict_vtable_pointers, in ConstructJob()
4145 if (!Args.hasFlag(options::OPT_foptimize_sibling_calls, in ConstructJob()
4146 options::OPT_fno_optimize_sibling_calls)) in ConstructJob()
4150 if (Args.hasArg(options::OPT_fsplit_stack)) in ConstructJob()
4156 OFastEnabled ? options::OPT_Ofast : options::OPT_ffast_math; in ConstructJob()
4164 options::OPT_ffast_math, FastMathAliasOption, in ConstructJob()
4165 options::OPT_fno_fast_math, options::OPT_ffinite_math_only, in ConstructJob()
4166 options::OPT_fno_finite_math_only, options::OPT_fhonor_infinities, in ConstructJob()
4167 options::OPT_fno_honor_infinities)) in ConstructJob()
4168 if (A->getOption().getID() != options::OPT_fno_fast_math && in ConstructJob()
4169 A->getOption().getID() != options::OPT_fno_finite_math_only && in ConstructJob()
4170 A->getOption().getID() != options::OPT_fhonor_infinities) in ConstructJob()
4173 options::OPT_ffast_math, FastMathAliasOption, in ConstructJob()
4174 options::OPT_fno_fast_math, options::OPT_ffinite_math_only, in ConstructJob()
4175 options::OPT_fno_finite_math_only, options::OPT_fhonor_nans, in ConstructJob()
4176 options::OPT_fno_honor_nans)) in ConstructJob()
4177 if (A->getOption().getID() != options::OPT_fno_fast_math && in ConstructJob()
4178 A->getOption().getID() != options::OPT_fno_finite_math_only && in ConstructJob()
4179 A->getOption().getID() != options::OPT_fhonor_nans) in ConstructJob()
4185 Args.getLastArg(options::OPT_ffast_math, FastMathAliasOption, in ConstructJob()
4186 options::OPT_fno_fast_math, options::OPT_fmath_errno, in ConstructJob()
4187 options::OPT_fno_math_errno)) { in ConstructJob()
4191 if (A->getOption().getID() == options::OPT_fno_math_errno || in ConstructJob()
4192 A->getOption().getID() == options::OPT_ffast_math || in ConstructJob()
4193 A->getOption().getID() == options::OPT_Ofast) in ConstructJob()
4195 else if (A->getOption().getID() == options::OPT_fmath_errno) in ConstructJob()
4207 options::OPT_ffast_math, FastMathAliasOption, in ConstructJob()
4208 options::OPT_fno_fast_math, options::OPT_funsafe_math_optimizations, in ConstructJob()
4209 options::OPT_fno_unsafe_math_optimizations, in ConstructJob()
4210 options::OPT_fassociative_math, options::OPT_fno_associative_math)) in ConstructJob()
4211 if (A->getOption().getID() != options::OPT_fno_fast_math && in ConstructJob()
4212 A->getOption().getID() != options::OPT_fno_unsafe_math_optimizations && in ConstructJob()
4213 A->getOption().getID() != options::OPT_fno_associative_math) in ConstructJob()
4217 options::OPT_ffast_math, FastMathAliasOption, in ConstructJob()
4218 options::OPT_fno_fast_math, options::OPT_funsafe_math_optimizations, in ConstructJob()
4219 options::OPT_fno_unsafe_math_optimizations, in ConstructJob()
4220 options::OPT_freciprocal_math, options::OPT_fno_reciprocal_math)) in ConstructJob()
4221 if (A->getOption().getID() != options::OPT_fno_fast_math && in ConstructJob()
4222 A->getOption().getID() != options::OPT_fno_unsafe_math_optimizations && in ConstructJob()
4223 A->getOption().getID() != options::OPT_fno_reciprocal_math) in ConstructJob()
4227 options::OPT_ffast_math, FastMathAliasOption, in ConstructJob()
4228 options::OPT_fno_fast_math, options::OPT_funsafe_math_optimizations, in ConstructJob()
4229 options::OPT_fno_unsafe_math_optimizations, in ConstructJob()
4230 options::OPT_fsigned_zeros, options::OPT_fno_signed_zeros)) in ConstructJob()
4231 if (A->getOption().getID() != options::OPT_fno_fast_math && in ConstructJob()
4232 A->getOption().getID() != options::OPT_fno_unsafe_math_optimizations && in ConstructJob()
4233 A->getOption().getID() != options::OPT_fsigned_zeros) in ConstructJob()
4237 options::OPT_ffast_math, FastMathAliasOption, in ConstructJob()
4238 options::OPT_fno_fast_math, options::OPT_funsafe_math_optimizations, in ConstructJob()
4239 options::OPT_fno_unsafe_math_optimizations, in ConstructJob()
4240 options::OPT_ftrapping_math, options::OPT_fno_trapping_math)) in ConstructJob()
4241 if (A->getOption().getID() != options::OPT_fno_fast_math && in ConstructJob()
4242 A->getOption().getID() != options::OPT_fno_unsafe_math_optimizations && in ConstructJob()
4243 A->getOption().getID() != options::OPT_ftrapping_math) in ConstructJob()
4256 if (Arg *A = Args.getLastArg(options::OPT_ffast_math, FastMathAliasOption, in ConstructJob()
4257 options::OPT_fno_fast_math, in ConstructJob()
4258 options::OPT_ffp_contract)) { in ConstructJob()
4259 if (A->getOption().getID() == options::OPT_ffp_contract) { in ConstructJob()
4267 } else if (A->getOption().matches(options::OPT_ffast_math) || in ConstructJob()
4268 (OFastEnabled && A->getOption().matches(options::OPT_Ofast))) { in ConstructJob()
4279 // these options induce language changes which must survive serialization in ConstructJob()
4281 if (Arg *A = Args.getLastArg(options::OPT_ffast_math, FastMathAliasOption, in ConstructJob()
4282 options::OPT_fno_fast_math)) in ConstructJob()
4283 if (!A->getOption().matches(options::OPT_fno_fast_math)) in ConstructJob()
4285 if (Arg *A = Args.getLastArg(options::OPT_ffinite_math_only, in ConstructJob()
4286 options::OPT_fno_fast_math)) in ConstructJob()
4287 if (A->getOption().matches(options::OPT_ffinite_math_only)) in ConstructJob()
4294 if (Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm, in ConstructJob()
4296 Args.hasArg(options::OPT_dA)) in ConstructJob()
4299 if (!Args.hasFlag(options::OPT_fintegrated_as, options::OPT_fno_integrated_as, in ConstructJob()
4303 if (Args.hasArg(options::OPT_fdebug_pass_structure)) { in ConstructJob()
4307 if (Args.hasArg(options::OPT_fdebug_pass_arguments)) { in ConstructJob()
4324 if (Args.hasFlag(options::OPT_mms_bitfields, options::OPT_mno_ms_bitfields, in ConstructJob()
4333 Args.hasFlag(options::OPT_fasynchronous_unwind_tables, in ConstructJob()
4334 options::OPT_fno_asynchronous_unwind_tables, in ConstructJob()
4338 if (Args.hasFlag(options::OPT_funwind_tables, options::OPT_fno_unwind_tables, in ConstructJob()
4344 if (Arg *A = Args.getLastArg(options::OPT_flimited_precision_EQ)) { in ConstructJob()
4350 (void)Args.hasArg(options::OPT_mtune_EQ); in ConstructJob()
4352 if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) { in ConstructJob()
4364 if (const Arg *A = Args.getLastArg(options::OPT_mfpmath_EQ)) { in ConstructJob()
4432 // The 'g' groups options involve a somewhat intricate sequence of decisions in ConstructJob()
4453 if (Arg *A = Args.getLastArg(options::OPT_mlinker_version_EQ)) { in ConstructJob()
4463 if (!Args.hasArg(options::OPT_fallow_unsupported)) { in ConstructJob()
4467 if ((Unsupported = Args.getLastArg(options::OPT_fapple_kext)) || in ConstructJob()
4468 (Unsupported = Args.getLastArg(options::OPT_mkernel))) in ConstructJob()
4474 Args.AddAllArgs(CmdArgs, options::OPT_v); in ConstructJob()
4475 Args.AddLastArg(CmdArgs, options::OPT_H); in ConstructJob()
4481 Args.AddLastArg(CmdArgs, options::OPT_P); in ConstructJob()
4482 Args.AddLastArg(CmdArgs, options::OPT_print_ivar_layout); in ConstructJob()
4490 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
4491 Arg *SplitDwarfArg = Args.getLastArg(options::OPT_gsplit_dwarf); in ConstructJob()
4492 if (Arg *A = Args.getLastArg(options::OPT_g_Group)) { in ConstructJob()
4494 if (A->getOption().matches(options::OPT_gN_Group)) { in ConstructJob()
4508 if (Arg *A = Args.getLastArg(options::OPT_gTune_Group, in ConstructJob()
4509 options::OPT_ggdbN_Group)) { in ConstructJob()
4510 if (A->getOption().matches(options::OPT_glldb)) in ConstructJob()
4512 else if (A->getOption().matches(options::OPT_gsce)) in ConstructJob()
4519 if (Arg *A = Args.getLastArg(options::OPT_gdwarf_2, options::OPT_gdwarf_3, in ConstructJob()
4520 options::OPT_gdwarf_4, options::OPT_gdwarf_5)) in ConstructJob()
4525 if (Args.hasArg(options::OPT_gcodeview) || EmitCodeView) { in ConstructJob()
4534 Args.ClaimAllArgs(options::OPT_g_flags_Group); in ConstructJob()
4537 if (Args.hasFlag(options::OPT_gcolumn_info, options::OPT_gno_column_info, in ConstructJob()
4541 // FIXME: Move backend command line options to the module. in ConstructJob()
4542 if (Args.hasArg(options::OPT_gmodules)) { in ConstructJob()
4560 // We parse these two '-f' options whether or not they will be used, in ConstructJob()
4562 bool NeedFullDebug = Args.hasFlag(options::OPT_fstandalone_debug, in ConstructJob()
4563 options::OPT_fno_standalone_debug, in ConstructJob()
4571 if (Args.hasArg(options::OPT_ggnu_pubnames)) { in ConstructJob()
4579 if (Args.hasArg(options::OPT_gdwarf_aranges) || IsPS4CPU) { in ConstructJob()
4584 if (Args.hasFlag(options::OPT_fdebug_types_section, in ConstructJob()
4585 options::OPT_fno_debug_types_section, false)) { in ConstructJob()
4596 if (Args.hasFlag(options::OPT_ffunction_sections, in ConstructJob()
4597 options::OPT_fno_function_sections, UseSeparateSections)) { in ConstructJob()
4601 if (Args.hasFlag(options::OPT_fdata_sections, options::OPT_fno_data_sections, in ConstructJob()
4606 if (!Args.hasFlag(options::OPT_funique_section_names, in ConstructJob()
4607 options::OPT_fno_unique_section_names, true)) in ConstructJob()
4610 Args.AddAllArgs(CmdArgs, options::OPT_finstrument_functions); in ConstructJob()
4612 if (Args.hasFlag(options::OPT_fxray_instrument, in ConstructJob()
4613 options::OPT_fnoxray_instrument, false)) { in ConstructJob()
4615 if (Arg *A = Args.getLastArg(options::OPT_fxray_instruction_threshold_, in ConstructJob()
4616 options::OPT_fxray_instruction_threshold_EQ)) { in ConstructJob()
4622 if (Args.hasFlag(options::OPT_fxray_instrument, in ConstructJob()
4623 options::OPT_fnoxray_instrument, false)) { in ConstructJob()
4626 Args.getLastArg(options::OPT_fxray_instruction_threshold_, in ConstructJob()
4627 options::OPT_fxray_instruction_threshold_EQ)) { in ConstructJob()
4639 // Pass options for controlling the default header search paths. in ConstructJob()
4640 if (Args.hasArg(options::OPT_nostdinc)) { in ConstructJob()
4644 if (Args.hasArg(options::OPT_nostdlibinc)) in ConstructJob()
4646 Args.AddLastArg(CmdArgs, options::OPT_nostdincxx); in ConstructJob()
4647 Args.AddLastArg(CmdArgs, options::OPT_nobuiltininc); in ConstructJob()
4654 Args.AddLastArg(CmdArgs, options::OPT_working_directory); in ConstructJob()
4657 if (!Args.hasArg(options::OPT_fno_objc_arc, options::OPT_fobjc_arc)) { in ConstructJob()
4658 if (const Arg *A = Args.getLastArg(options::OPT_ccc_arcmt_check, in ConstructJob()
4659 options::OPT_ccc_arcmt_modify, in ConstructJob()
4660 options::OPT_ccc_arcmt_migrate)) { in ConstructJob()
4665 case options::OPT_ccc_arcmt_check: in ConstructJob()
4668 case options::OPT_ccc_arcmt_modify: in ConstructJob()
4671 case options::OPT_ccc_arcmt_migrate: in ConstructJob()
4676 Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_report_output); in ConstructJob()
4677 Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_emit_arc_errors); in ConstructJob()
4682 Args.ClaimAllArgs(options::OPT_ccc_arcmt_check); in ConstructJob()
4683 Args.ClaimAllArgs(options::OPT_ccc_arcmt_modify); in ConstructJob()
4684 Args.ClaimAllArgs(options::OPT_ccc_arcmt_migrate); in ConstructJob()
4687 if (const Arg *A = Args.getLastArg(options::OPT_ccc_objcmt_migrate)) { in ConstructJob()
4695 if (!Args.hasArg(options::OPT_objcmt_migrate_literals, in ConstructJob()
4696 options::OPT_objcmt_migrate_subscripting, in ConstructJob()
4697 options::OPT_objcmt_migrate_property)) { in ConstructJob()
4703 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_literals); in ConstructJob()
4704 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_subscripting); in ConstructJob()
4705 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property); in ConstructJob()
4708 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_literals); in ConstructJob()
4709 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_subscripting); in ConstructJob()
4710 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property); in ConstructJob()
4711 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_all); in ConstructJob()
4712 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readonly_property); in ConstructJob()
4713 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readwrite_property); in ConstructJob()
4714 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property_dot_syntax); in ConstructJob()
4715 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_annotation); in ConstructJob()
4716 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_instancetype); in ConstructJob()
4717 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_nsmacros); in ConstructJob()
4718 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_protocol_conformance); in ConstructJob()
4719 Args.AddLastArg(CmdArgs, options::OPT_objcmt_atomic_property); in ConstructJob()
4720 Args.AddLastArg(CmdArgs, options::OPT_objcmt_returns_innerpointer_property); in ConstructJob()
4721 Args.AddLastArg(CmdArgs, options::OPT_objcmt_ns_nonatomic_iosonly); in ConstructJob()
4722 Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_designated_init); in ConstructJob()
4723 Args.AddLastArg(CmdArgs, options::OPT_objcmt_whitelist_dir_path); in ConstructJob()
4726 // Add preprocessing options like -I, -D, etc. if we are using the in ConstructJob()
4736 // When building with ccache, it will pass -D options to clang even on in ConstructJob()
4738 Args.ClaimAllArgs(options::OPT_D); in ConstructJob()
4741 if (Arg *A = Args.getLastArg(options::OPT_O_Group)) { in ConstructJob()
4742 if (A->getOption().matches(options::OPT_O4)) { in ConstructJob()
4750 // Warn about ignored options to clang. in ConstructJob()
4752 Args.filtered(options::OPT_clang_ignored_gcc_optimization_f_Group)) { in ConstructJob()
4759 Args.AddAllArgs(CmdArgs, options::OPT_R_Group); in ConstructJob()
4760 Args.AddAllArgs(CmdArgs, options::OPT_W_Group); in ConstructJob()
4761 if (Args.hasFlag(options::OPT_pedantic, options::OPT_no_pedantic, false)) in ConstructJob()
4763 Args.AddLastArg(CmdArgs, options::OPT_pedantic_errors); in ConstructJob()
4764 Args.AddLastArg(CmdArgs, options::OPT_w); in ConstructJob()
4772 if (Arg *Std = Args.getLastArg(options::OPT_std_EQ, options::OPT_ansi)) { in ConstructJob()
4773 if (Std->getOption().matches(options::OPT_ansi)) in ConstructJob()
4782 if (Arg *A = Args.getLastArg(options::OPT_std_EQ, options::OPT_ansi, in ConstructJob()
4783 options::OPT_ftrigraphs, in ConstructJob()
4784 options::OPT_fno_trigraphs)) in ConstructJob()
4795 Args.AddAllArgsTranslated(CmdArgs, options::OPT_std_default_EQ, "-std=", in ConstructJob()
4800 Args.AddLastArg(CmdArgs, options::OPT_ftrigraphs, in ConstructJob()
4801 options::OPT_fno_trigraphs); in ConstructJob()
4817 Args.getLastArg(options::OPT_Wwrite_strings, in ConstructJob()
4818 options::OPT_Wno_write_strings, options::OPT_w); in ConstructJob()
4820 WriteStrings->getOption().matches(options::OPT_Wwrite_strings)) in ConstructJob()
4828 Args.hasFlag(options::OPT_Wdeprecated, options::OPT_Wno_deprecated, in ConstructJob()
4834 if (Arg *Asm = Args.getLastArg(options::OPT_fasm, options::OPT_fno_asm)) { in ConstructJob()
4835 if (Asm->getOption().matches(options::OPT_fasm)) in ConstructJob()
4850 for (const Arg *A : Args.filtered(options::OPT_fdebug_prefix_map_EQ)) { in ConstructJob()
4859 if (Arg *A = Args.getLastArg(options::OPT_ftemplate_depth_, in ConstructJob()
4860 options::OPT_ftemplate_depth_EQ)) { in ConstructJob()
4865 if (Arg *A = Args.getLastArg(options::OPT_foperator_arrow_depth_EQ)) { in ConstructJob()
4870 if (Arg *A = Args.getLastArg(options::OPT_fconstexpr_depth_EQ)) { in ConstructJob()
4875 if (Arg *A = Args.getLastArg(options::OPT_fconstexpr_steps_EQ)) { in ConstructJob()
4880 if (Arg *A = Args.getLastArg(options::OPT_fbracket_depth_EQ)) { in ConstructJob()
4885 if (Arg *A = Args.getLastArg(options::OPT_Wlarge_by_value_copy_EQ, in ConstructJob()
4886 options::OPT_Wlarge_by_value_copy_def)) { in ConstructJob()
4894 if (Args.hasArg(options::OPT_relocatable_pch)) in ConstructJob()
4897 if (Arg *A = Args.getLastArg(options::OPT_fconstant_string_class_EQ)) { in ConstructJob()
4902 if (Arg *A = Args.getLastArg(options::OPT_ftabstop_EQ)) { in ConstructJob()
4908 if (Arg *A = Args.getLastArg(options::OPT_ferror_limit_EQ)) in ConstructJob()
4913 if (Arg *A = Args.getLastArg(options::OPT_fmacro_backtrace_limit_EQ)) { in ConstructJob()
4918 if (Arg *A = Args.getLastArg(options::OPT_ftemplate_backtrace_limit_EQ)) { in ConstructJob()
4923 if (Arg *A = Args.getLastArg(options::OPT_fconstexpr_backtrace_limit_EQ)) { in ConstructJob()
4928 if (Arg *A = Args.getLastArg(options::OPT_fspell_checking_limit_EQ)) { in ConstructJob()
4935 if (Arg *A = Args.getLastArg(options::OPT_fmessage_length_EQ)) { in ConstructJob()
4945 if (const Arg *A = Args.getLastArg(options::OPT_fvisibility_EQ, in ConstructJob()
4946 options::OPT_fvisibility_ms_compat)) { in ConstructJob()
4947 if (A->getOption().matches(options::OPT_fvisibility_EQ)) { in ConstructJob()
4951 assert(A->getOption().matches(options::OPT_fvisibility_ms_compat)); in ConstructJob()
4959 Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden); in ConstructJob()
4961 Args.AddLastArg(CmdArgs, options::OPT_ftlsmodel_EQ); in ConstructJob()
4964 if (Args.hasFlag(options::OPT_ffreestanding, options::OPT_fhosted, false) || in ConstructJob()
4968 // Forward -f (flag) options which we can pass directly. in ConstructJob()
4969 Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls); in ConstructJob()
4970 Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions); in ConstructJob()
4971 Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names); in ConstructJob()
4975 if (Args.hasFlag(options::OPT_femulated_tls, options::OPT_fno_emulated_tls, in ConstructJob()
4980 Args.AddLastArg(CmdArgs, options::OPT_faltivec); in ConstructJob()
4981 Args.AddLastArg(CmdArgs, options::OPT_fzvector); in ConstructJob()
4983 Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_show_template_tree); in ConstructJob()
4984 Args.AddLastArg(CmdArgs, options::OPT_fno_elide_type); in ConstructJob()
4987 if (Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ, in ConstructJob()
4988 options::OPT_fno_openmp, false)) { in ConstructJob()
4997 // options and pass the right information to the frontend. in ConstructJob()
4998 if (!Args.hasFlag(options::OPT_fopenmp_use_tls, in ConstructJob()
4999 options::OPT_fnoopenmp_use_tls, /*Default=*/true)) in ConstructJob()
5001 Args.AddAllArgs(CmdArgs, options::OPT_fopenmp_version_EQ); in ConstructJob()
5018 if (const Arg *A = Args.getLastArg(options::OPT_faltivec)) { in ConstructJob()
5027 if (Arg *A = Args.getLastArg(options::OPT_fzvector)) in ConstructJob()
5028 if (Args.hasArg(options::OPT_faltivec)) in ConstructJob()
5033 Args.AddLastArg(CmdArgs, options::OPT_pg); in ConstructJob()
5036 if (!Args.hasFlag(options::OPT_flax_vector_conversions, in ConstructJob()
5037 options::OPT_fno_lax_vector_conversions)) in ConstructJob()
5040 if (Args.getLastArg(options::OPT_fapple_kext) || in ConstructJob()
5041 (Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType))) in ConstructJob()
5044 Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch); in ConstructJob()
5045 Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info); in ConstructJob()
5046 Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_parseable_fixits); in ConstructJob()
5047 Args.AddLastArg(CmdArgs, options::OPT_ftime_report); in ConstructJob()
5048 Args.AddLastArg(CmdArgs, options::OPT_ftrapv); in ConstructJob()
5050 if (Arg *A = Args.getLastArg(options::OPT_ftrapv_handler_EQ)) { in ConstructJob()
5055 Args.AddLastArg(CmdArgs, options::OPT_ftrap_function_EQ); in ConstructJob()
5059 if (Arg *A = Args.getLastArg(options::OPT_fwrapv, options::OPT_fno_wrapv)) { in ConstructJob()
5060 if (A->getOption().matches(options::OPT_fwrapv)) in ConstructJob()
5062 } else if (Arg *A = Args.getLastArg(options::OPT_fstrict_overflow, in ConstructJob()
5063 options::OPT_fno_strict_overflow)) { in ConstructJob()
5064 if (A->getOption().matches(options::OPT_fno_strict_overflow)) in ConstructJob()
5068 if (Arg *A = Args.getLastArg(options::OPT_freroll_loops, in ConstructJob()
5069 options::OPT_fno_reroll_loops)) in ConstructJob()
5070 if (A->getOption().matches(options::OPT_freroll_loops)) in ConstructJob()
5073 Args.AddLastArg(CmdArgs, options::OPT_fwritable_strings); in ConstructJob()
5074 Args.AddLastArg(CmdArgs, options::OPT_funroll_loops, in ConstructJob()
5075 options::OPT_fno_unroll_loops); in ConstructJob()
5077 Args.AddLastArg(CmdArgs, options::OPT_pthread); in ConstructJob()
5081 if (Arg *A = Args.getLastArg(options::OPT_fno_stack_protector, in ConstructJob()
5082 options::OPT_fstack_protector_all, in ConstructJob()
5083 options::OPT_fstack_protector_strong, in ConstructJob()
5084 options::OPT_fstack_protector)) { in ConstructJob()
5085 if (A->getOption().matches(options::OPT_fstack_protector)) { in ConstructJob()
5089 } else if (A->getOption().matches(options::OPT_fstack_protector_strong)) in ConstructJob()
5091 else if (A->getOption().matches(options::OPT_fstack_protector_all)) in ConstructJob()
5103 for (const Arg *A : Args.filtered(options::OPT__param)) { in ConstructJob()
5116 if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign, in ConstructJob()
5120 if (Args.hasArg(options::OPT_mstack_alignment)) { in ConstructJob()
5121 StringRef alignment = Args.getLastArgValue(options::OPT_mstack_alignment); in ConstructJob()
5125 if (Args.hasArg(options::OPT_mstack_probe_size)) { in ConstructJob()
5126 StringRef Size = Args.getLastArgValue(options::OPT_mstack_probe_size); in ConstructJob()
5148 if (Arg *A = Args.getLastArg(options::OPT_mrestrict_it, in ConstructJob()
5149 options::OPT_mno_restrict_it)) { in ConstructJob()
5150 if (A->getOption().matches(options::OPT_mrestrict_it)) { in ConstructJob()
5165 // Forward -cl options to -cc1 in ConstructJob()
5166 if (Args.getLastArg(options::OPT_cl_opt_disable)) { in ConstructJob()
5169 if (Args.getLastArg(options::OPT_cl_strict_aliasing)) { in ConstructJob()
5172 if (Args.getLastArg(options::OPT_cl_single_precision_constant)) { in ConstructJob()
5175 if (Args.getLastArg(options::OPT_cl_finite_math_only)) { in ConstructJob()
5178 if (Args.getLastArg(options::OPT_cl_kernel_arg_info)) { in ConstructJob()
5181 if (Args.getLastArg(options::OPT_cl_unsafe_math_optimizations)) { in ConstructJob()
5184 if (Args.getLastArg(options::OPT_cl_fast_relaxed_math)) { in ConstructJob()
5187 if (Args.getLastArg(options::OPT_cl_mad_enable)) { in ConstructJob()
5190 if (Args.getLastArg(options::OPT_cl_no_signed_zeros)) { in ConstructJob()
5193 if (Arg *A = Args.getLastArg(options::OPT_cl_std_EQ)) { in ConstructJob()
5198 if (Args.getLastArg(options::OPT_cl_denorms_are_zero)) { in ConstructJob()
5202 // Forward -f options with positive and negative forms; we translate in ConstructJob()
5204 if (Arg *A = Args.getLastArg(options::OPT_fprofile_sample_use_EQ)) { in ConstructJob()
5214 Args.hasFlag(options::OPT_fbuiltin, options::OPT_fno_builtin, in ConstructJob()
5215 !Args.hasArg(options::OPT_mkernel)); in ConstructJob()
5220 if (Args.hasArg(options::OPT_ffreestanding)) in ConstructJob()
5223 // Process the -fno-builtin-* options. in ConstructJob()
5226 if (!O.matches(options::OPT_fno_builtin_)) in ConstructJob()
5239 if (!Args.hasFlag(options::OPT_fassume_sane_operator_new, in ConstructJob()
5240 options::OPT_fno_assume_sane_operator_new)) in ConstructJob()
5244 if (Args.hasFlag(options::OPT_fblocks, options::OPT_fno_blocks, in ConstructJob()
5246 (Args.hasArg(options::OPT_fgnu_runtime) && in ConstructJob()
5247 Args.hasArg(options::OPT_fobjc_nonfragile_abi) && in ConstructJob()
5248 !Args.hasArg(options::OPT_fno_blocks))) { in ConstructJob()
5251 if (!Args.hasArg(options::OPT_fgnu_runtime) && in ConstructJob()
5260 if (Args.hasFlag(options::OPT_fmodules, options::OPT_fno_modules, false)) { in ConstructJob()
5261 bool AllowedInCXX = Args.hasFlag(options::OPT_fcxx_modules, in ConstructJob()
5262 options::OPT_fno_cxx_modules, true); in ConstructJob()
5271 if (Args.hasFlag(options::OPT_fimplicit_module_maps, in ConstructJob()
5272 options::OPT_fno_implicit_module_maps, HaveModules)) { in ConstructJob()
5278 if (Args.hasFlag(options::OPT_fmodules_decluse, in ConstructJob()
5279 options::OPT_fno_modules_decluse, false)) { in ConstructJob()
5285 if (Args.hasFlag(options::OPT_fmodules_strict_decluse, in ConstructJob()
5286 options::OPT_fno_modules_strict_decluse, false)) { in ConstructJob()
5291 if (!Args.hasFlag(options::OPT_fimplicit_modules, in ConstructJob()
5292 options::OPT_fno_implicit_modules)) { in ConstructJob()
5298 if (Arg *A = Args.getLastArg(options::OPT_fmodules_cache_path)) in ConstructJob()
5320 Args.AddLastArg(CmdArgs, options::OPT_fmodule_name_EQ); in ConstructJob()
5324 Args.AddAllArgs(CmdArgs, options::OPT_fmodule_map_file); in ConstructJob()
5328 Args.AddAllArgs(CmdArgs, options::OPT_fmodule_file); in ConstructJob()
5330 Args.ClaimAllArgs(options::OPT_fmodule_file); in ConstructJob()
5346 Args.AddLastArg(CmdArgs, options::OPT_fmodules_user_build_path); in ConstructJob()
5349 Args.AddAllArgs(CmdArgs, options::OPT_fmodules_ignore_macro); in ConstructJob()
5350 Args.AddLastArg(CmdArgs, options::OPT_fmodules_prune_interval); in ConstructJob()
5351 Args.AddLastArg(CmdArgs, options::OPT_fmodules_prune_after); in ConstructJob()
5353 Args.AddLastArg(CmdArgs, options::OPT_fbuild_session_timestamp); in ConstructJob()
5355 if (Arg *A = Args.getLastArg(options::OPT_fbuild_session_file)) { in ConstructJob()
5356 if (Args.hasArg(options::OPT_fbuild_session_timestamp)) in ConstructJob()
5368 if (Args.getLastArg(options::OPT_fmodules_validate_once_per_build_session)) { in ConstructJob()
5369 if (!Args.getLastArg(options::OPT_fbuild_session_timestamp, in ConstructJob()
5370 options::OPT_fbuild_session_file)) in ConstructJob()
5374 options::OPT_fmodules_validate_once_per_build_session); in ConstructJob()
5377 Args.AddLastArg(CmdArgs, options::OPT_fmodules_validate_system_headers); in ConstructJob()
5380 if (Args.hasFlag(options::OPT_fno_access_control, in ConstructJob()
5381 options::OPT_faccess_control, false)) in ConstructJob()
5385 if (Args.hasFlag(options::OPT_fno_elide_constructors, in ConstructJob()
5386 options::OPT_felide_constructors, false)) in ConstructJob()
5397 if (Args.hasFlag(options::OPT_fshort_enums, options::OPT_fno_short_enums, in ConstructJob()
5403 options::OPT_fsigned_char, options::OPT_fno_signed_char, in ConstructJob()
5404 options::OPT_funsigned_char, options::OPT_fno_unsigned_char)) { in ConstructJob()
5405 if (A->getOption().matches(options::OPT_funsigned_char) || in ConstructJob()
5406 A->getOption().matches(options::OPT_fno_signed_char)) { in ConstructJob()
5415 options::OPT_fuse_cxa_atexit, options::OPT_fno_use_cxa_atexit, in ConstructJob()
5427 if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions, in ConstructJob()
5432 if (Args.hasFlag(options::OPT_fuse_line_directives, in ConstructJob()
5433 options::OPT_fno_use_line_directives, false)) in ConstructJob()
5437 if (Args.hasFlag(options::OPT_fms_compatibility, in ConstructJob()
5438 options::OPT_fno_ms_compatibility, in ConstructJob()
5440 Args.hasFlag(options::OPT_fms_extensions, in ConstructJob()
5441 options::OPT_fno_ms_extensions, true)))) in ConstructJob()
5454 if (const Arg *StdArg = Args.getLastArg(options::OPT__SLASH_std)) { in ConstructJob()
5475 if (Args.hasFlag(options::OPT_fborland_extensions, in ConstructJob()
5476 options::OPT_fno_borland_extensions, false)) in ConstructJob()
5480 if (Args.hasFlag(options::OPT_fdeclspec, options::OPT_fno_declspec, in ConstructJob()
5483 else if (Args.hasArg(options::OPT_fno_declspec)) in ConstructJob()
5488 if (!Args.hasFlag(options::OPT_fthreadsafe_statics, in ConstructJob()
5489 options::OPT_fno_threadsafe_statics, in ConstructJob()
5495 if (Args.hasFlag(options::OPT_fdelayed_template_parsing, in ConstructJob()
5496 options::OPT_fno_delayed_template_parsing, IsWindowsMSVC)) in ConstructJob()
5501 if (Arg *A = Args.getLastArg(options::OPT_fgnu_keywords, in ConstructJob()
5502 options::OPT_fno_gnu_keywords)) in ConstructJob()
5505 if (Args.hasFlag(options::OPT_fgnu89_inline, options::OPT_fno_gnu89_inline, in ConstructJob()
5509 if (Args.hasArg(options::OPT_fno_inline)) in ConstructJob()
5512 if (Arg* InlineArg = Args.getLastArg(options::OPT_finline_functions, in ConstructJob()
5513 options::OPT_finline_hint_functions, in ConstructJob()
5514 options::OPT_fno_inline_functions)) in ConstructJob()
5524 if (!Args.hasFlag(options::OPT_fobjc_legacy_dispatch, in ConstructJob()
5525 options::OPT_fno_objc_legacy_dispatch, in ConstructJob()
5570 if (Args.hasFlag(options::OPT_fobjc_arc_exceptions, in ConstructJob()
5571 options::OPT_fno_objc_arc_exceptions, in ConstructJob()
5584 const Arg *GCArg = Args.getLastArg(options::OPT_fobjc_gc_only); in ConstructJob()
5586 GCArg = Args.getLastArg(options::OPT_fobjc_gc); in ConstructJob()
5600 auto WeakArg = Args.getLastArg(options::OPT_fobjc_weak, in ConstructJob()
5601 options::OPT_fno_objc_weak); in ConstructJob()
5605 if (WeakArg->getOption().matches(options::OPT_fobjc_weak)) in ConstructJob()
5608 if (WeakArg->getOption().matches(options::OPT_fobjc_weak)) in ConstructJob()
5615 if (Args.hasFlag(options::OPT_fapplication_extension, in ConstructJob()
5616 options::OPT_fno_application_extension, false)) in ConstructJob()
5624 if (Args.hasArg(options::OPT_fsjlj_exceptions) || in ConstructJob()
5629 if (!Args.hasFlag(options::OPT_fassume_sane_operator_new, in ConstructJob()
5630 options::OPT_fno_assume_sane_operator_new)) in ConstructJob()
5635 if (Args.hasFlag(options::OPT_fsized_deallocation, in ConstructJob()
5636 options::OPT_fno_sized_deallocation, false)) in ConstructJob()
5641 if (!Args.hasFlag(options::OPT_fconstant_cfstrings, in ConstructJob()
5642 options::OPT_fno_constant_cfstrings) || in ConstructJob()
5643 !Args.hasFlag(options::OPT_mconstant_cfstrings, in ConstructJob()
5644 options::OPT_mno_constant_cfstrings)) in ConstructJob()
5649 if (Arg *A = Args.getLastArg(options::OPT_fshort_wchar, in ConstructJob()
5650 options::OPT_fno_short_wchar)) in ConstructJob()
5654 if (Args.hasFlag(options::OPT_fpascal_strings, in ConstructJob()
5655 options::OPT_fno_pascal_strings, false)) in ConstructJob()
5660 if (Arg *A = Args.getLastArg(options::OPT_fpack_struct_EQ)) { in ConstructJob()
5664 } else if (Args.hasFlag(options::OPT_fpack_struct, in ConstructJob()
5665 options::OPT_fno_pack_struct, false)) { in ConstructJob()
5670 bool SkipMaxTypeAlign = Args.hasArg(options::OPT_fno_max_type_align); in ConstructJob()
5671 if (Arg *A = Args.getLastArg(options::OPT_fmax_type_align_EQ)) { in ConstructJob()
5687 if (!Args.hasFlag(options::OPT_fcommon, options::OPT_fno_common, in ConstructJob()
5693 if (!Args.hasFlag(options::OPT_fsigned_bitfields, in ConstructJob()
5694 options::OPT_funsigned_bitfields)) in ConstructJob()
5696 << Args.getLastArg(options::OPT_funsigned_bitfields)->getAsString(Args); in ConstructJob()
5699 if (!Args.hasFlag(options::OPT_ffor_scope, options::OPT_fno_for_scope)) in ConstructJob()
5701 << Args.getLastArg(options::OPT_fno_for_scope)->getAsString(Args); in ConstructJob()
5704 if (Arg *inputCharset = Args.getLastArg(options::OPT_finput_charset_EQ)) { in ConstructJob()
5712 if (Arg *execCharset = Args.getLastArg(options::OPT_fexec_charset_EQ)) { in ConstructJob()
5720 if (!Args.hasFlag(options::OPT_fcaret_diagnostics, in ConstructJob()
5721 options::OPT_fno_caret_diagnostics, true)) in ConstructJob()
5725 if (!Args.hasFlag(options::OPT_fdiagnostics_fixit_info, in ConstructJob()
5726 options::OPT_fno_diagnostics_fixit_info)) in ConstructJob()
5730 if (Args.hasFlag(options::OPT_fdiagnostics_show_option, in ConstructJob()
5731 options::OPT_fno_diagnostics_show_option)) in ConstructJob()
5735 Args.getLastArg(options::OPT_fdiagnostics_show_category_EQ)) { in ConstructJob()
5740 if (const Arg *A = Args.getLastArg(options::OPT_fdiagnostics_format_EQ)) { in ConstructJob()
5746 options::OPT_fdiagnostics_show_note_include_stack, in ConstructJob()
5747 options::OPT_fno_diagnostics_show_note_include_stack)) { in ConstructJob()
5749 options::OPT_fdiagnostics_show_note_include_stack)) in ConstructJob()
5761 if (!O.matches(options::OPT_fcolor_diagnostics) && in ConstructJob()
5762 !O.matches(options::OPT_fdiagnostics_color) && in ConstructJob()
5763 !O.matches(options::OPT_fno_color_diagnostics) && in ConstructJob()
5764 !O.matches(options::OPT_fno_diagnostics_color) && in ConstructJob()
5765 !O.matches(options::OPT_fdiagnostics_color_EQ)) in ConstructJob()
5767 if (O.matches(options::OPT_fdiagnostics_color_EQ)) { in ConstructJob()
5778 if (Args.hasArg(options::OPT_fansi_escape_codes)) in ConstructJob()
5781 if (!Args.hasFlag(options::OPT_fshow_source_location, in ConstructJob()
5782 options::OPT_fno_show_source_location)) in ConstructJob()
5785 if (!Args.hasFlag(options::OPT_fshow_column, options::OPT_fno_show_column, in ConstructJob()
5789 if (!Args.hasFlag(options::OPT_fspell_checking, in ConstructJob()
5790 options::OPT_fno_spell_checking)) in ConstructJob()
5794 if (Args.hasFlag(options::OPT_fasm_blocks, options::OPT_fno_asm_blocks, in ConstructJob()
5799 if (!Args.hasFlag(options::OPT_fgnu_inline_asm, in ConstructJob()
5800 options::OPT_fno_gnu_inline_asm, true)) in ConstructJob()
5808 EnableVec ? options::OPT_O_Group : options::OPT_fvectorize; in ConstructJob()
5809 if (Args.hasFlag(options::OPT_fvectorize, VectorizeAliasOption, in ConstructJob()
5810 options::OPT_fno_vectorize, EnableVec)) in ConstructJob()
5816 EnableSLPVec ? options::OPT_O_Group : options::OPT_fslp_vectorize; in ConstructJob()
5817 if (Args.hasFlag(options::OPT_fslp_vectorize, SLPVectAliasOption, in ConstructJob()
5818 options::OPT_fno_slp_vectorize, EnableSLPVec)) in ConstructJob()
5822 if (Args.hasFlag(options::OPT_fslp_vectorize_aggressive, in ConstructJob()
5823 options::OPT_fno_slp_vectorize_aggressive, false)) in ConstructJob()
5826 if (Arg *A = Args.getLastArg(options::OPT_fshow_overloads_EQ)) in ConstructJob()
5830 options::OPT_fsanitize_undefined_strip_path_components_EQ)) in ConstructJob()
5835 if (Arg *A = Args.getLastArg(options::OPT_fdollars_in_identifiers, in ConstructJob()
5836 options::OPT_fno_dollars_in_identifiers)) { in ConstructJob()
5837 if (A->getOption().matches(options::OPT_fdollars_in_identifiers)) in ConstructJob()
5845 if (Arg *A = Args.getLastArg(options::OPT_funit_at_a_time, in ConstructJob()
5846 options::OPT_fno_unit_at_a_time)) { in ConstructJob()
5847 if (A->getOption().matches(options::OPT_fno_unit_at_a_time)) in ConstructJob()
5851 if (Args.hasFlag(options::OPT_fapple_pragma_pack, in ConstructJob()
5852 options::OPT_fno_apple_pragma_pack, false)) in ConstructJob()
5869 if (!Args.hasArg(options::OPT_fbuiltin_strcat)) in ConstructJob()
5871 if (!Args.hasArg(options::OPT_fbuiltin_strcpy)) in ConstructJob()
5880 if (Args.hasFlag(options::OPT_frewrite_includes, in ConstructJob()
5881 options::OPT_fno_rewrite_includes, false) || in ConstructJob()
5886 if (Arg *A = Args.getLastArg(options::OPT_traditional, in ConstructJob()
5887 options::OPT_traditional_cpp)) { in ConstructJob()
5894 Args.AddLastArg(CmdArgs, options::OPT_dM); in ConstructJob()
5895 Args.AddLastArg(CmdArgs, options::OPT_dD); in ConstructJob()
5898 if (Arg *A = Args.getLastArg(options::OPT__serialize_diags)) { in ConstructJob()
5903 if (Args.hasArg(options::OPT_fretain_comments_from_system_headers)) in ConstructJob()
5907 Args.AddAllArgs(CmdArgs, options::OPT_fcomment_block_commands); in ConstructJob()
5909 Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments); in ConstructJob()
5912 for (const Arg *A : Args.filtered(options::OPT_fplugin_EQ)) { in ConstructJob()
5920 Args.AddAllArgValues(CmdArgs, options::OPT_Xclang); in ConstructJob()
5921 for (const Arg *A : Args.filtered(options::OPT_mllvm)) { in ConstructJob()
5960 Args.AddAllArgs(CmdArgs, options::OPT_undef); in ConstructJob()
6004 Args.hasFlag(options::OPT_fwhole_program_vtables, in ConstructJob()
6005 options::OPT_fno_whole_program_vtables, false); in ConstructJob()
6015 if (Args.hasArg(options::OPT__SLASH_fallback) && in ConstructJob()
6022 } else if (Args.hasArg(options::OPT__SLASH_fallback) && in ConstructJob()
6038 if (Arg *A = Args.getLastArg(options::OPT_pg)) in ConstructJob()
6039 if (Args.hasArg(options::OPT_fomit_frame_pointer)) in ConstructJob()
6048 Args.ClaimAllArgs(options::OPT_fpch_preprocess); in ConstructJob()
6052 Args.ClaimAllArgs(options::OPT_clang_ignored_f_Group); in ConstructJob()
6053 Args.ClaimAllArgs(options::OPT_clang_ignored_m_Group); in ConstructJob()
6056 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructJob()
6059 /// Add options related to the Objective-C runtime/ABI.
6067 args.getLastArg(options::OPT_fnext_runtime, options::OPT_fgnu_runtime, in AddObjCRuntimeArgs()
6068 options::OPT_fobjc_runtime_EQ); in AddObjCRuntimeArgs()
6071 // options about fragility. in AddObjCRuntimeArgs()
6073 runtimeArg->getOption().matches(options::OPT_fobjc_runtime_EQ)) { in AddObjCRuntimeArgs()
6092 if (Arg *abiArg = args.getLastArg(options::OPT_fobjc_abi_version_EQ)) { in AddObjCRuntimeArgs()
6108 if (args.hasFlag(options::OPT_fobjc_nonfragile_abi, in AddObjCRuntimeArgs()
6109 options::OPT_fno_objc_nonfragile_abi, in AddObjCRuntimeArgs()
6119 args.getLastArg(options::OPT_fobjc_nonfragile_abi_version_EQ)) { in AddObjCRuntimeArgs()
6157 } else if (runtimeArg->getOption().matches(options::OPT_fnext_runtime)) { in AddObjCRuntimeArgs()
6169 assert(runtimeArg->getOption().matches(options::OPT_fgnu_runtime)); in AddObjCRuntimeArgs()
6208 Args.getAllArgValues(options::OPT__SLASH_EH); in parseClangCLEHFlags()
6235 Args.hasFlag(options::OPT__SLASH_GX, options::OPT__SLASH_GX_, in parseClangCLEHFlags()
6248 unsigned RTOptionID = options::OPT__SLASH_MT; in AddClangCLArgs()
6250 if (Args.hasArg(options::OPT__SLASH_LDd)) in AddClangCLArgs()
6253 RTOptionID = options::OPT__SLASH_MTd; in AddClangCLArgs()
6255 if (Arg *A = Args.getLastArg(options::OPT__SLASH_M_Group)) in AddClangCLArgs()
6260 case options::OPT__SLASH_MD: in AddClangCLArgs()
6261 if (Args.hasArg(options::OPT__SLASH_LDd)) in AddClangCLArgs()
6267 case options::OPT__SLASH_MDd: in AddClangCLArgs()
6273 case options::OPT__SLASH_MT: in AddClangCLArgs()
6274 if (Args.hasArg(options::OPT__SLASH_LDd)) in AddClangCLArgs()
6280 case options::OPT__SLASH_MTd: in AddClangCLArgs()
6290 if (Args.hasArg(options::OPT__SLASH_Zl)) { in AddClangCLArgs()
6303 if (!Args.hasArg(options::OPT_E) && !Args.hasArg(options::OPT__SLASH_EP)) in AddClangCLArgs()
6304 if (Arg *A = Args.getLastArg(options::OPT_show_includes)) in AddClangCLArgs()
6308 if (Args.hasFlag(options::OPT__SLASH_GR_, options::OPT__SLASH_GR, in AddClangCLArgs()
6314 if (Args.hasFlag(options::OPT__SLASH_GS, options::OPT__SLASH_GS_, in AddClangCLArgs()
6322 Args.getLastArg(options::OPT__SLASH_Z7, options::OPT__SLASH_Zd)) { in AddClangCLArgs()
6324 if (DebugInfoArg->getOption().matches(options::OPT__SLASH_Z7)) in AddClangCLArgs()
6344 if (Args.hasArg(options::OPT__SLASH_EP)) { in AddClangCLArgs()
6352 VolatileOptionID = options::OPT__SLASH_volatile_ms; in AddClangCLArgs()
6354 VolatileOptionID = options::OPT__SLASH_volatile_iso; in AddClangCLArgs()
6356 if (Arg *A = Args.getLastArg(options::OPT__SLASH_volatile_Group)) in AddClangCLArgs()
6359 if (VolatileOptionID == options::OPT__SLASH_volatile_ms) in AddClangCLArgs()
6362 Arg *MostGeneralArg = Args.getLastArg(options::OPT__SLASH_vmg); in AddClangCLArgs()
6363 Arg *BestCaseArg = Args.getLastArg(options::OPT__SLASH_vmb); in AddClangCLArgs()
6369 Arg *SingleArg = Args.getLastArg(options::OPT__SLASH_vms); in AddClangCLArgs()
6370 Arg *MultipleArg = Args.getLastArg(options::OPT__SLASH_vmm); in AddClangCLArgs()
6371 Arg *VirtualArg = Args.getLastArg(options::OPT__SLASH_vmv); in AddClangCLArgs()
6388 if (Args.getLastArg(options::OPT__SLASH_Gd)) in AddClangCLArgs()
6390 else if (Args.getLastArg(options::OPT__SLASH_Gr)) in AddClangCLArgs()
6392 else if (Args.getLastArg(options::OPT__SLASH_Gz)) in AddClangCLArgs()
6394 else if (Args.getLastArg(options::OPT__SLASH_Gv)) in AddClangCLArgs()
6397 if (Arg *A = Args.getLastArg(options::OPT_vtordisp_mode_EQ)) in AddClangCLArgs()
6400 if (!Args.hasArg(options::OPT_fdiagnostics_format_EQ)) { in AddClangCLArgs()
6402 if (Args.hasArg(options::OPT__SLASH_fallback)) in AddClangCLArgs()
6440 Args.ClaimAllArgs(options::OPT_w); in ConstructJob()
6442 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructJob()
6476 (void)Args.hasArg(options::OPT_force__cpusubtype__ALL); in ConstructJob()
6478 // Pass along any -I options so we get proper .include search paths. in ConstructJob()
6479 Args.AddAllArgs(CmdArgs, options::OPT_I_Group); in ConstructJob()
6492 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
6493 if (Arg *A = Args.getLastArg(options::OPT_g_Group)) { in ConstructJob()
6494 WantDebug = !A->getOption().matches(options::OPT_g0) && in ConstructJob()
6495 !A->getOption().matches(options::OPT_ggdb0); in ConstructJob()
6520 // And pass along -I options in ConstructJob()
6521 Args.AddAllArgs(CmdArgs, options::OPT_I); in ConstructJob()
6580 Args.ClaimAllArgs(options::OPT_W_Group); in ConstructJob()
6585 Args.AddAllArgs(CmdArgs, options::OPT_mllvm); in ConstructJob()
6600 if (Args.hasArg(options::OPT_gsplit_dwarf) && in ConstructJob()
6625 A->getOption().matches(options::OPT_g_Group)) in ConstructJob()
6630 A->getOption().matches(options::OPT_W_Group)) in ConstructJob()
6676 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
6685 // inputs into '-Wl,' options? in ConstructJob()
6707 // Reverse translate some rewritten options. in ConstructJob()
6708 if (A.getOption().matches(options::OPT_Z_reserved_lib_stdcxx)) { in ConstructJob()
6809 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
6818 // inputs into '-Wl,' options? in ConstructJob()
6859 bool IsStatic = Args.hasArg(options::OPT_static); in constructHexagonLinkArgs()
6860 bool IsShared = Args.hasArg(options::OPT_shared); in constructHexagonLinkArgs()
6861 bool IsPIE = Args.hasArg(options::OPT_pie); in constructHexagonLinkArgs()
6862 bool IncStdLib = !Args.hasArg(options::OPT_nostdlib); in constructHexagonLinkArgs()
6863 bool IncStartFiles = !Args.hasArg(options::OPT_nostartfiles); in constructHexagonLinkArgs()
6864 bool IncDefLibs = !Args.hasArg(options::OPT_nodefaultlibs); in constructHexagonLinkArgs()
6869 // Silence warnings for various options in constructHexagonLinkArgs()
6871 Args.ClaimAllArgs(options::OPT_g_Group); in constructHexagonLinkArgs()
6872 Args.ClaimAllArgs(options::OPT_emit_llvm); in constructHexagonLinkArgs()
6873 Args.ClaimAllArgs(options::OPT_w); // Other warning options are already in constructHexagonLinkArgs()
6875 Args.ClaimAllArgs(options::OPT_static_libgcc); in constructHexagonLinkArgs()
6880 if (Args.hasArg(options::OPT_s)) in constructHexagonLinkArgs()
6883 if (Args.hasArg(options::OPT_r)) in constructHexagonLinkArgs()
6925 for (const Arg *A : Args.filtered(options::OPT_moslib_EQ)) { in constructHexagonLinkArgs()
6980 {options::OPT_T_Group, options::OPT_e, options::OPT_s, in constructHexagonLinkArgs()
6981 options::OPT_t, options::OPT_u_Group}); in constructHexagonLinkArgs()
7082 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
7084 if (Args.hasArg(options::OPT_s)) in ConstructJob()
7086 if (Args.hasArg(options::OPT_shared)) in ConstructJob()
7088 if (Args.hasArg(options::OPT_static)) in ConstructJob()
7091 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructJob()
7094 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
7095 if (Args.hasArg(options::OPT_shared)) in ConstructJob()
7097 else if (Args.hasArg(options::OPT_pie)) in ConstructJob()
7107 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
7111 if (Args.hasArg(options::OPT_pthread)) in ConstructJob()
7118 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) in ConstructJob()
7210 if (Args.hasArg(options::OPT_r)) in appendEBLinkFlags()
7251 Arg *A = Args.getLastArg(options::OPT_mabi_EQ); in hasMipsAbiArg()
7256 Arg *A = Args.getLastArg(options::OPT_m_libc_Group); in isUCLibc()
7257 return A && A->getOption().matches(options::OPT_muclibc); in isUCLibc()
7261 if (Arg *NaNArg = Args.getLastArg(options::OPT_mnan_EQ)) in isNaN2008()
7313 if (Arg *A = Args.getLastArg(options::OPT_msingle_float, in shouldUseFPXX()
7314 options::OPT_mdouble_float)) in shouldUseFPXX()
7315 if (A->getOption().matches(options::OPT_msingle_float)) in shouldUseFPXX()
7388 if (Arg *OutputOpt = Args.getLastArg(options::OPT_o)) { in getDependencyFileName()
7407 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
7409 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructJob()
7410 // and for "clang -w foo.o -o foo". Other warning options are already in ConstructJob()
7412 Args.ClaimAllArgs(options::OPT_w); in ConstructJob()
7435 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
7440 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructJob()
7443 {options::OPT_T_Group, options::OPT_e, options::OPT_s, in ConstructJob()
7444 options::OPT_t, options::OPT_Z_Flag, options::OPT_r}); in ConstructJob()
7451 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
7458 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) in ConstructJob()
7487 if (Args.hasArg(options::OPT_fno_integrated_as)) { in ConstructJob()
7496 if (Args.hasArg(options::OPT_gstabs)) in ConstructJob()
7498 else if (Args.hasArg(options::OPT_g_Group)) in ConstructJob()
7508 Args.hasArg(options::OPT_force__cpusubtype__ALL)) in ConstructJob()
7512 (((Args.hasArg(options::OPT_mkernel) || in ConstructJob()
7513 Args.hasArg(options::OPT_fapple_kext)) && in ConstructJob()
7515 Args.hasArg(options::OPT_static))) in ConstructJob()
7518 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
7566 if (Arg *A = Args.getLastArg(options::OPT_mlinker_version_EQ)) { in AddLinkArgs()
7573 if (Version[0] >= 100 && !Args.hasArg(options::OPT_Z_Xlinker__no_demangle)) in AddLinkArgs()
7576 if (Args.hasArg(options::OPT_rdynamic) && Version[0] >= 137) in AddLinkArgs()
7581 if (Args.hasFlag(options::OPT_fapplication_extension, in AddLinkArgs()
7582 options::OPT_fno_application_extension, false)) in AddLinkArgs()
7616 Args.AddAllArgs(CmdArgs, options::OPT_static); in AddLinkArgs()
7617 if (!Args.hasArg(options::OPT_static)) in AddLinkArgs()
7619 if (Args.hasArg(options::OPT_fgnu_runtime)) { in AddLinkArgs()
7624 if (!Args.hasArg(options::OPT_dynamiclib)) { in AddLinkArgs()
7627 Args.AddLastArg(CmdArgs, options::OPT_force__cpusubtype__ALL); in AddLinkArgs()
7629 Args.AddLastArg(CmdArgs, options::OPT_bundle); in AddLinkArgs()
7630 Args.AddAllArgs(CmdArgs, options::OPT_bundle__loader); in AddLinkArgs()
7631 Args.AddAllArgs(CmdArgs, options::OPT_client__name); in AddLinkArgs()
7634 if ((A = Args.getLastArg(options::OPT_compatibility__version)) || in AddLinkArgs()
7635 (A = Args.getLastArg(options::OPT_current__version)) || in AddLinkArgs()
7636 (A = Args.getLastArg(options::OPT_install__name))) in AddLinkArgs()
7640 Args.AddLastArg(CmdArgs, options::OPT_force__flat__namespace); in AddLinkArgs()
7641 Args.AddLastArg(CmdArgs, options::OPT_keep__private__externs); in AddLinkArgs()
7642 Args.AddLastArg(CmdArgs, options::OPT_private__bundle); in AddLinkArgs()
7647 if ((A = Args.getLastArg(options::OPT_bundle)) || in AddLinkArgs()
7648 (A = Args.getLastArg(options::OPT_bundle__loader)) || in AddLinkArgs()
7649 (A = Args.getLastArg(options::OPT_client__name)) || in AddLinkArgs()
7650 (A = Args.getLastArg(options::OPT_force__flat__namespace)) || in AddLinkArgs()
7651 (A = Args.getLastArg(options::OPT_keep__private__externs)) || in AddLinkArgs()
7652 (A = Args.getLastArg(options::OPT_private__bundle))) in AddLinkArgs()
7656 Args.AddAllArgsTranslated(CmdArgs, options::OPT_compatibility__version, in AddLinkArgs()
7658 Args.AddAllArgsTranslated(CmdArgs, options::OPT_current__version, in AddLinkArgs()
7663 Args.AddAllArgsTranslated(CmdArgs, options::OPT_install__name, in AddLinkArgs()
7667 Args.AddLastArg(CmdArgs, options::OPT_all__load); in AddLinkArgs()
7668 Args.AddAllArgs(CmdArgs, options::OPT_allowable__client); in AddLinkArgs()
7669 Args.AddLastArg(CmdArgs, options::OPT_bind__at__load); in AddLinkArgs()
7671 Args.AddLastArg(CmdArgs, options::OPT_arch__errors__fatal); in AddLinkArgs()
7672 Args.AddLastArg(CmdArgs, options::OPT_dead__strip); in AddLinkArgs()
7673 Args.AddLastArg(CmdArgs, options::OPT_no__dead__strip__inits__and__terms); in AddLinkArgs()
7674 Args.AddAllArgs(CmdArgs, options::OPT_dylib__file); in AddLinkArgs()
7675 Args.AddLastArg(CmdArgs, options::OPT_dynamic); in AddLinkArgs()
7676 Args.AddAllArgs(CmdArgs, options::OPT_exported__symbols__list); in AddLinkArgs()
7677 Args.AddLastArg(CmdArgs, options::OPT_flat__namespace); in AddLinkArgs()
7678 Args.AddAllArgs(CmdArgs, options::OPT_force__load); in AddLinkArgs()
7679 Args.AddAllArgs(CmdArgs, options::OPT_headerpad__max__install__names); in AddLinkArgs()
7680 Args.AddAllArgs(CmdArgs, options::OPT_image__base); in AddLinkArgs()
7681 Args.AddAllArgs(CmdArgs, options::OPT_init); in AddLinkArgs()
7686 Args.AddLastArg(CmdArgs, options::OPT_nomultidefs); in AddLinkArgs()
7687 Args.AddLastArg(CmdArgs, options::OPT_multi__module); in AddLinkArgs()
7688 Args.AddLastArg(CmdArgs, options::OPT_single__module); in AddLinkArgs()
7689 Args.AddAllArgs(CmdArgs, options::OPT_multiply__defined); in AddLinkArgs()
7690 Args.AddAllArgs(CmdArgs, options::OPT_multiply__defined__unused); in AddLinkArgs()
7693 Args.getLastArg(options::OPT_fpie, options::OPT_fPIE, in AddLinkArgs()
7694 options::OPT_fno_pie, options::OPT_fno_PIE)) { in AddLinkArgs()
7695 if (A->getOption().matches(options::OPT_fpie) || in AddLinkArgs()
7696 A->getOption().matches(options::OPT_fPIE)) in AddLinkArgs()
7711 Args.AddLastArg(CmdArgs, options::OPT_prebind); in AddLinkArgs()
7712 Args.AddLastArg(CmdArgs, options::OPT_noprebind); in AddLinkArgs()
7713 Args.AddLastArg(CmdArgs, options::OPT_nofixprebinding); in AddLinkArgs()
7714 Args.AddLastArg(CmdArgs, options::OPT_prebind__all__twolevel__modules); in AddLinkArgs()
7715 Args.AddLastArg(CmdArgs, options::OPT_read__only__relocs); in AddLinkArgs()
7716 Args.AddAllArgs(CmdArgs, options::OPT_sectcreate); in AddLinkArgs()
7717 Args.AddAllArgs(CmdArgs, options::OPT_sectorder); in AddLinkArgs()
7718 Args.AddAllArgs(CmdArgs, options::OPT_seg1addr); in AddLinkArgs()
7719 Args.AddAllArgs(CmdArgs, options::OPT_segprot); in AddLinkArgs()
7720 Args.AddAllArgs(CmdArgs, options::OPT_segaddr); in AddLinkArgs()
7721 Args.AddAllArgs(CmdArgs, options::OPT_segs__read__only__addr); in AddLinkArgs()
7722 Args.AddAllArgs(CmdArgs, options::OPT_segs__read__write__addr); in AddLinkArgs()
7723 Args.AddAllArgs(CmdArgs, options::OPT_seg__addr__table); in AddLinkArgs()
7724 Args.AddAllArgs(CmdArgs, options::OPT_seg__addr__table__filename); in AddLinkArgs()
7725 Args.AddAllArgs(CmdArgs, options::OPT_sub__library); in AddLinkArgs()
7726 Args.AddAllArgs(CmdArgs, options::OPT_sub__umbrella); in AddLinkArgs()
7734 } else if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) { in AddLinkArgs()
7739 Args.AddLastArg(CmdArgs, options::OPT_twolevel__namespace); in AddLinkArgs()
7740 Args.AddLastArg(CmdArgs, options::OPT_twolevel__namespace__hints); in AddLinkArgs()
7741 Args.AddAllArgs(CmdArgs, options::OPT_umbrella); in AddLinkArgs()
7742 Args.AddAllArgs(CmdArgs, options::OPT_undefined); in AddLinkArgs()
7743 Args.AddAllArgs(CmdArgs, options::OPT_unexported__symbols__list); in AddLinkArgs()
7744 Args.AddAllArgs(CmdArgs, options::OPT_weak__reference__mismatches); in AddLinkArgs()
7745 Args.AddLastArg(CmdArgs, options::OPT_X_Flag); in AddLinkArgs()
7746 Args.AddAllArgs(CmdArgs, options::OPT_y); in AddLinkArgs()
7747 Args.AddLastArg(CmdArgs, options::OPT_w); in AddLinkArgs()
7748 Args.AddAllArgs(CmdArgs, options::OPT_pagezero__size); in AddLinkArgs()
7749 Args.AddAllArgs(CmdArgs, options::OPT_segs__read__); in AddLinkArgs()
7750 Args.AddLastArg(CmdArgs, options::OPT_seglinkedit); in AddLinkArgs()
7751 Args.AddLastArg(CmdArgs, options::OPT_noseglinkedit); in AddLinkArgs()
7752 Args.AddAllArgs(CmdArgs, options::OPT_sectalign); in AddLinkArgs()
7753 Args.AddAllArgs(CmdArgs, options::OPT_sectobjectsymbols); in AddLinkArgs()
7754 Args.AddAllArgs(CmdArgs, options::OPT_segcreate); in AddLinkArgs()
7755 Args.AddLastArg(CmdArgs, options::OPT_whyload); in AddLinkArgs()
7756 Args.AddLastArg(CmdArgs, options::OPT_whatsloaded); in AddLinkArgs()
7757 Args.AddAllArgs(CmdArgs, options::OPT_dylinker__install__name); in AddLinkArgs()
7758 Args.AddLastArg(CmdArgs, options::OPT_dylinker); in AddLinkArgs()
7759 Args.AddLastArg(CmdArgs, options::OPT_Mach); in AddLinkArgs()
7781 if (Args.hasArg(options::OPT_ccc_arcmt_check, in ConstructJob()
7782 options::OPT_ccc_arcmt_migrate)) { in ConstructJob()
7798 Args.AddAllArgs(CmdArgs, {options::OPT_d_Flag, options::OPT_s, options::OPT_t, in ConstructJob()
7799 options::OPT_Z_Flag, options::OPT_u_Group, in ConstructJob()
7800 options::OPT_e, options::OPT_r}); in ConstructJob()
7805 if (Args.hasArg(options::OPT_ObjC) || Args.hasArg(options::OPT_ObjCXX)) in ConstructJob()
7811 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) in ConstructJob()
7823 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructJob()
7843 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) in ConstructJob()
7847 !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
7863 if (Args.hasArg(options::OPT_fnested_functions)) in ConstructJob()
7868 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
7878 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
7882 Args.AddAllArgs(CmdArgs, options::OPT_T_Group); in ConstructJob()
7883 Args.AddAllArgs(CmdArgs, options::OPT_F); in ConstructJob()
7886 for (const Arg *A : Args.filtered(options::OPT_iframework)) in ConstructJob()
7889 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
7890 if (Arg *A = Args.getLastArg(options::OPT_fveclib)) { in ConstructJob()
7978 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
8000 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared)) { in ConstructJob()
8005 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
8010 if (Args.hasArg(options::OPT_shared)) { in ConstructJob()
8026 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8027 if (!Args.hasArg(options::OPT_shared)) in ConstructJob()
8040 Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group, in ConstructJob()
8041 options::OPT_e, options::OPT_r}); in ConstructJob()
8045 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
8050 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
8056 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8127 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
8148 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
8150 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructJob()
8151 // and for "clang -w foo.o -o foo". Other warning options are already in ConstructJob()
8153 Args.ClaimAllArgs(options::OPT_w); in ConstructJob()
8160 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared)) { in ConstructJob()
8165 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
8168 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
8172 if (Args.hasArg(options::OPT_shared)) { in ConstructJob()
8180 if (Args.hasArg(options::OPT_nopie)) in ConstructJob()
8190 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8191 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
8192 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8212 Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group, in ConstructJob()
8213 options::OPT_e, options::OPT_s, options::OPT_t, in ConstructJob()
8214 options::OPT_Z_Flag, options::OPT_r}); in ConstructJob()
8218 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
8221 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8231 if (Args.hasArg(options::OPT_pthread)) { in ConstructJob()
8232 if (!Args.hasArg(options::OPT_shared) && Args.hasArg(options::OPT_pg)) in ConstructJob()
8238 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
8239 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8248 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8249 if (!Args.hasArg(options::OPT_shared)) in ConstructJob()
8269 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
8289 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared)) { in ConstructJob()
8294 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
8297 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
8301 if (Args.hasArg(options::OPT_shared)) { in ConstructJob()
8316 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8317 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
8318 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8333 {options::OPT_L, options::OPT_T_Group, options::OPT_e}); in ConstructJob()
8337 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
8340 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8346 if (Args.hasArg(options::OPT_pthread)) { in ConstructJob()
8347 if (!Args.hasArg(options::OPT_shared) && Args.hasArg(options::OPT_pg)) in ConstructJob()
8353 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
8354 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8377 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8378 if (!Args.hasArg(options::OPT_shared)) in ConstructJob()
8429 if (Arg *A = Args.getLastArg(options::OPT_G)) { in ConstructJob()
8471 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
8493 !Args.hasArg(options::OPT_shared) && in ConstructJob()
8494 (Args.hasArg(options::OPT_pie) || ToolChain.isPIEDefault()); in ConstructJob()
8498 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
8500 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructJob()
8501 // and for "clang -w foo.o -o foo". Other warning options are already in ConstructJob()
8503 Args.ClaimAllArgs(options::OPT_w); in ConstructJob()
8512 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
8515 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
8517 if (Args.hasArg(options::OPT_shared)) { in ConstructJob()
8544 if (Arg *A = Args.getLastArg(options::OPT_G)) { in ConstructJob()
8562 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8564 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
8565 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8578 if (Args.hasArg(options::OPT_static)) in ConstructJob()
8580 else if (Args.hasArg(options::OPT_shared) || IsPIE) in ConstructJob()
8588 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructJob()
8590 Args.AddAllArgs(CmdArgs, options::OPT_T_Group); in ConstructJob()
8591 Args.AddAllArgs(CmdArgs, options::OPT_e); in ConstructJob()
8592 Args.AddAllArgs(CmdArgs, options::OPT_s); in ConstructJob()
8593 Args.AddAllArgs(CmdArgs, options::OPT_t); in ConstructJob()
8594 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag); in ConstructJob()
8595 Args.AddAllArgs(CmdArgs, options::OPT_r); in ConstructJob()
8603 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
8607 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8616 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8620 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
8622 } else if (Args.hasArg(options::OPT_pg)) { in ConstructJob()
8630 if (Args.hasArg(options::OPT_pthread)) { in ConstructJob()
8631 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
8637 if (Args.hasArg(options::OPT_pg)) { in ConstructJob()
8638 if (Args.hasArg(options::OPT_shared)) in ConstructJob()
8648 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
8650 } else if (Args.hasArg(options::OPT_pg)) { in ConstructJob()
8659 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8660 if (Args.hasArg(options::OPT_shared) || IsPIE) in ConstructJob()
8744 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
8768 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
8771 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
8773 if (Args.hasArg(options::OPT_shared)) { in ConstructJob()
8776 Args.AddAllArgs(CmdArgs, options::OPT_pie); in ConstructJob()
8874 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8875 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
8881 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie)) { in ConstructJob()
8890 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructJob()
8891 Args.AddAllArgs(CmdArgs, options::OPT_T_Group); in ConstructJob()
8892 Args.AddAllArgs(CmdArgs, options::OPT_e); in ConstructJob()
8893 Args.AddAllArgs(CmdArgs, options::OPT_s); in ConstructJob()
8894 Args.AddAllArgs(CmdArgs, options::OPT_t); in ConstructJob()
8895 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag); in ConstructJob()
8896 Args.AddAllArgs(CmdArgs, options::OPT_r); in ConstructJob()
8924 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
8930 if (Args.hasArg(options::OPT_pthread)) in ConstructJob()
8935 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
8951 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
8952 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie)) in ConstructJob()
9059 Args.AddLastArg(CmdArgs, options::OPT_march_EQ); in ConstructJob()
9065 if ((A = Args.getLastArg(options::OPT_mcpu_EQ)) && in ConstructJob()
9069 Args.AddLastArg(CmdArgs, options::OPT_mcpu_EQ); in ConstructJob()
9070 Args.AddLastArg(CmdArgs, options::OPT_mfpu_EQ); in ConstructJob()
9103 if (Arg *A = Args.getLastArg(options::OPT_mnan_EQ)) { in ConstructJob()
9109 if (Arg *A = Args.getLastArg(options::OPT_mfp32, options::OPT_mfpxx, in ConstructJob()
9110 options::OPT_mfp64)) { in ConstructJob()
9121 Args.getLastArg(options::OPT_mips16, options::OPT_mno_mips16)) { in ConstructJob()
9122 if (A->getOption().matches(options::OPT_mips16)) { in ConstructJob()
9131 Args.AddLastArg(CmdArgs, options::OPT_mmicromips, in ConstructJob()
9132 options::OPT_mno_micromips); in ConstructJob()
9133 Args.AddLastArg(CmdArgs, options::OPT_mdsp, options::OPT_mno_dsp); in ConstructJob()
9134 Args.AddLastArg(CmdArgs, options::OPT_mdspr2, options::OPT_mno_dspr2); in ConstructJob()
9136 if (Arg *A = Args.getLastArg(options::OPT_mmsa, options::OPT_mno_msa)) { in ConstructJob()
9138 // support -mmsa / -mno-msa options. in ConstructJob()
9139 if (A->getOption().matches(options::OPT_mmsa)) in ConstructJob()
9143 Args.AddLastArg(CmdArgs, options::OPT_mhard_float, in ConstructJob()
9144 options::OPT_msoft_float); in ConstructJob()
9146 Args.AddLastArg(CmdArgs, options::OPT_mdouble_float, in ConstructJob()
9147 options::OPT_msingle_float); in ConstructJob()
9149 Args.AddLastArg(CmdArgs, options::OPT_modd_spreg, in ConstructJob()
9150 options::OPT_mno_odd_spreg); in ConstructJob()
9164 Args.AddAllArgs(CmdArgs, options::OPT_I); in ConstructJob()
9165 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
9179 if (Args.hasArg(options::OPT_gsplit_dwarf) && in ConstructJob()
9190 bool StaticLibgcc = Args.hasArg(options::OPT_static_libgcc) || in AddLibgcc()
9191 Args.hasArg(options::OPT_static); in AddLibgcc()
9208 else if (!Args.hasArg(options::OPT_shared) && D.CCCIsCXX()) in AddLibgcc()
9241 if (Args.hasArg(options::OPT_rtlib_EQ)) { in AddRunTimeLibs()
9243 << Args.getLastArg(options::OPT_rtlib_EQ)->getValue() << "MSVC"; in AddRunTimeLibs()
9317 !Args.hasArg(options::OPT_shared) && !Args.hasArg(options::OPT_static) && in ConstructJob()
9318 (Args.hasArg(options::OPT_pie) || ToolChain.isPIEDefault()); in ConstructJob()
9326 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
9328 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructJob()
9329 // and for "clang -w foo.o -o foo". Other warning options are already in ConstructJob()
9331 Args.ClaimAllArgs(options::OPT_w); in ConstructJob()
9347 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
9350 if (Args.hasArg(options::OPT_s)) in ConstructJob()
9359 if (!Args.hasArg(options::OPT_static)) { in ConstructJob()
9366 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
9372 } else if (Args.hasArg(options::OPT_shared)) { in ConstructJob()
9376 if (!Args.hasArg(options::OPT_static)) { in ConstructJob()
9377 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
9380 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
9391 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
9394 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
9395 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
9412 if (Args.hasArg(options::OPT_static)) in ConstructJob()
9414 else if (Args.hasArg(options::OPT_shared)) in ConstructJob()
9429 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructJob()
9430 Args.AddAllArgs(CmdArgs, options::OPT_u); in ConstructJob()
9437 if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle)) in ConstructJob()
9447 !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
9448 bool OnlyLibstdcxxStatic = Args.hasArg(options::OPT_static_libstdcxx) && in ConstructJob()
9449 !Args.hasArg(options::OPT_static); in ConstructJob()
9458 Args.ClaimAllArgs(options::OPT_stdlib_EQ); in ConstructJob()
9460 if (!Args.hasArg(options::OPT_nostdlib)) { in ConstructJob()
9461 if (!Args.hasArg(options::OPT_nodefaultlibs)) { in ConstructJob()
9462 if (Args.hasArg(options::OPT_static)) in ConstructJob()
9471 bool WantPthread = Args.hasArg(options::OPT_pthread) || in ConstructJob()
9472 Args.hasArg(options::OPT_pthreads); in ConstructJob()
9474 if (Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ, in ConstructJob()
9475 options::OPT_fno_openmp, false)) { in ConstructJob()
9506 if (Args.hasArg(options::OPT_fsplit_stack)) in ConstructJob()
9515 if (Args.hasArg(options::OPT_static)) in ConstructJob()
9528 if (!Args.hasArg(options::OPT_nostartfiles) && !IsIAMCU) { in ConstructJob()
9530 if (Args.hasArg(options::OPT_shared)) in ConstructJob()
9582 !Args.hasArg(options::OPT_dynamic) && !Args.hasArg(options::OPT_shared); in ConstructJob()
9587 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
9589 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructJob()
9590 // and for "clang -w foo.o -o foo". Other warning options are already in ConstructJob()
9592 Args.ClaimAllArgs(options::OPT_w); in ConstructJob()
9597 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
9600 if (Args.hasArg(options::OPT_s)) in ConstructJob()
9625 else if (Args.hasArg(options::OPT_shared)) in ConstructJob()
9630 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
9631 if (!Args.hasArg(options::OPT_shared)) in ConstructJob()
9638 else if (Args.hasArg(options::OPT_shared)) in ConstructJob()
9645 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructJob()
9646 Args.AddAllArgs(CmdArgs, options::OPT_u); in ConstructJob()
9650 if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle)) in ConstructJob()
9656 !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
9658 Args.hasArg(options::OPT_static_libstdcxx) && !IsStatic; in ConstructJob()
9667 if (!Args.hasArg(options::OPT_nostdlib)) { in ConstructJob()
9668 if (!Args.hasArg(options::OPT_nodefaultlibs)) { in ConstructJob()
9674 if (Args.hasArg(options::OPT_pthread) || in ConstructJob()
9675 Args.hasArg(options::OPT_pthreads) || D.CCCIsCXX()) { in ConstructJob()
9703 if (!Args.hasArg(options::OPT_nostartfiles)) { in ConstructJob()
9705 if (Args.hasArg(options::OPT_shared)) in ConstructJob()
9727 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
9754 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
9763 {options::OPT_L, options::OPT_T_Group, options::OPT_e}); in ConstructJob()
9769 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
9776 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
9777 if (Args.hasArg(options::OPT_pthread)) in ConstructJob()
9807 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
9831 if (Args.hasArg(options::OPT_static)) { in ConstructJob()
9834 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
9836 if (Args.hasArg(options::OPT_shared)) in ConstructJob()
9860 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
9861 if (!Args.hasArg(options::OPT_shared)) { in ConstructJob()
9862 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
9866 if (Args.hasArg(options::OPT_pie)) in ConstructJob()
9875 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie)) in ConstructJob()
9884 {options::OPT_L, options::OPT_T_Group, options::OPT_e}); in ConstructJob()
9888 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
9891 if (!Args.hasArg(options::OPT_static)) { in ConstructJob()
9901 if (Args.hasArg(options::OPT_pthread)) in ConstructJob()
9904 if (!Args.hasArg(options::OPT_nolibc)) { in ConstructJob()
9908 if (Args.hasArg(options::OPT_static) || in ConstructJob()
9909 Args.hasArg(options::OPT_static_libgcc)) { in ConstructJob()
9913 if (Args.hasArg(options::OPT_shared_libgcc)) { in ConstructJob()
9915 if (!Args.hasArg(options::OPT_shared)) in ConstructJob()
9926 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
9927 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie)) in ConstructJob()
9975 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles) && in ConstructJob()
10019 if (!C.getDriver().IsCLMode() && Args.hasArg(options::OPT_L)) in ConstructJob()
10020 for (const auto &LibPath : Args.getAllArgValues(options::OPT_L)) in ConstructJob()
10025 if (Args.hasArg(options::OPT_g_Group, options::OPT__SLASH_Z7, in ConstructJob()
10026 options::OPT__SLASH_Zd)) in ConstructJob()
10029 bool DLL = Args.hasArg(options::OPT__SLASH_LD, options::OPT__SLASH_LDd, in ConstructJob()
10030 options::OPT_shared); in ConstructJob()
10042 if (Args.hasArg(options::OPT__SLASH_MD, options::OPT__SLASH_MDd)) { in ConstructJob()
10056 Args.AddAllArgValues(CmdArgs, options::OPT__SLASH_link); in ConstructJob()
10058 if (Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ, in ConstructJob()
10059 options::OPT_fno_openmp, false)) { in ConstructJob()
10081 if (!Args.hasArg(options::OPT_nostdlib)) { in ConstructJob()
10094 // Render -l options differently for the MSVC linker. in ConstructJob()
10095 if (A.getOption().matches(options::OPT_l)) { in ConstructJob()
10117 StringRef Linker = Args.getLastArgValue(options::OPT_fuse_ld_EQ, "link"); in ConstructJob()
10158 Args.AddAllArgs(CmdArgs, {options::OPT_D, options::OPT_U, options::OPT_I}); in GetCommand()
10161 if (Arg *A = Args.getLastArg(options::OPT_fbuiltin, options::OPT_fno_builtin)) in GetCommand()
10162 CmdArgs.push_back(A->getOption().getID() == options::OPT_fbuiltin ? "/Oi" in GetCommand()
10164 if (Arg *A = Args.getLastArg(options::OPT_O, options::OPT_O0)) { in GetCommand()
10165 if (A->getOption().getID() == options::OPT_O0) { in GetCommand()
10179 if (Arg *A = Args.getLastArg(options::OPT_fomit_frame_pointer, in GetCommand()
10180 options::OPT_fno_omit_frame_pointer)) in GetCommand()
10181 CmdArgs.push_back(A->getOption().getID() == options::OPT_fomit_frame_pointer in GetCommand()
10184 if (!Args.hasArg(options::OPT_fwritable_strings)) in GetCommand()
10188 // FIXME: How can we ensure this stays in sync with relevant clang-cl options? in GetCommand()
10190 if (Args.hasFlag(options::OPT__SLASH_GR_, options::OPT__SLASH_GR, in GetCommand()
10194 if (Args.hasFlag(options::OPT__SLASH_GS_, options::OPT__SLASH_GS, in GetCommand()
10198 if (Arg *A = Args.getLastArg(options::OPT_ffunction_sections, in GetCommand()
10199 options::OPT_fno_function_sections)) in GetCommand()
10200 CmdArgs.push_back(A->getOption().getID() == options::OPT_ffunction_sections in GetCommand()
10203 if (Arg *A = Args.getLastArg(options::OPT_fdata_sections, in GetCommand()
10204 options::OPT_fno_data_sections)) in GetCommand()
10206 A->getOption().getID() == options::OPT_fdata_sections ? "/Gw" : "/Gw-"); in GetCommand()
10207 if (Args.hasArg(options::OPT_fsyntax_only)) in GetCommand()
10209 if (Args.hasArg(options::OPT_g_Flag, options::OPT_gline_tables_only, in GetCommand()
10210 options::OPT__SLASH_Z7)) in GetCommand()
10214 Args.getAllArgValues(options::OPT_include); in GetCommand()
10219 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_LD); in GetCommand()
10220 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_LDd); in GetCommand()
10221 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_GX); in GetCommand()
10222 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_GX_); in GetCommand()
10223 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_EH); in GetCommand()
10224 Args.AddAllArgs(CmdArgs, options::OPT__SLASH_Zl); in GetCommand()
10227 if (Arg *A = Args.getLastArg(options::OPT__SLASH_MD, options::OPT__SLASH_MDd, in GetCommand()
10228 options::OPT__SLASH_MT, options::OPT__SLASH_MTd)) in GetCommand()
10233 Args.AddAllArgs(CmdArgs, options::OPT_UNKNOWN); in GetCommand()
10273 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
10284 if (Args.hasArg(options::OPT_gsplit_dwarf)) in ConstructJob()
10291 if (Args.hasArg(options::OPT_mthreads)) in AddLibGCC()
10298 bool Static = Args.hasArg(options::OPT_static_libgcc) || in AddLibGCC()
10299 Args.hasArg(options::OPT_static); in AddLibGCC()
10300 bool Shared = Args.hasArg(options::OPT_shared); in AddLibGCC()
10331 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
10333 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructJob()
10334 // and for "clang -w foo.o -o foo". Other warning options are already in ConstructJob()
10336 Args.ClaimAllArgs(options::OPT_w); in ConstructJob()
10338 StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ, "ld"); in ConstructJob()
10349 if (Args.hasArg(options::OPT_s)) in ConstructJob()
10360 if (Args.hasArg(options::OPT_mwindows)) { in ConstructJob()
10363 } else if (Args.hasArg(options::OPT_mconsole)) { in ConstructJob()
10368 if (Args.hasArg(options::OPT_static)) in ConstructJob()
10371 if (Args.hasArg(options::OPT_mdll)) in ConstructJob()
10373 else if (Args.hasArg(options::OPT_shared)) in ConstructJob()
10376 if (Args.hasArg(options::OPT_mdll) || Args.hasArg(options::OPT_shared)) { in ConstructJob()
10389 Args.AddAllArgs(CmdArgs, options::OPT_e); in ConstructJob()
10391 Args.AddLastArg(CmdArgs, options::OPT_r); in ConstructJob()
10392 Args.AddLastArg(CmdArgs, options::OPT_s); in ConstructJob()
10393 Args.AddLastArg(CmdArgs, options::OPT_t); in ConstructJob()
10394 Args.AddAllArgs(CmdArgs, options::OPT_u_Group); in ConstructJob()
10395 Args.AddLastArg(CmdArgs, options::OPT_Z_Flag); in ConstructJob()
10397 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
10398 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_mdll)) { in ConstructJob()
10401 if (Args.hasArg(options::OPT_municode)) in ConstructJob()
10406 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
10411 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructJob()
10420 !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructJob()
10421 bool OnlyLibstdcxxStatic = Args.hasArg(options::OPT_static_libstdcxx) && in ConstructJob()
10422 !Args.hasArg(options::OPT_static); in ConstructJob()
10430 if (!Args.hasArg(options::OPT_nostdlib)) { in ConstructJob()
10431 if (!Args.hasArg(options::OPT_nodefaultlibs)) { in ConstructJob()
10432 if (Args.hasArg(options::OPT_static)) in ConstructJob()
10435 if (Args.hasArg(options::OPT_fstack_protector) || in ConstructJob()
10436 Args.hasArg(options::OPT_fstack_protector_strong) || in ConstructJob()
10437 Args.hasArg(options::OPT_fstack_protector_all)) { in ConstructJob()
10441 if (Args.hasArg(options::OPT_fopenmp)) in ConstructJob()
10446 if (Args.hasArg(options::OPT_pg)) in ConstructJob()
10449 if (Args.hasArg(options::OPT_pthread)) in ConstructJob()
10453 if (Args.hasArg(options::OPT_mwindows)) { in ConstructJob()
10462 if (Args.hasArg(options::OPT_static)) in ConstructJob()
10468 if (!Args.hasArg(options::OPT_nostartfiles)) { in ConstructJob()
10495 if (Args.hasArg(options::OPT_v)) in ConstructJob()
10498 if (Arg *A = Args.getLastArg(options::OPT_g_Group)) in ConstructJob()
10499 if (!A->getOption().matches(options::OPT_g0)) in ConstructJob()
10502 if (Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm, in ConstructJob()
10506 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
10529 if (Args.hasArg(options::OPT_v)) in ConstructJob()
10533 if (Args.hasFlag(options::OPT_fexceptions, options::OPT_fno_exceptions, in ConstructJob()
10568 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
10596 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
10598 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructJob()
10600 Args.ClaimAllArgs(options::OPT_w); in ConstructJob()
10601 // Other warning options are already handled somewhere else. in ConstructJob()
10606 if (Args.hasArg(options::OPT_pie)) in ConstructJob()
10608 if (Args.hasArg(options::OPT_rdynamic)) in ConstructJob()
10610 if (Args.hasArg(options::OPT_s)) in ConstructJob()
10631 if (Args.hasArg(options::OPT_shared)) { in ConstructJob()
10655 CmdArgs.push_back(Args.hasArg(options::OPT_static) ? "-Bstatic" in ConstructJob()
10658 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
10672 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_rdynamic)) { in ConstructJob()
10680 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructJob()
10685 Args.hasArg(options::OPT_shared) ? "crtbeginS.obj" : "crtbegin.obj"; in ConstructJob()
10689 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructJob()
10693 if (D.CCCIsCXX() && !Args.hasArg(options::OPT_nostdlib) && in ConstructJob()
10694 !Args.hasArg(options::OPT_nodefaultlibs)) { in ConstructJob()
10695 bool StaticCXX = Args.hasArg(options::OPT_static_libstdcxx) && in ConstructJob()
10696 !Args.hasArg(options::OPT_static); in ConstructJob()
10704 if (!Args.hasArg(options::OPT_nostdlib)) { in ConstructJob()
10705 if (!Args.hasArg(options::OPT_nodefaultlibs)) { in ConstructJob()
10714 if (Args.hasArg(options::OPT_shared)) { in ConstructJob()
10755 // 'f' flags, optimize flags, and warning options. in ConstructJob()
10757 Args.AddAllArgs(CmdArgs, {options::OPT_I_Group, options::OPT_clang_i_Group, in ConstructJob()
10758 options::OPT_std_EQ, options::OPT_D, options::OPT_U, in ConstructJob()
10759 options::OPT_f_Group, options::OPT_f_clang_Group, in ConstructJob()
10760 options::OPT_g_Group, options::OPT_M_Group, in ConstructJob()
10761 options::OPT_O_Group, options::OPT_W_Group, in ConstructJob()
10762 options::OPT_mcpu_EQ}); in ConstructJob()
10769 if (Args.getLastArg(options::OPT_MF) && !Args.getLastArg(options::OPT_MT) && in ConstructJob()
10772 Arg *A = Args.getLastArg(options::OPT_o); in ConstructJob()
10802 const Arg *CPUArg = Args.getLastArg(options::OPT_mcpu_EQ); in ConstructJob()
10808 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
10809 for (const Arg *A : Args.filtered(options::OPT_I, options::OPT_isystem)) { in ConstructJob()
10835 !Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles); in ConstructJob()
10837 !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs); in ConstructJob()
10849 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructJob()
10850 Args.ClaimAllArgs(options::OPT_w); in ConstructJob()
10851 Args.ClaimAllArgs(options::OPT_static_libgcc); in ConstructJob()
10853 if (Args.hasArg(options::OPT_s)) // Pass the 'strip' option. in ConstructJob()
10866 Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group, in ConstructJob()
10867 options::OPT_e, options::OPT_s, options::OPT_t, in ConstructJob()
10868 options::OPT_Z_Flag, options::OPT_r}); in ConstructJob()
10908 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); in ConstructJob()
10944 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructPS4LinkJob()
10946 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructPS4LinkJob()
10947 // and for "clang -w foo.o -o foo". Other warning options are already in ConstructPS4LinkJob()
10949 Args.ClaimAllArgs(options::OPT_w); in ConstructPS4LinkJob()
10954 if (Args.hasArg(options::OPT_pie)) in ConstructPS4LinkJob()
10957 if (Args.hasArg(options::OPT_rdynamic)) in ConstructPS4LinkJob()
10959 if (Args.hasArg(options::OPT_shared)) in ConstructPS4LinkJob()
10971 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructPS4LinkJob()
10972 Args.AddAllArgs(CmdArgs, options::OPT_T_Group); in ConstructPS4LinkJob()
10973 Args.AddAllArgs(CmdArgs, options::OPT_e); in ConstructPS4LinkJob()
10974 Args.AddAllArgs(CmdArgs, options::OPT_s); in ConstructPS4LinkJob()
10975 Args.AddAllArgs(CmdArgs, options::OPT_t); in ConstructPS4LinkJob()
10976 Args.AddAllArgs(CmdArgs, options::OPT_r); in ConstructPS4LinkJob()
10978 if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle)) in ConstructPS4LinkJob()
10983 if (Args.hasArg(options::OPT_pthread)) { in ConstructPS4LinkJob()
11003 Args.ClaimAllArgs(options::OPT_g_Group); in ConstructGoldLinkJob()
11005 Args.ClaimAllArgs(options::OPT_emit_llvm); in ConstructGoldLinkJob()
11006 // and for "clang -w foo.o -o foo". Other warning options are already in ConstructGoldLinkJob()
11008 Args.ClaimAllArgs(options::OPT_w); in ConstructGoldLinkJob()
11013 if (Args.hasArg(options::OPT_pie)) in ConstructGoldLinkJob()
11016 if (Args.hasArg(options::OPT_static)) { in ConstructGoldLinkJob()
11019 if (Args.hasArg(options::OPT_rdynamic)) in ConstructGoldLinkJob()
11022 if (Args.hasArg(options::OPT_shared)) { in ConstructGoldLinkJob()
11040 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructGoldLinkJob()
11042 if (!Args.hasArg(options::OPT_shared)) { in ConstructGoldLinkJob()
11043 if (Args.hasArg(options::OPT_pg)) in ConstructGoldLinkJob()
11045 else if (Args.hasArg(options::OPT_pie)) in ConstructGoldLinkJob()
11056 if (Args.hasArg(options::OPT_static)) in ConstructGoldLinkJob()
11058 else if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie)) in ConstructGoldLinkJob()
11066 Args.AddAllArgs(CmdArgs, options::OPT_L); in ConstructGoldLinkJob()
11068 Args.AddAllArgs(CmdArgs, options::OPT_T_Group); in ConstructGoldLinkJob()
11069 Args.AddAllArgs(CmdArgs, options::OPT_e); in ConstructGoldLinkJob()
11070 Args.AddAllArgs(CmdArgs, options::OPT_s); in ConstructGoldLinkJob()
11071 Args.AddAllArgs(CmdArgs, options::OPT_t); in ConstructGoldLinkJob()
11072 Args.AddAllArgs(CmdArgs, options::OPT_r); in ConstructGoldLinkJob()
11074 if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle)) in ConstructGoldLinkJob()
11079 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { in ConstructGoldLinkJob()
11085 if (Args.hasArg(options::OPT_pg)) in ConstructGoldLinkJob()
11092 if (Args.hasArg(options::OPT_pg)) in ConstructGoldLinkJob()
11096 if (Args.hasArg(options::OPT_static)) { in ConstructGoldLinkJob()
11098 } else if (Args.hasArg(options::OPT_pg)) { in ConstructGoldLinkJob()
11106 if (Args.hasArg(options::OPT_pthread)) { in ConstructGoldLinkJob()
11107 if (Args.hasArg(options::OPT_pg)) in ConstructGoldLinkJob()
11113 if (Args.hasArg(options::OPT_pg)) { in ConstructGoldLinkJob()
11114 if (Args.hasArg(options::OPT_shared)) in ConstructGoldLinkJob()
11117 if (Args.hasArg(options::OPT_static)) { in ConstructGoldLinkJob()
11128 if (Args.hasArg(options::OPT_static)) { in ConstructGoldLinkJob()
11139 if (Args.hasArg(options::OPT_static)) { in ConstructGoldLinkJob()
11141 } else if (Args.hasArg(options::OPT_pg)) { in ConstructGoldLinkJob()
11150 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) { in ConstructGoldLinkJob()
11151 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie)) in ConstructGoldLinkJob()
11178 if (const Arg *A = Args.getLastArg(options::OPT_fuse_ld_EQ)) { in ConstructJob()
11189 PS4Linker = !Args.hasArg(options::OPT_shared); in ConstructJob()
11207 Args.getAllArgValues(options::OPT_march_EQ); in ConstructJob()
11212 if (!Args.hasArg(options::OPT_no_cuda_version_check)) { in ConstructJob()
11219 if (Args.hasFlag(options::OPT_cuda_noopt_device_debug, in ConstructJob()
11220 options::OPT_no_cuda_noopt_device_debug, false)) { in ConstructJob()
11222 // we ignore the compiler's -O* options if we want debug info. in ConstructJob()
11226 } else if (Arg *A = Args.getLastArg(options::OPT_O_Group)) { in ConstructJob()
11235 if (A->getOption().matches(options::OPT_O4) || in ConstructJob()
11236 A->getOption().matches(options::OPT_Ofast)) in ConstructJob()
11238 else if (A->getOption().matches(options::OPT_O0)) in ConstructJob()
11240 else if (A->getOption().matches(options::OPT_O)) { in ConstructJob()
11241 // -Os, -Oz, and -O(anything else) map to -O2, for lack of better options. in ConstructJob()
11264 for (const auto& A : Args.getAllArgValues(options::OPT_Xcuda_ptxas)) in ConstructJob()
11301 for (const auto& A : Args.getAllArgValues(options::OPT_Xcuda_fatbinary)) in ConstructJob()