Lines Matching refs:Args
92 void Driver::ParseDriverMode(ArrayRef<const char *> Args) { in ParseDriverMode() argument
96 for (const char *ArgPtr : Args) { in ParseDriverMode()
128 InputArgList Args = in ParseArgStrings() local
135 << Args.getArgString(MissingArgIndex) << MissingArgCount; in ParseArgStrings()
138 for (const Arg *A : Args) { in ParseArgStrings()
140 Diag(clang::diag::err_drv_unsupported_opt) << A->getAsString(Args); in ParseArgStrings()
146 Diag(clang::diag::warn_drv_empty_joined_argument) << A->getAsString(Args); in ParseArgStrings()
150 for (const Arg *A : Args.filtered(options::OPT_UNKNOWN)) in ParseArgStrings()
153 << A->getAsString(Args); in ParseArgStrings()
155 return Args; in ParseArgStrings()
203 static Arg *MakeInputArg(DerivedArgList &Args, OptTable *Opts, in MakeInputArg() argument
206 Args.getBaseArgs().MakeIndex(Value), Value.data()); in MakeInputArg()
207 Args.AddSynthesizedArg(A); in MakeInputArg()
212 DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const { in TranslateInputArgs()
213 DerivedArgList *DAL = new DerivedArgList(Args); in TranslateInputArgs()
215 bool HasNostdlib = Args.hasArg(options::OPT_nostdlib); in TranslateInputArgs()
216 bool HasNodefaultlib = Args.hasArg(options::OPT_nodefaultlibs); in TranslateInputArgs()
217 for (Arg *A : Args) { in TranslateInputArgs()
284 if (Args.hasFlag(options::OPT_miamcu, options::OPT_mno_iamcu, false)) in TranslateInputArgs()
290 if (!Args.hasArg(options::OPT_mlinker_version_EQ) && in TranslateInputArgs()
307 const ArgList &Args, in computeTargetTriple() argument
310 if (const Arg *A = Args.getLastArg(options::OPT_target)) in computeTargetTriple()
324 if (Arg *A = Args.getLastArg(options::OPT_arch)) { in computeTargetTriple()
332 if (Arg *A = Args.getLastArg(options::OPT_mlittle_endian, in computeTargetTriple()
351 Arg *A = Args.getLastArg(options::OPT_m64, options::OPT_mx32, in computeTargetTriple()
379 if (Args.hasFlag(options::OPT_miamcu, options::OPT_mno_iamcu, false)) { in computeTargetTriple()
386 << "-miamcu" << A->getBaseArg().getAsString(Args); in computeTargetTriple()
402 void Driver::setLTOMode(const llvm::opt::ArgList &Args) { in setLTOMode() argument
404 if (!Args.hasFlag(options::OPT_flto, options::OPT_flto_EQ, in setLTOMode()
410 const Arg *A = Args.getLastArg(options::OPT_flto_EQ); in setLTOMode()
476 InputArgList Args = ParseArgStrings(ArgList.slice(1)); in BuildCompilation() local
479 Diags.setIgnoreAllWarnings(Args.hasArg(options::OPT_w)); in BuildCompilation()
482 Args.ClaimAllArgs(options::OPT_no_canonical_prefixes); in BuildCompilation()
485 Args.ClaimAllArgs(options::OPT_pipe); in BuildCompilation()
493 CCCPrintPhases = Args.hasArg(options::OPT_ccc_print_phases); in BuildCompilation()
494 CCCPrintBindings = Args.hasArg(options::OPT_ccc_print_bindings); in BuildCompilation()
495 if (const Arg *A = Args.getLastArg(options::OPT_ccc_gcc_name)) in BuildCompilation()
498 Args.hasFlag(options::OPT_ccc_pch_is_pch, options::OPT_ccc_pch_is_pth); in BuildCompilation()
509 if (const Arg *A = Args.getLastArg(options::OPT_target)) in BuildCompilation()
511 if (const Arg *A = Args.getLastArg(options::OPT_ccc_install_dir)) in BuildCompilation()
513 for (const Arg *A : Args.filtered(options::OPT_B)) { in BuildCompilation()
517 if (const Arg *A = Args.getLastArg(options::OPT__sysroot_EQ)) in BuildCompilation()
519 if (const Arg *A = Args.getLastArg(options::OPT__dyld_prefix_EQ)) in BuildCompilation()
521 if (Args.hasArg(options::OPT_nostdlib)) in BuildCompilation()
524 if (const Arg *A = Args.getLastArg(options::OPT_resource_dir)) in BuildCompilation()
527 if (const Arg *A = Args.getLastArg(options::OPT_save_temps_EQ)) { in BuildCompilation()
534 setLTOMode(Args); in BuildCompilation()
539 if (Arg *A = Args.getLastArg(options::OPT_fembed_bitcode_EQ)) { in BuildCompilation()
548 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) in BuildCompilation()
555 Args.ClaimAllArgs(options::OPT_fembed_bitcode_EQ); in BuildCompilation()
559 llvm::make_unique<InputArgList>(std::move(Args)); in BuildCompilation()
598 static void printArgList(raw_ostream &OS, const llvm::opt::ArgList &Args) { in printArgList() argument
600 for (const auto *A : Args) in printArgList()
601 A->render(Args, ASL); in printArgList()
1082 DerivedArgList &Args = C.getArgs(); in BuildUniversalActions() local
1089 for (Arg *A : Args) { in BuildUniversalActions()
1096 Diag(clang::diag::err_drv_invalid_arch_name) << A->getAsString(Args); in BuildUniversalActions()
1109 Archs.push_back(Args.MakeArgString(TC.getDefaultUniversalArchName())); in BuildUniversalActions()
1112 BuildActions(C, Args, BAInputs, SingleActions); in BuildUniversalActions()
1139 Arg *A = Args.getLastArg(options::OPT_g_Group); in BuildUniversalActions()
1157 if (Args.hasArg(options::OPT_verify_debug_info)) { in BuildUniversalActions()
1169 static bool DiagnoseInputExistence(const Driver &D, const DerivedArgList &Args, in DiagnoseInputExistence() argument
1179 if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory)) { in DiagnoseInputExistence()
1195 if (Args.hasArg(options::OPT__SLASH_link) && Ty == types::TY_Object) { in DiagnoseInputExistence()
1208 void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args, in BuildInputs() argument
1217 if (Arg *TCTP = Args.getLastArgNoClaim(options::OPT__SLASH_TC, in BuildInputs()
1225 Args.filtered_begin(options::OPT__SLASH_TC, options::OPT__SLASH_TP); in BuildInputs()
1226 const arg_iterator ie = Args.filtered_end(); in BuildInputs()
1239 assert(!Args.hasArg(options::OPT_x) && "-x and /TC or /TP is not allowed"); in BuildInputs()
1242 for (Arg *A : Args) { in BuildInputs()
1260 if (!Args.hasArgNoClaim(options::OPT_E) && !CCCIsCPP()) in BuildInputs()
1297 if (Args.hasArg(options::OPT_ObjC)) in BuildInputs()
1299 else if (Args.hasArg(options::OPT_ObjCXX)) in BuildInputs()
1317 if (DiagnoseInputExistence(*this, Args, Value, Ty)) in BuildInputs()
1322 if (DiagnoseInputExistence(*this, Args, Value, types::TY_C)) { in BuildInputs()
1323 Arg *InputArg = MakeInputArg(Args, Opts, A->getValue()); in BuildInputs()
1329 if (DiagnoseInputExistence(*this, Args, Value, types::TY_CXX)) { in BuildInputs()
1330 Arg *InputArg = MakeInputArg(Args, Opts, A->getValue()); in BuildInputs()
1356 Arg *A = MakeInputArg(Args, Opts, "-"); in BuildInputs()
1368 static Action *buildCudaActions(Compilation &C, DerivedArgList &Args, in buildCudaActions() argument
1371 Arg *PartialCompilationArg = Args.getLastArg( in buildCudaActions()
1387 for (Arg *A : Args) { in buildCudaActions()
1414 C.getDriver().BuildActions(C, Args, CudaDeviceInputs, CudaDeviceActions); in buildCudaActions()
1432 if (Args.hasArg(options::OPT_o) && in buildCudaActions()
1477 void Driver::BuildActions(Compilation &C, DerivedArgList &Args, in BuildActions() argument
1487 phases::ID FinalPhase = getFinalPhase(Args, &FinalPhaseArg); in BuildActions()
1489 if (FinalPhase == phases::Link && Args.hasArg(options::OPT_emit_llvm)) { in BuildActions()
1495 if (Arg *A = Args.getLastArg(options::OPT_Z_Joined)) in BuildActions()
1496 Diag(clang::diag::err_drv_use_of_Z_option) << A->getAsString(Args); in BuildActions()
1499 if (Arg *A = Args.getLastArg(options::OPT__SLASH_Fo)) { in BuildActions()
1506 Args.eraseArg(options::OPT__SLASH_Fo); in BuildActions()
1511 if (Arg *A = Args.getLastArg(options::OPT__SLASH_Fa)) { in BuildActions()
1518 Args.eraseArg(options::OPT__SLASH_Fa); in BuildActions()
1523 if (Arg *A = Args.getLastArg(options::OPT__SLASH_o)) { in BuildActions()
1527 Args.eraseArg(options::OPT__SLASH_o); in BuildActions()
1535 Arg *YcArg = Args.getLastArg(options::OPT__SLASH_Yc); in BuildActions()
1536 Arg *YuArg = Args.getLastArg(options::OPT__SLASH_Yu); in BuildActions()
1539 Args.eraseArg(options::OPT__SLASH_Yc); in BuildActions()
1544 Args.eraseArg(options::OPT__SLASH_Yu); in BuildActions()
1549 Args.eraseArg(options::OPT__SLASH_Yc); in BuildActions()
1550 Args.eraseArg(options::OPT__SLASH_Yu); in BuildActions()
1556 for (const Arg *Inc : Args.filtered(options::OPT_include)) { in BuildActions()
1564 Args.eraseArg(options::OPT__SLASH_Yc); in BuildActions()
1565 Args.eraseArg(options::OPT__SLASH_Yu); in BuildActions()
1571 Args.eraseArg(options::OPT__SLASH_Yc); in BuildActions()
1574 if (Args.hasArg(options::OPT__SLASH_Y_)) { in BuildActions()
1577 Args.eraseArg(options::OPT__SLASH_Fp); in BuildActions()
1578 Args.eraseArg(options::OPT__SLASH_Yc); in BuildActions()
1579 Args.eraseArg(options::OPT__SLASH_Yu); in BuildActions()
1602 if (Args.hasArg(options::OPT_Qunused_arguments)) in BuildActions()
1609 << InputArg->getAsString(Args) << getPhaseName(InitialPhase); in BuildActions()
1616 << InputArg->getAsString(Args) << !!FinalPhaseArg in BuildActions()
1620 << InputArg->getAsString(Args) << getPhaseName(InitialPhase) in BuildActions()
1631 Arg *PchInputArg = MakeInputArg(Args, Opts, YcArg->getValue()); in BuildActions()
1636 ClangClPch = ConstructPhaseAction(C, Args, Phase, ClangClPch); in BuildActions()
1676 Current = ConstructPhaseAction(C, Args, Phase, Current); in BuildActions()
1679 Current = buildCudaActions(C, Args, InputArg, Current, Actions); in BuildActions()
1701 Args.ClaimAllArgs(options::OPT_CompileOnly_Group); in BuildActions()
1702 Args.ClaimAllArgs(options::OPT_cl_compile_Group); in BuildActions()
1706 Args.ClaimAllArgs(options::OPT_cl_ignored_Group); in BuildActions()
1710 Args.ClaimAllArgs(options::OPT_cuda_host_only); in BuildActions()
1711 Args.ClaimAllArgs(options::OPT_cuda_compile_host_device); in BuildActions()
1714 Action *Driver::ConstructPhaseAction(Compilation &C, const ArgList &Args, in ConstructPhaseAction() argument
1724 if (Args.hasArg(options::OPT_M, options::OPT_MM)) { in ConstructPhaseAction()
1728 if (!Args.hasFlag(options::OPT_frewrite_includes, in ConstructPhaseAction()
1739 if (Args.hasArg(options::OPT_fsyntax_only)) { in ConstructPhaseAction()
1746 if (Args.hasArg(options::OPT_fsyntax_only)) in ConstructPhaseAction()
1748 if (Args.hasArg(options::OPT_rewrite_objc)) in ConstructPhaseAction()
1750 if (Args.hasArg(options::OPT_rewrite_legacy_objc)) in ConstructPhaseAction()
1753 if (Args.hasArg(options::OPT__analyze, options::OPT__analyze_auto)) in ConstructPhaseAction()
1755 if (Args.hasArg(options::OPT__migrate)) in ConstructPhaseAction()
1757 if (Args.hasArg(options::OPT_emit_ast)) in ConstructPhaseAction()
1759 if (Args.hasArg(options::OPT_module_file_info)) in ConstructPhaseAction()
1761 if (Args.hasArg(options::OPT_verify_pch)) in ConstructPhaseAction()
1768 Args.hasArg(options::OPT_S) ? types::TY_LTO_IR : types::TY_LTO_BC; in ConstructPhaseAction()
1771 if (Args.hasArg(options::OPT_emit_llvm)) { in ConstructPhaseAction()
1773 Args.hasArg(options::OPT_S) ? types::TY_LLVM_IR : types::TY_LLVM_BC; in ConstructPhaseAction()
2140 static const char *MakeCLOutputFilename(const ArgList &Args, StringRef ArgValue, in MakeCLOutputFilename() argument
2158 Args.hasArg(options::OPT__SLASH_LD, options::OPT__SLASH_LDd)) { in MakeCLOutputFilename()
2166 return Args.MakeArgString(Filename.c_str()); in MakeCLOutputFilename()
2450 const ToolChain &Driver::getToolChain(const ArgList &Args, in getToolChain() argument
2457 TC = new toolchains::Haiku(*this, Target, Args); in getToolChain()
2460 TC = new toolchains::CloudABI(*this, Target, Args); in getToolChain()
2467 TC = new toolchains::DarwinClang(*this, Target, Args); in getToolChain()
2470 TC = new toolchains::DragonFly(*this, Target, Args); in getToolChain()
2473 TC = new toolchains::OpenBSD(*this, Target, Args); in getToolChain()
2476 TC = new toolchains::Bitrig(*this, Target, Args); in getToolChain()
2479 TC = new toolchains::NetBSD(*this, Target, Args); in getToolChain()
2482 TC = new toolchains::FreeBSD(*this, Target, Args); in getToolChain()
2485 TC = new toolchains::Minix(*this, Target, Args); in getToolChain()
2490 TC = new toolchains::HexagonToolChain(*this, Target, Args); in getToolChain()
2493 TC = new toolchains::MipsLLVMToolChain(*this, Target, Args); in getToolChain()
2495 TC = new toolchains::Linux(*this, Target, Args); in getToolChain()
2498 TC = new toolchains::NaClToolChain(*this, Target, Args); in getToolChain()
2501 TC = new toolchains::Solaris(*this, Target, Args); in getToolChain()
2504 TC = new toolchains::AMDGPUToolChain(*this, Target, Args); in getToolChain()
2510 TC = new toolchains::Generic_ELF(*this, Target, Args); in getToolChain()
2512 TC = new toolchains::MachO(*this, Target, Args); in getToolChain()
2514 TC = new toolchains::Generic_GCC(*this, Target, Args); in getToolChain()
2517 TC = new toolchains::MinGW(*this, Target, Args); in getToolChain()
2520 TC = new toolchains::CrossWindowsToolChain(*this, Target, Args); in getToolChain()
2524 TC = new toolchains::MSVCToolChain(*this, Target, Args); in getToolChain()
2529 TC = new toolchains::CudaToolChain(*this, Target, Args); in getToolChain()
2532 TC = new toolchains::PS4CPU(*this, Target, Args); in getToolChain()
2539 TC = new toolchains::TCEToolChain(*this, Target, Args); in getToolChain()
2542 TC = new toolchains::HexagonToolChain(*this, Target, Args); in getToolChain()
2545 TC = new toolchains::LanaiToolChain(*this, Target, Args); in getToolChain()
2548 TC = new toolchains::XCoreToolChain(*this, Target, Args); in getToolChain()
2552 TC = new toolchains::WebAssembly(*this, Target, Args); in getToolChain()
2556 TC = new toolchains::MyriadToolChain(*this, Target, Args); in getToolChain()
2558 TC = new toolchains::Generic_ELF(*this, Target, Args); in getToolChain()
2560 TC = new toolchains::MachO(*this, Target, Args); in getToolChain()
2562 TC = new toolchains::Generic_GCC(*this, Target, Args); in getToolChain()
2664 bool clang::driver::isOptimizationLevelFast(const ArgList &Args) { in isOptimizationLevelFast() argument
2665 return Args.hasFlag(options::OPT_Ofast, options::OPT_O_Group, false); in isOptimizationLevelFast()