Home | History | Annotate | Download | only in Driver

Lines Matching defs:Args

82 void Driver::ParseDriverMode(ArrayRef<const char *> Args) {
86 for (size_t I = 0, E = Args.size(); I != E; ++I) {
88 if (Args[I] == nullptr)
90 const StringRef Arg = Args[I];
118 InputArgList *Args = getOpts().ParseArgs(ArgStrings.begin(), ArgStrings.end(),
126 << Args->getArgString(MissingArgIndex) << MissingArgCount;
129 for (const Arg *A : *Args) {
131 Diag(clang::diag::err_drv_unsupported_opt) << A->getAsString(*Args);
139 A->getAsString(*Args);
143 for (arg_iterator it = Args->filtered_begin(options::OPT_UNKNOWN),
144 ie = Args->filtered_end(); it != ie; ++it) {
145 Diags.Report(diag::err_drv_unknown_argument) << (*it) ->getAsString(*Args);
148 return Args;
197 static Arg* MakeInputArg(DerivedArgList &Args, OptTable *Opts,
200 Args.getBaseArgs().MakeIndex(Value), Value.data());
201 Args.AddSynthesizedArg(A);
206 DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const {
207 DerivedArgList *DAL = new DerivedArgList(Args);
209 bool HasNostdlib = Args.hasArg(options::OPT_nostdlib);
210 for (Arg *A : Args) {
282 if (!Args.hasArg(options::OPT_mlinker_version_EQ)) {
317 InputArgList *Args = ParseArgStrings(ArgList.slice(1));
320 Args->ClaimAllArgs(options::OPT_no_canonical_prefixes);
323 Args->ClaimAllArgs(options::OPT_pipe);
325 // Extract -ccc args.
331 CCCPrintActions = Args->hasArg(options::OPT_ccc_print_phases);
332 CCCPrintBindings = Args->hasArg(options::OPT_ccc_print_bindings);
333 if (const Arg *A = Args->getLastArg(options::OPT_ccc_gcc_name))
335 CCCUsePCH = Args->hasFlag(options::OPT_ccc_pch_is_pch,
346 if (const Arg *A = Args->getLastArg(options::OPT_target))
348 if (const Arg *A = Args->getLastArg(options::OPT_ccc_install_dir))
350 for (arg_iterator it = Args->filtered_begin(options::OPT_B),
351 ie = Args->filtered_end(); it != ie; ++it) {
356 if (const Arg *A = Args->getLastArg(options::OPT__sysroot_EQ))
358 if (const Arg *A = Args->getLastArg(options::OPT__dyld_prefix_EQ))
360 if (Args->hasArg(options::OPT_nostdlib))
363 if (const Arg *A = Args->getLastArg(options::OPT_resource_dir))
366 if (const Arg *A = Args->getLastArg(options::OPT_save_temps_EQ)) {
374 DerivedArgList *TranslatedArgs = TranslateInputArgs(*Args);
377 const ToolChain &TC = getToolChain(*Args);
379 // The compilation takes ownership of Args.
380 Compilation *C = new Compilation(*this, TC, Args, TranslatedArgs);
877 DerivedArgList &Args,
885 for (Arg *A : Args) {
893 << A->getAsString(Args);
906 Archs.push_back(Args.MakeArgString(TC.getDefaultUniversalArchName()));
909 BuildActions(TC, Args, BAInputs, SingleActions);
942 Arg *A = Args.getLastArg(options::OPT_g_Group);
959 if (Args.hasArg(options::OPT_verify_debug_info)) {
971 static bool DiagnoseInputExistence(const Driver &D, const DerivedArgList &Args,
981 if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory)) {
1000 void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
1009 if (Arg *TCTP = Args.getLastArgNoClaim(options::OPT__SLASH_TC,
1015 arg_iterator it = Args.filtered_begin(options::OPT__SLASH_TC,
1017 const arg_iterator ie = Args.filtered_end();
1030 assert(!Args.hasArg(options::OPT_x) && "-x and /TC or /TP is not allowed");
1033 for (Arg *A : Args) {
1051 if (!Args.hasArgNoClaim(options::OPT_E) && !CCCIsCPP())
1088 if (Args.hasArg(options::OPT_ObjC))
1090 else if (Args.hasArg(options::OPT_ObjCXX))
1108 if (DiagnoseInputExistence(*this, Args, Value))
1113 if (DiagnoseInputExistence(*this, Args, Value)) {
1114 Arg *InputArg = MakeInputArg(Args, Opts, A->getValue());
1120 if (DiagnoseInputExistence(*this, Args, Value)) {
1121 Arg *InputArg = MakeInputArg(Args, Opts, A->getValue());
1147 Arg *A = MakeInputArg(Args, Opts, "-");
1152 void Driver::BuildActions(const ToolChain &TC, DerivedArgList &Args,
1162 phases::ID FinalPhase = getFinalPhase(Args, &FinalPhaseArg);
1164 if (FinalPhase == phases::Link && Args.hasArg(options::OPT_emit_llvm)) {
1170 if (Arg *A = Args.getLastArg(options::OPT_Z_Joined))
1171 Diag(clang::diag::err_drv_use_of_Z_option) << A->getAsString(Args);
1174 if (Arg *A = Args.getLastArg(options::OPT__SLASH_Fo)) {
1181 Args.eraseArg(options::OPT__SLASH_Fo);
1186 if (Arg *A = Args.getLastArg(options::OPT__SLASH_Fa)) {
1193 Args.eraseArg(options::OPT__SLASH_Fa);
1198 if (Arg *A = Args.getLastArg(options::OPT__SLASH_o)) {
1202 Args.eraseArg(options::OPT__SLASH_o);
1225 if (Args.hasArg(options::OPT_Qunused_arguments))
1232 << InputArg->getAsString(Args)
1240 << InputArg->getAsString(Args)
1245 << InputArg->getAsString(Args)
1276 Current = ConstructPhaseAction(TC, Args, Phase, std::move(Current));
1293 Args.ClaimAllArgs(options::OPT_CompileOnly_Group);
1294 Args.ClaimAllArgs(options::OPT_cl_compile_Group);
1298 Args.ClaimAllArgs(options::OPT_cl_ignored_Group);
1302 Driver::ConstructPhaseAction(const ToolChain &TC, const ArgList &Args,
1312 if (Args.hasArg(options::OPT_M, options::OPT_MM)) {
1316 if (!Args.hasFlag(options::OPT_frewrite_includes,
1327 if (Args.hasArg(options::OPT_fsyntax_only)) {
1334 if (Args.hasArg(options::OPT_fsyntax_only))
1337 if (Args.hasArg(options::OPT_rewrite_objc))
1340 if (Args.hasArg(options::OPT_rewrite_legacy_objc))
1343 if (Args
1346 if (Args.hasArg(options::OPT__migrate))
1349 if (Args.hasArg(options::OPT_emit_ast))
1352 if (Args.hasArg(options::OPT_module_file_info))
1355 if (Args.hasArg(options::OPT_verify_pch))
1362 if (IsUsingLTO(TC, Args)) {
1364 Args.hasArg(options::OPT_S) ? types::TY_LTO_IR : types::TY_LTO_BC;
1367 if (Args.hasArg(options::OPT_emit_llvm)) {
1369 Args.hasArg(options::OPT_S) ? types::TY_LLVM_IR : types::TY_LLVM_BC;
1383 bool Driver::IsUsingLTO(const ToolChain &TC, const ArgList &Args) const {
1387 if (Args.hasFlag(options::OPT_flto, options::OPT_fno_lto, false))
1564 // just using Args was better?
1652 static const char *MakeCLOutputFilename(const ArgList &Args, StringRef ArgValue,
1669 Args.hasArg(options::OPT__SLASH_LD, options::OPT__SLASH_LDd)) {
1677 return Args.MakeArgString(Filename.c_str());
1942 /// \brief Compute target triple from args.
1945 /// args passed to the driver and the default triple string.
1947 const ArgList &Args,
1950 if (const Arg *A = Args.getLastArg(options::OPT_target))
1964 if (Arg *A = Args.getLastArg(options::OPT_arch)) {
1972 if (Arg *A = Args.getLastArg(options::OPT_mlittle_endian,
1996 if (Arg *A = Args.getLastArg(options::OPT_m64, options::OPT_mx32,
2025 const ToolChain &Driver::getToolChain(const ArgList &Args,
2027 llvm::Triple Target = computeTargetTriple(DefaultTargetTriple, Args,
2034 TC = new toolchains::CloudABI(*this, Target, Args);
2039 TC = new toolchains::DarwinClang(*this, Target, Args);
2042 TC = new toolchains::DragonFly(*this, Target, Args);
2045 TC = new toolchains::OpenBSD(*this, Target, Args);
2048 TC = new toolchains::Bitrig(*this, Target, Args);
2051 TC = new toolchains::NetBSD(*this, Target, Args);
2054 TC = new toolchains::FreeBSD(*this, Target, Args);
2057 TC = new toolchains::Minix(*this, Target, Args);
2061 TC = new toolchains::Hexagon_TC(*this, Target, Args);
2063 TC = new toolchains::Linux(*this, Target, Args);
2066 TC = new toolchains::NaCl_TC(*this, Target, Args);
2069 TC = new toolchains::Solaris(*this, Target, Args);
2075 TC = new toolchains::Generic_ELF(*this, Target, Args);
2077 TC = new toolchains::MachO(*this, Target, Args);
2079 TC = new toolchains::Generic_GCC(*this, Target, Args);
2085 TC = new toolchains::Generic_ELF(*this, Target, Args);
2087 TC = new toolchains::Generic_GCC(*this, Target, Args);
2090 TC = new toolchains::CrossWindowsToolChain(*this, Target, Args);
2094 TC = new toolchains::MSVCToolChain(*this, Target, Args);
2101 TC = new toolchains::TCEToolChain(*this, Target, Args);
2106 TC = new toolchains::Hexagon_TC(*this, Target, Args);
2110 TC = new toolchains::XCore(*this, Target, Args);
2114 TC = new toolchains::Generic_ELF(*this, Target, Args);
2118 TC = new toolchains::MachO(*this, Target, Args);
2121 TC = new toolchains::Generic_GCC(*this, Target, Args);
2196 bool clang::driver::isOptimizationLevelFast(const llvm::opt::ArgList &Args) {
2197 return Args.hasFlag(options::OPT_Ofast, options::OPT_O_Group, false);