Home | History | Annotate | Download | only in Driver

Lines Matching refs:Args

81 void Driver::ParseDriverMode(ArrayRef<const char *> Args) {
85 for (size_t I = 0, E = Args.size(); I != E; ++I) {
86 const StringRef Arg = Args[I];
114 InputArgList *Args = getOpts().ParseArgs(ArgList.begin(), ArgList.end(),
122 << Args->getArgString(MissingArgIndex) << MissingArgCount;
125 for (ArgList::const_iterator it = Args->begin(), ie = Args->end();
129 Diag(clang::diag::err_drv_unsupported_opt) << A->getAsString(*Args);
137 A->getAsString(*Args);
141 for (arg_iterator it = Args->filtered_begin(options::OPT_UNKNOWN),
142 ie = Args->filtered_end(); it != ie; ++it) {
143 Diags.Report(diag::err_drv_unknown_argument) << (*it) ->getAsString(*Args);
146 return Args;
192 static Arg* MakeInputArg(DerivedArgList &Args, OptTable *Opts,
195 Args.getBaseArgs().MakeIndex(Value), Value.data());
196 Args.AddSynthesizedArg(A);
201 DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const {
202 DerivedArgList *DAL = new DerivedArgList(Args);
204 bool HasNostdlib = Args.hasArg(options::OPT_nostdlib);
205 for (ArgList::const_iterator it = Args.begin(),
206 ie = Args.end(); it != ie; ++it) {
280 if (!Args.hasArg(options::OPT_mlinker_version_EQ)) {
315 InputArgList *Args = ParseArgStrings(ArgList.slice(1));
318 Args->ClaimAllArgs(options::OPT_no_canonical_prefixes);
321 Args->ClaimAllArgs(options::OPT_pipe);
323 // Extract -ccc args.
329 CCCPrintActions = Args->hasArg(options::OPT_ccc_print_phases);
330 CCCPrintBindings = Args->hasArg(options::OPT_ccc_print_bindings);
331 if (const Arg *A = Args->getLastArg(options::OPT_ccc_gcc_name))
333 CCCUsePCH = Args->hasFlag(options::OPT_ccc_pch_is_pch,
344 if (const Arg *A = Args->getLastArg(options::OPT_target))
346 if (const Arg *A = Args->getLastArg(options::OPT_ccc_install_dir))
348 for (arg_iterator it = Args->filtered_begin(options::OPT_B),
349 ie = Args->filtered_end(); it != ie; ++it) {
354 if (const Arg *A = Args->getLastArg(options::OPT__sysroot_EQ))
356 if (const Arg *A = Args->getLastArg(options::OPT__dyld_prefix_EQ))
358 if (Args->hasArg(options::OPT_nostdlib))
361 if (const Arg *A = Args->getLastArg(options::OPT_resource_dir))
365 DerivedArgList *TranslatedArgs = TranslateInputArgs(*Args);
368 const ToolChain &TC = getToolChain(*Args);
370 // The compilation takes ownership of Args.
371 Compilation *C = new Compilation(*this, TC, Args, TranslatedArgs);
850 DerivedArgList &Args,
858 for (ArgList::const_iterator it = Args.begin(), ie = Args.end();
869 << A->getAsString(Args);
882 Archs.push_back(Args.MakeArgString(TC.getDefaultUniversalArchName()));
885 BuildActions(TC, Args, BAInputs, SingleActions);
917 Arg *A = Args.getLastArg(options::OPT_g_Group);
934 if (Args.hasArg(options::OPT_verify_debug_info)) {
946 static bool DiagnoseInputExistence(const Driver &D, const DerivedArgList &Args,
956 if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory)) {
975 void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
984 if (Arg *TCTP = Args.getLastArg(options::OPT__SLASH_TC,
990 arg_iterator it = Args.filtered_begin(options::OPT__SLASH_TC,
992 const arg_iterator ie = Args.filtered_end();
1005 assert(!Args.hasArg(options::OPT_x) && "-x and /TC or /TP is not allowed");
1008 for (ArgList::const_iterator it = Args.begin(), ie = Args.end();
1029 if (!Args.hasArgNoClaim(options::OPT_E) && !CCCIsCPP())
1066 if (Args.hasArg(options::OPT_ObjC))
1068 else if (Args.hasArg(options::OPT_ObjCXX))
1077 if (DiagnoseInputExistence(*this, Args, Value))
1082 if (DiagnoseInputExistence(*this, Args, Value)) {
1083 Arg *InputArg = MakeInputArg(Args, Opts, A->getValue());
1089 if (DiagnoseInputExistence(*this, Args, Value)) {
1090 Arg *InputArg = MakeInputArg(Args, Opts, A->getValue());
1116 Arg *A = MakeInputArg(Args, Opts, "-");
1121 void Driver::BuildActions(const ToolChain &TC, DerivedArgList &Args,
1131 phases::ID FinalPhase = getFinalPhase(Args, &FinalPhaseArg);
1133 if (FinalPhase == phases::Link && Args.hasArg(options::OPT_emit_llvm)) {
1139 if (Arg *A = Args.getLastArg(options::OPT_Z_Joined))
1140 Diag(clang::diag::err_drv_use_of_Z_option) << A->getAsString(Args);
1143 if (Arg *A = Args.getLastArg(options::OPT__SLASH_Fo)) {
1148 Args.eraseArg(options::OPT__SLASH_Fo);
1153 Args.eraseArg(options::OPT__SLASH_Fo);
1158 if (Arg *A = Args.getLastArg(options::OPT__SLASH_Fa)) {
1164 Args.eraseArg(options::OPT__SLASH_Fa);
1169 if (Arg *A = Args.getLastArg(options::OPT__SLASH_Fe)) {
1173 Args.eraseArg(options::OPT__SLASH_Fe);
1196 if (Args.hasArg(options::OPT_Qunused_arguments))
1203 << InputArg->getAsString(Args)
1211 << InputArg->getAsString(Args)
1216 << InputArg->getAsString(Args)
1247 Current.reset(ConstructPhaseAction(Args, Phase, Current.release()));
1264 Args.ClaimAllArgs(options::OPT_CompileOnly_Group);
1265 Args.ClaimAllArgs(options::OPT_cl_compile_Group);
1269 Args.ClaimAllArgs(options::OPT_cl_ignored_Group);
1272 Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase,
1281 if (Args.hasArg(options::OPT_M, options::OPT_MM)) {
1285 if (!Args.hasFlag(options::OPT_frewrite_includes,
1296 if (Args.hasArg(options::OPT_fsyntax_only)) {
1303 if (Args.hasArg(options::OPT_fsyntax_only)) {
1305 } else if (Args.hasArg(options::OPT_rewrite_objc)) {
1307 } else if (Args.hasArg(options::OPT_rewrite_legacy_objc)) {
1309 } else if (Args.hasArg(options::OPT__analyze, options::OPT__analyze_auto)) {
1311 } else if (Args.hasArg(options::OPT__migrate)) {
1313 } else if (Args.hasArg(options::OPT_emit_ast)) {
1315 } else if (Args.hasArg(options::OPT_module_file_info)) {
1317 } else if (Args.hasArg(options::OPT_verify_pch)) {
1319 } else if (IsUsingLTO(Args)) {
1321 Args.hasArg(options::OPT_S) ? types::TY_LTO_IR : types::TY_LTO_BC;
1323 } else if (Args.hasArg(options::OPT_emit_llvm)) {
1325 Args.hasArg(options::OPT_S) ? types::TY_LLVM_IR : types::TY_LLVM_BC;
1338 bool Driver::IsUsingLTO(const ArgList &Args) const {
1339 if (Args.hasFlag(options::OPT_flto, options::OPT_fno_lto, false))
1506 // just using Args was better?
1590 static const char *MakeCLOutputFilename(const ArgList &Args, StringRef ArgValue,
1607 Args.hasArg(options::OPT__SLASH_LD, options::OPT__SLASH_LDd)) {
1615 return Args.MakeArgString(Filename.c_str());
1857 /// \brief Compute target triple from args.
1860 /// args passed to the driver and the default triple string.
1862 const ArgList &Args,
1865 if (const Arg *A = Args.getLastArg(options::OPT_target))
1879 if (Arg *A = Args.getLastArg(options::OPT_arch)) {
1887 if (Arg *A = Args.getLastArg(options::OPT_mlittle_endian,
1917 if (Arg *A = Args.getLastArg(options::OPT_m64, options::OPT_m32,
1938 const ToolChain &Driver::getToolChain(const ArgList &Args,
1940 llvm::Triple Target = computeTargetTriple(DefaultTargetTriple, Args,
1947 TC = new toolchains::AuroraUX(*this, Target, Args);
1952 TC = new toolchains::DarwinClang(*this, Target, Args);
1955 TC = new toolchains::DragonFly(*this, Target, Args);
1958 TC = new toolchains::OpenBSD(*this, Target, Args);
1961 TC = new toolchains::Bitrig(*this, Target, Args);
1964 TC = new toolchains::NetBSD(*this, Target, Args);
1967 TC = new toolchains::FreeBSD(*this, Target, Args);
1970 TC = new toolchains::Minix(*this, Target, Args);
1974 TC = new toolchains::Hexagon_TC(*this, Target, Args);
1976 TC = new toolchains::Linux(*this, Target, Args);
1979 TC = new toolchains::Solaris(*this, Target, Args);
1985 TC = new toolchains::Generic_ELF(*this, Target, Args);
1987 TC = new toolchains::MachO(*this, Target, Args);
1989 TC = new toolchains::Generic_GCC(*this, Target, Args);
1995 TC = new toolchains::Generic_ELF(*this, Target, Args);
1997 TC = new toolchains::Generic_GCC(*this, Target, Args);
2001 TC = new toolchains::Windows(*this, Target, Args);
2008 TC = new toolchains::TCEToolChain(*this, Target, Args);
2013 TC = new toolchains::Hexagon_TC(*this, Target, Args);
2017 TC = new toolchains::XCore(*this, Target, Args);
2021 TC = new toolchains::Generic_ELF(*this, Target, Args);
2025 TC = new toolchains::MachO(*this, Target, Args);
2028 TC = new toolchains::Generic_GCC(*this, Target, Args);
2103 bool clang::driver::isOptimizationLevelFast(const llvm::opt::ArgList &Args) {
2104 return Args.hasFlag(options::OPT_Ofast, options::OPT_O_Group, false);