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