diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-01 04:30:05 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-01 04:30:05 +0000 |
commit | 1d489cf4a04ad0ad8ac2696e4eed0995f3a67288 (patch) | |
tree | 3b912e614568b53c49eabfe278f3f07b2d91a2c7 | |
parent | 7c3f8b3dafebc87b4b1492276f63b6cabbc7c59b (diff) |
Remove first argument from Arg::getValue; it's been unused since r105760.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167211 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Driver/Arg.h | 2 | ||||
-rw-r--r-- | lib/Driver/Arg.cpp | 12 | ||||
-rw-r--r-- | lib/Driver/ArgList.cpp | 12 | ||||
-rw-r--r-- | lib/Driver/Driver.cpp | 60 | ||||
-rw-r--r-- | lib/Driver/ToolChain.cpp | 8 | ||||
-rw-r--r-- | lib/Driver/ToolChains.cpp | 30 | ||||
-rw-r--r-- | lib/Driver/Tools.cpp | 120 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 110 | ||||
-rw-r--r-- | tools/driver/cc1as_main.cpp | 4 |
9 files changed, 179 insertions, 179 deletions
diff --git a/include/clang/Driver/Arg.h b/include/clang/Driver/Arg.h index 6be80d32c6..3b3829a634 100644 --- a/include/clang/Driver/Arg.h +++ b/include/clang/Driver/Arg.h @@ -96,7 +96,7 @@ namespace driver { void claim() const { getBaseArg().Claimed = true; } unsigned getNumValues() const { return Values.size(); } - const char *getValue(const ArgList &Args, unsigned N=0) const { + const char *getValue(unsigned N = 0) const { return Values[N]; } diff --git a/lib/Driver/Arg.cpp b/lib/Driver/Arg.cpp index 2431051e9d..93d70a9fef 100644 --- a/lib/Driver/Arg.cpp +++ b/lib/Driver/Arg.cpp @@ -85,14 +85,14 @@ void Arg::renderAsInput(const ArgList &Args, ArgStringList &Output) const { } for (unsigned i = 0, e = getNumValues(); i != e; ++i) - Output.push_back(getValue(Args, i)); + Output.push_back(getValue(i)); } void Arg::render(const ArgList &Args, ArgStringList &Output) const { switch (getOption().getRenderStyle()) { case Option::RenderValuesStyle: for (unsigned i = 0, e = getNumValues(); i != e; ++i) - Output.push_back(getValue(Args, i)); + Output.push_back(getValue(i)); break; case Option::RenderCommaJoinedStyle: { @@ -101,7 +101,7 @@ void Arg::render(const ArgList &Args, ArgStringList &Output) const { OS << getSpelling(); for (unsigned i = 0, e = getNumValues(); i != e; ++i) { if (i) OS << ','; - OS << getValue(Args, i); + OS << getValue(i); } Output.push_back(Args.MakeArgString(OS.str())); break; @@ -109,15 +109,15 @@ void Arg::render(const ArgList &Args, ArgStringList &Output) const { case Option::RenderJoinedStyle: Output.push_back(Args.GetOrMakeJoinedArgString( - getIndex(), getSpelling(), getValue(Args, 0))); + getIndex(), getSpelling(), getValue(0))); for (unsigned i = 1, e = getNumValues(); i != e; ++i) - Output.push_back(getValue(Args, i)); + Output.push_back(getValue(i)); break; case Option::RenderSeparateStyle: Output.push_back(Args.MakeArgString(getSpelling())); for (unsigned i = 0, e = getNumValues(); i != e; ++i) - Output.push_back(getValue(Args, i)); + Output.push_back(getValue(i)); break; } } diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp index 28d6b1e023..b3a43df980 100644 --- a/lib/Driver/ArgList.cpp +++ b/lib/Driver/ArgList.cpp @@ -211,7 +211,7 @@ bool ArgList::hasFlag(OptSpecifier Pos, OptSpecifier Neg, bool Default) const { StringRef ArgList::getLastArgValue(OptSpecifier Id, StringRef Default) const { if (Arg *A = getLastArg(Id)) - return A->getValue(*this); + return A->getValue(); return Default; } @@ -220,10 +220,10 @@ int ArgList::getLastArgIntValue(OptSpecifier Id, int Default, int Res = Default; if (Arg *A = getLastArg(Id)) { - if (StringRef(A->getValue(*this)).getAsInteger(10, Res)) { + if (StringRef(A->getValue()).getAsInteger(10, Res)) { if (Diags) Diags->Report(diag::err_drv_invalid_int_value) - << A->getAsString(*this) << A->getValue(*this); + << A->getAsString(*this) << A->getValue(); } } @@ -258,7 +258,7 @@ void ArgList::AddAllArgValues(ArgStringList &Output, OptSpecifier Id0, ie = filtered_end(); it != ie; ++it) { (*it)->claim(); for (unsigned i = 0, e = (*it)->getNumValues(); i != e; ++i) - Output.push_back((*it)->getValue(*this, i)); + Output.push_back((*it)->getValue(i)); } } @@ -271,10 +271,10 @@ void ArgList::AddAllArgsTranslated(ArgStringList &Output, OptSpecifier Id0, if (Joined) { Output.push_back(MakeArgString(StringRef(Translation) + - (*it)->getValue(*this, 0))); + (*it)->getValue(0))); } else { Output.push_back(Translation); - Output.push_back((*it)->getValue(*this, 0)); + Output.push_back((*it)->getValue(0)); } } } diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 6b0300b2c6..d4b1bae6dd 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -174,9 +174,9 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const { // Add the remaining values as Xlinker arguments. for (unsigned i = 0, e = A->getNumValues(); i != e; ++i) - if (StringRef(A->getValue(Args, i)) != "--no-demangle") + if (StringRef(A->getValue(i)) != "--no-demangle") DAL->AddSeparateArg(A, Opts->getOption(options::OPT_Xlinker), - A->getValue(Args, i)); + A->getValue(i)); continue; } @@ -186,21 +186,21 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const { // care to encourage this usage model. if (A->getOption().matches(options::OPT_Wp_COMMA) && A->getNumValues() == 2 && - (A->getValue(Args, 0) == StringRef("-MD") || - A->getValue(Args, 0) == StringRef("-MMD"))) { + (A->getValue(0) == StringRef("-MD") || + A->getValue(0) == StringRef("-MMD"))) { // Rewrite to -MD/-MMD along with -MF. - if (A->getValue(Args, 0) == StringRef("-MD")) + if (A->getValue(0) == StringRef("-MD")) DAL->AddFlagArg(A, Opts->getOption(options::OPT_MD)); else DAL->AddFlagArg(A, Opts->getOption(options::OPT_MMD)); DAL->AddSeparateArg(A, Opts->getOption(options::OPT_MF), - A->getValue(Args, 1)); + A->getValue(1)); continue; } // Rewrite reserved library names. if (A->getOption().matches(options::OPT_l)) { - StringRef Value = A->getValue(Args); + StringRef Value = A->getValue(); // Rewrite unless -nostdlib is present. if (!HasNostdlib && Value == "stdc++") { @@ -273,23 +273,23 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) { CCCIsCXX = Args->hasArg(options::OPT_ccc_cxx) || CCCIsCXX; CCCEcho = Args->hasArg(options::OPT_ccc_echo); if (const Arg *A = Args->getLastArg(options::OPT_ccc_gcc_name)) - CCCGenericGCCName = A->getValue(*Args); + CCCGenericGCCName = A->getValue(); CCCUsePCH = Args->hasFlag(options::OPT_ccc_pch_is_pch, options::OPT_ccc_pch_is_pth); // FIXME: DefaultTargetTriple is used by the target-prefixed calls to as/ld // and getToolChain is const. if (const Arg *A = Args->getLastArg(options::OPT_target)) - DefaultTargetTriple = A->getValue(*Args); + DefaultTargetTriple = A->getValue(); if (const Arg *A = Args->getLastArg(options::OPT_ccc_install_dir)) - Dir = InstalledDir = A->getValue(*Args); + Dir = InstalledDir = A->getValue(); for (arg_iterator it = Args->filtered_begin(options::OPT_B), ie = Args->filtered_end(); it != ie; ++it) { const Arg *A = *it; A->claim(); - PrefixDirs.push_back(A->getValue(*Args, 0)); + PrefixDirs.push_back(A->getValue(0)); } if (const Arg *A = Args->getLastArg(options::OPT__sysroot_EQ)) - SysRoot = A->getValue(*Args); + SysRoot = A->getValue(); if (Args->hasArg(options::OPT_nostdlib)) UseStdLib = false; @@ -381,7 +381,7 @@ void Driver::generateCompilationDiagnostics(Compilation &C, bool IgnoreInput = false; // Ignore input from stdin or any inputs that cannot be preprocessed. - if (!strcmp(it->second->getValue(C.getArgs()), "-")) { + if (!strcmp(it->second->getValue(), "-")) { Diag(clang::diag::note_drv_command_failed_diag_msg) << "Error generating preprocessed source(s) - ignoring input from stdin" "."; @@ -405,7 +405,7 @@ void Driver::generateCompilationDiagnostics(Compilation &C, it != ie; ++it) { Arg *A = *it; if (A->getOption().matches(options::OPT_arch)) { - StringRef ArchName = A->getValue(C.getArgs()); + StringRef ArchName = A->getValue(); ArchNames.insert(ArchName); } } @@ -556,7 +556,7 @@ void Driver::PrintOptions(const ArgList &Args) const { for (unsigned j = 0; j < A->getNumValues(); ++j) { if (j) llvm::errs() << ", "; - llvm::errs() << '"' << A->getValue(Args, j) << '"'; + llvm::errs() << '"' << A->getValue(j) << '"'; } llvm::errs() << "}\n"; } @@ -662,12 +662,12 @@ bool Driver::HandleImmediateArgs(const Compilation &C) { // FIXME: The following handlers should use a callback mechanism, we don't // know what the client would like to do. if (Arg *A = C.getArgs().getLastArg(options::OPT_print_file_name_EQ)) { - llvm::outs() << GetFilePath(A->getValue(C.getArgs()), TC) << "\n"; + llvm::outs() << GetFilePath(A->getValue(), TC) << "\n"; return false; } if (Arg *A = C.getArgs().getLastArg(options::OPT_print_prog_name_EQ)) { - llvm::outs() << GetProgramPath(A->getValue(C.getArgs()), TC) << "\n"; + llvm::outs() << GetProgramPath(A->getValue(), TC) << "\n"; return false; } @@ -730,7 +730,7 @@ static unsigned PrintActions1(const Compilation &C, Action *A, os << Action::getClassName(A->getKind()) << ", "; if (InputAction *IA = dyn_cast<InputAction>(A)) { - os << "\"" << IA->getInputArg().getValue(C.getArgs()) << "\""; + os << "\"" << IA->getInputArg().getValue() << "\""; } else if (BindArchAction *BIA = dyn_cast<BindArchAction>(A)) { os << '"' << BIA->getArchName() << '"' << ", {" << PrintActions1(C, *BIA->begin(), Ids) << "}"; @@ -790,7 +790,7 @@ void Driver::BuildUniversalActions(const ToolChain &TC, // Validate the option here; we don't save the type here because its // particular spelling may participate in other driver choices. llvm::Triple::ArchType Arch = - tools::darwin::getArchTypeForDarwinArchName(A->getValue(Args)); + tools::darwin::getArchTypeForDarwinArchName(A->getValue()); if (Arch == llvm::Triple::UnknownArch) { Diag(clang::diag::err_drv_invalid_arch_name) << A->getAsString(Args); @@ -798,8 +798,8 @@ void Driver::BuildUniversalActions(const ToolChain &TC, } A->claim(); - if (ArchNames.insert(A->getValue(Args))) - Archs.push_back(A->getValue(Args)); + if (ArchNames.insert(A->getValue())) + Archs.push_back(A->getValue()); } } @@ -894,7 +894,7 @@ void Driver::BuildInputs(const ToolChain &TC, const DerivedArgList &Args, Arg *A = *it; if (A->getOption().getKind() == Option::InputClass) { - const char *Value = A->getValue(Args); + const char *Value = A->getValue(); types::ID Ty = types::TY_INVALID; // Infer the input type if necessary. @@ -962,7 +962,7 @@ void Driver::BuildInputs(const ToolChain &TC, const DerivedArgList &Args, SmallString<64> Path(Value); if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory)) { if (!llvm::sys::path::is_absolute(Path.str())) { - SmallString<64> Directory(WorkDir->getValue(Args)); + SmallString<64> Directory(WorkDir->getValue()); llvm::sys::path::append(Directory, Value); Path.assign(Directory); } @@ -983,14 +983,14 @@ void Driver::BuildInputs(const ToolChain &TC, const DerivedArgList &Args, } else if (A->getOption().matches(options::OPT_x)) { InputTypeArg = A; - InputType = types::lookupTypeForTypeSpecifier(A->getValue(Args)); + InputType = types::lookupTypeForTypeSpecifier(A->getValue()); A->claim(); // Follow gcc behavior and treat as linker input for invalid -x // options. Its not clear why we shouldn't just revert to unknown; but // this isn't very important, we might as well be bug compatible. if (!InputType) { - Diag(clang::diag::err_drv_unknown_language) << A->getValue(Args); + Diag(clang::diag::err_drv_unknown_language) << A->getValue(); InputType = types::TY_Object; } } @@ -1213,7 +1213,7 @@ void Driver::BuildJobs(Compilation &C) const { const char *LinkingOutput = 0; if (isa<LipoJobAction>(A)) { if (FinalOutput) - LinkingOutput = FinalOutput->getValue(C.getArgs()); + LinkingOutput = FinalOutput->getValue(); else LinkingOutput = DefaultImageName.c_str(); } @@ -1326,7 +1326,7 @@ void Driver::BuildJobsForAction(Compilation &C, const Arg &Input = IA->getInputArg(); Input.claim(); if (Input.getOption().matches(options::OPT_INPUT)) { - const char *Name = Input.getValue(C.getArgs()); + const char *Name = Input.getValue(); Result = InputInfo(Name, A->getType(), Name); } else Result = InputInfo(&Input, A->getType(), ""); @@ -1415,7 +1415,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, if (AtTopLevel && !isa<DsymutilJobAction>(JA) && !isa<VerifyJobAction>(JA)) { if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o)) - return C.addResultFile(FinalOutput->getValue(C.getArgs())); + return C.addResultFile(FinalOutput->getValue()); } // Default to writing to stdout? @@ -1614,7 +1614,7 @@ static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple, StringRef DarwinArchName) { // FIXME: Already done in Compilation *Driver::BuildCompilation if (const Arg *A = Args.getLastArg(options::OPT_target)) - DefaultTargetTriple = A->getValue(Args); + DefaultTargetTriple = A->getValue(); llvm::Triple Target(llvm::Triple::normalize(DefaultTargetTriple)); @@ -1630,7 +1630,7 @@ static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple, // Handle the Darwin '-arch' flag. if (Arg *A = Args.getLastArg(options::OPT_arch)) { llvm::Triple::ArchType DarwinArch - = tools::darwin::getArchTypeForDarwinArchName(A->getValue(Args)); + = tools::darwin::getArchTypeForDarwinArchName(A->getValue()); if (DarwinArch != llvm::Triple::UnknownArch) Target.setArch(DarwinArch); } diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index 16c5ae6d9d..9dcdafc872 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -71,13 +71,13 @@ static const char *getARMTargetCPU(const ArgList &Args, // FIXME: Warn on inconsistent use of -mcpu and -march. // If we have -mcpu=, use that. if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) - return A->getValue(Args); + return A->getValue(); } StringRef MArch; if (Arg *A = Args.getLastArg(options::OPT_march_EQ)) { // Otherwise, if we have -march= choose the base CPU for that arch. - MArch = A->getValue(Args); + MArch = A->getValue(); } else { // Otherwise, use the Arch from the triple. MArch = Triple.getArchName(); @@ -189,7 +189,7 @@ ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType( const ArgList &Args) const { if (Arg *A = Args.getLastArg(options::OPT_rtlib_EQ)) { - StringRef Value = A->getValue(Args); + StringRef Value = A->getValue(); if (Value == "compiler-rt") return ToolChain::RLT_CompilerRT; if (Value == "libgcc") @@ -203,7 +203,7 @@ ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType( ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{ if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) { - StringRef Value = A->getValue(Args); + StringRef Value = A->getValue(); if (Value == "libc++") return ToolChain::CST_Libcxx; if (Value == "libstdc++") diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index eca5b3b668..67258bc434 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -140,11 +140,11 @@ StringRef Darwin::getDarwinArchName(const ArgList &Args) const { case llvm::Triple::thumb: case llvm::Triple::arm: { if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) - if (const char *Arch = GetArmArchForMArch(A->getValue(Args))) + if (const char *Arch = GetArmArchForMArch(A->getValue())) return Arch; if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) - if (const char *Arch = GetArmArchForMCpu(A->getValue(Args))) + if (const char *Arch = GetArmArchForMCpu(A->getValue())) return Arch; return "arm"; @@ -326,7 +326,7 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, break; default: getDriver().Diag(diag::err_drv_unsupported_rtlib_for_platform) - << Args.getLastArg(options::OPT_rtlib_EQ)->getValue(Args) << "darwin"; + << Args.getLastArg(options::OPT_rtlib_EQ)->getValue() << "darwin"; return; } @@ -476,7 +476,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { if (!iOSVersion && !iOSSimVersion) { for (arg_iterator it = Args.filtered_begin(options::OPT_D), ie = Args.filtered_end(); it != ie; ++it) { - StringRef define = (*it)->getValue(Args); + StringRef define = (*it)->getValue(); if (define.startswith(SimulatorVersionDefineName())) { unsigned Major = 0, Minor = 0, Micro = 0; if (GetVersionFromSimulatorDefine(define, Major, Minor, Micro) && @@ -522,7 +522,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { if (iOSTarget.empty()) { if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) { StringRef first, second; - StringRef isysroot = A->getValue(Args); + StringRef isysroot = A->getValue(); llvm::tie(first, second) = isysroot.split(StringRef("SDKs/iPhoneOS")); if (second != "") iOSTarget = second.substr(0,3); @@ -591,7 +591,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { bool HadExtra; if (OSXVersion) { assert((!iOSVersion && !iOSSimVersion) && "Unknown target platform!"); - if (!Driver::GetReleaseVersion(OSXVersion->getValue(Args), Major, Minor, + if (!Driver::GetReleaseVersion(OSXVersion->getValue(), Major, Minor, Micro, HadExtra) || HadExtra || Major != 10 || Minor >= 100 || Micro >= 100) getDriver().Diag(diag::err_drv_invalid_version_number) @@ -599,7 +599,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { } else { const Arg *Version = iOSVersion ? iOSVersion : iOSSimVersion; assert(Version && "Unknown target platform!"); - if (!Driver::GetReleaseVersion(Version->getValue(Args), Major, Minor, + if (!Driver::GetReleaseVersion(Version->getValue(), Major, Minor, Micro, HadExtra) || HadExtra || Major >= 10 || Minor >= 100 || Micro >= 100) getDriver().Diag(diag::err_drv_invalid_version_number) @@ -637,7 +637,7 @@ void DarwinClang::AddCXXStdlibLibArgs(const ArgList &Args, // Check in the sysroot first. bool Exists; if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) { - llvm::sys::Path P(A->getValue(Args)); + llvm::sys::Path P(A->getValue()); P.appendComponent("usr"); P.appendComponent("lib"); P.appendComponent("libstdc++.dylib"); @@ -714,14 +714,14 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, // Skip this argument unless the architecture matches either the toolchain // triple arch, or the arch being bound. llvm::Triple::ArchType XarchArch = - tools::darwin::getArchTypeForDarwinArchName(A->getValue(Args, 0)); + tools::darwin::getArchTypeForDarwinArchName(A->getValue(0)); if (!(XarchArch == getArch() || (BoundArch && XarchArch == tools::darwin::getArchTypeForDarwinArchName(BoundArch)))) continue; Arg *OriginalArg = A; - unsigned Index = Args.getBaseArgs().MakeIndex(A->getValue(Args, 1)); + unsigned Index = Args.getBaseArgs().MakeIndex(A->getValue(1)); unsigned Prev = Index; Arg *XarchArg = Opts.ParseOneArg(Args, Index); @@ -756,7 +756,7 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, for (unsigned i = 0, e = A->getNumValues(); i != e; ++i) { DAL->AddSeparateArg(OriginalArg, Opts.getOption(options::OPT_Zlinker_input), - A->getValue(Args, i)); + A->getValue(i)); } continue; @@ -779,7 +779,7 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, case options::OPT_dependency_file: DAL->AddSeparateArg(A, Opts.getOption(options::OPT_MF), - A->getValue(Args)); + A->getValue()); break; case options::OPT_gfull: @@ -1068,7 +1068,7 @@ bool Generic_GCC::GCCVersion::operator<(const GCCVersion &RHS) const { static StringRef getGCCToolchainDir(const ArgList &Args) { const Arg *A = Args.getLastArg(options::OPT_gcc_toolchain); if (A) - return A->getValue(Args); + return A->getValue(); return GCC_INSTALL_PREFIX; } @@ -1326,7 +1326,7 @@ Generic_GCC::GCCInstallationDetector::GCCInstallationDetector( // FIXME: There is the same routine in the Tools.cpp. static bool hasMipsN32ABIArg(const ArgList &Args) { Arg *A = Args.getLastArg(options::OPT_mabi_EQ); - return A && (A->getValue(Args) == StringRef("n32")); + return A && (A->getValue() == StringRef("n32")); } static StringRef getTargetMultiarchSuffix(llvm::Triple::ArchType TargetArch, @@ -2139,7 +2139,7 @@ static bool isMipsR2Arch(llvm::Triple::ArchType Arch, if (A->getOption().matches(options::OPT_mips_CPUs_Group)) return A->getOption().matches(options::OPT_mips32r2); - return A->getValue(Args) == StringRef("mips32r2"); + return A->getValue() == StringRef("mips32r2"); } static StringRef getMultilibDir(const llvm::Triple &Triple, diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 95db821f5f..d85bc4adbd 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -248,7 +248,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, // Determine the output location. const char *DepFile; if (Arg *MF = Args.getLastArg(options::OPT_MF)) { - DepFile = MF->getValue(Args); + DepFile = MF->getValue(); C.addFailureResultFile(DepFile); } else if (Output.getType() == types::TY_Dependencies) { DepFile = Output.getFilename(); @@ -270,7 +270,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, // when we are only generating a dependency file. Arg *OutputOpt = Args.getLastArg(options::OPT_o); if (OutputOpt && Output.getType() != types::TY_Dependencies) { - DepTarget = OutputOpt->getValue(Args); + DepTarget = OutputOpt->getValue(); } else { // Otherwise derive from the base input. // @@ -310,7 +310,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, if (A->getOption().matches(options::OPT_MQ)) { CmdArgs.push_back("-MT"); SmallString<128> Quoted; - QuoteTarget(A->getValue(Args), Quoted); + QuoteTarget(A->getValue(), Quoted); CmdArgs.push_back(Args.MakeArgString(Quoted)); // -MT flag - no change @@ -338,7 +338,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, bool FoundPTH = false; bool FoundPCH = false; - llvm::sys::Path P(A->getValue(Args)); + llvm::sys::Path P(A->getValue()); bool Exists; if (UsePCH) { P.appendSuffix("pch"); @@ -488,7 +488,7 @@ static std::string getARMTargetCPU(const ArgList &Args, // If we have -mcpu=, use that. if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { - StringRef MCPU = A->getValue(Args); + StringRef MCPU = A->getValue(); // Handle -mcpu=native. if (MCPU == "native") return llvm::sys::getHostCPUName(); @@ -499,7 +499,7 @@ static std::string getARMTargetCPU(const ArgList &Args, StringRef MArch; if (Arg *A = Args.getLastArg(options::OPT_march_EQ)) { // Otherwise, if we have -march= choose the base CPU for that arch. - MArch = A->getValue(Args); + MArch = A->getValue(); } else { // Otherwise, use the Arch from the triple. MArch = Triple.getArchName(); @@ -563,7 +563,7 @@ static bool isSignedCharDefault(const llvm::Triple &Triple) { // frontend target. static void addFPUArgs(const Driver &D, const Arg *A, const ArgList &Args, ArgStringList &CmdArgs) { - StringRef FPU = A->getValue(Args); + StringRef FPU = A->getValue(); // Set the target features based on the FPU. if (FPU == "fpa" || FPU == "fpe2" || FPU == "fpe3" || FPU == "maverick") { @@ -601,7 +601,7 @@ static void addFPUArgs(const Driver &D, const Arg *A, const ArgList &Args, // Handle -mfpmath=. static void addFPMathArgs(const Driver &D, const Arg *A, const ArgList &Args, ArgStringList &CmdArgs, StringRef CPU) { - StringRef FPMath = A->getValue(Args); + StringRef FPMath = A->getValue(); // Set the target features based on the FPMath. if (FPMath == "neon") { @@ -636,7 +636,7 @@ static StringRef getARMFloatABI(const Driver &D, else if (A->getOption().matches(options::OPT_mhard_float)) FloatABI = "hard"; else { - FloatABI = A->getValue(Args); + FloatABI = A->getValue(); if (FloatABI != "soft" && FloatABI != "softfp" && FloatABI != "hard") { D.Diag(diag::err_drv_invalid_mfloat_abi) << A->getAsString(Args); @@ -712,7 +712,7 @@ void Clang::AddARMTargetArgs(const ArgList &Args, // FIXME: Support -meabi. const char *ABIName = 0; if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) { - ABIName = A->getValue(Args); + ABIName = A->getValue(); } else if (Triple.isOSDarwin()) { // The backend is hardwired to assume AAPCS for M-class processors, ensure // the frontend matches that. @@ -852,11 +852,11 @@ static void getMipsCPUAndABI(const ArgList &Args, if (A->getOption().matches(options::OPT_mips_CPUs_Group)) CPUName = getMipsCPUFromAlias(*A); else - CPUName = A->getValue(Args); + CPUName = A->getValue(); } if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) - ABIName = A->getValue(Args); + ABIName = A->getValue(); // Setup default CPU and ABI names. if (CPUName.empty() && ABIName.empty()) { @@ -906,7 +906,7 @@ static StringRef getMipsFloatABI(const Driver &D, const ArgList &Args) { else if (A->getOption().matches(options::OPT_mhard_float)) FloatABI = "hard"; else { - FloatABI = A->getValue(Args); + FloatABI = A->getValue(); if (FloatABI != "soft" && FloatABI != "single" && FloatABI != "hard") { D.Diag(diag::err_drv_invalid_mfloat_abi) << A->getAsString(Args); FloatABI = "hard"; @@ -990,7 +990,7 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args, "dspr2"); if (Arg *A = Args.getLastArg(options::OPT_G)) { - StringRef v = A->getValue(Args); + StringRef v = A->getValue(); CmdArgs.push_back("-mllvm"); CmdArgs.push_back(Args.MakeArgString("-mips-ssection-threshold=" + v)); A->claim(); @@ -1000,7 +1000,7 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args, /// getPPCTargetCPU - Get the (LLVM) name of the PowerPC cpu we are targeting. static std::string getPPCTargetCPU(const ArgList &Args) { if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { - StringRef CPUName = A->getValue(Args); + StringRef CPUName = A->getValue(); if (CPUName == "native") { std::string CPU = llvm::sys::getHostCPUName(); @@ -1071,7 +1071,7 @@ void Clang::AddSparcTargetArgs(const ArgList &Args, if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) { CmdArgs.push_back("-target-cpu"); - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); } // Select the float ABI as determined by -msoft-float, -mhard-float, and @@ -1124,7 +1124,7 @@ void Clang::AddX86TargetArgs(const ArgList &Args, const char *CPUName = 0; if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) { - if (StringRef(A->getValue(Args)) == "native") { + if (StringRef(A->getValue()) == "native") { // FIXME: Reject attempts to use -march=native unless the target matches // the host. // @@ -1134,7 +1134,7 @@ void Clang::AddX86TargetArgs(const ArgList &Args, if (!CPU.empty() && CPU != "generic") CPUName = Args.MakeArgString(CPU); } else - CPUName = A->getValue(Args); + CPUName = A->getValue(); } // Select the default CPU if none was given (or detection failed). @@ -1230,7 +1230,7 @@ static Arg* getLastHexagonArchArg (const ArgList &Args) A->claim(); } else if ((*it)->getOption().matches(options::OPT_m_Joined)){ - StringRef Value = (*it)->getValue(Args,0); + StringRef Value = (*it)->getValue(0); if (Value.startswith("v")) { A = *it; A->claim(); @@ -1247,7 +1247,7 @@ static StringRef getHexagonTargetCPU(const ArgList &Args) // Select the default CPU (v4) if none was given or detection failed. if ((A = getLastHexagonArchArg (Args))) { - WhichHexagon = A->getValue(Args); + WhichHexagon = A->getValue(); if (WhichHexagon == "") return "v4"; else @@ -1272,7 +1272,7 @@ void Clang::AddHexagonTargetArgs(const ArgList &Args, if (Arg *A = Args.getLastArg(options::OPT_G, options::OPT_msmall_data_threshold_EQ)) { std::string SmallDataThreshold="-small-data-threshold="; - SmallDataThreshold += A->getValue(Args); + SmallDataThreshold += A->getValue(); CmdArgs.push_back ("-mllvm"); CmdArgs.push_back(Args.MakeArgString(SmallDataThreshold)); A->claim(); @@ -1588,7 +1588,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, A->claim(); for (unsigned i = 0, e = A->getNumValues(); i != e; ++i) { - StringRef Value = A->getValue(Args, i); + StringRef Value = A->getValue(i); if (Value == "-force_cpusubtype_ALL") { // Do nothing, this is the default and we don't support anything else. @@ -1697,7 +1697,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // reasons. CmdArgs.push_back("-analyzer-output"); if (Arg *A = Args.getLastArg(options::OPT__analyzer_output)) - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); else CmdArgs.push_back("plist"); @@ -1787,7 +1787,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Arg *A = Args.getLastArg(options::OPT_mregparm_EQ)) { CmdArgs.push_back("-mregparm"); - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); } if (Args.hasFlag(options::OPT_mrtd, options::OPT_mno_rtd, false)) @@ -1903,7 +1903,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, options::OPT_fno_fast_math, options::OPT_ffp_contract)) { if (A->getOption().getID() == options::OPT_ffp_contract) { - StringRef Val = A->getValue(Args); + StringRef Val = A->getValue(); if (Val == "fast" || Val == "on" || Val == "off") { CmdArgs.push_back(Args.MakeArgString("-ffp-contract=" + Val)); } else { @@ -1975,7 +1975,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Arg *A = Args.getLastArg(options::OPT_flimited_precision_EQ)) { CmdArgs.push_back("-mlimit-float-precision"); - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); } // FIXME: Handle -mtune=. @@ -1983,7 +1983,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) { CmdArgs.push_back("-mcode-model"); - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); } // Add target specific cpu and features flags. @@ -2027,7 +2027,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Pass the linker version in use. if (Arg *A = Args.getLastArg(options::OPT_mlinker_version_EQ)) { CmdArgs.push_back("-target-linker-version"); - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); } // -mno-omit-leaf-frame-pointer is the default on Darwin. @@ -2141,7 +2141,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, case options::OPT_ccc_arcmt_migrate: CmdArgs.push_back("-arcmt-migrate"); CmdArgs.push_back("-mt-migrate-directory"); - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_report_output); Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_emit_arc_errors); @@ -2156,7 +2156,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, << A->getAsString(Args) << "-ccc-arcmt-migrate"; } CmdArgs.push_back("-mt-migrate-directory"); - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); if (!Args.hasArg(options::OPT_objcmt_migrate_literals, options::OPT_objcmt_migrate_subscripting)) { @@ -2188,7 +2188,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (A->getOption().matches(options::OPT_O4)) CmdArgs.push_back("-O3"); else if (A->getOption().matches(options::OPT_O) && - A->getValue(Args)[0] == '\0') + A->getValue()[0] == '\0') CmdArgs.push_back("-O2"); else A->render(Args, CmdArgs); @@ -2279,18 +2279,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Arg *A = Args.getLastArg(options::OPT_ftemplate_depth_, options::OPT_ftemplate_depth_EQ)) { CmdArgs.push_back("-ftemplate-depth"); - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_fconstexpr_depth_EQ)) { CmdArgs.push_back("-fconstexpr-depth"); - CmdArgs.push_back(A->getValue(Args)); + CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_Wlarge_by_value_copy_EQ, options::OPT_Wlarge_by_value_copy_def)) { if (A->getNumValues()) { - StringRef bytes = A->getValue(Args); + StringRef bytes = A->getValue(); CmdArgs.push_back(Args.MakeArgString("-Wlarge-by-value-copy=" + bytes)); } else CmdArgs.push_back("-Wlarge-by-value-copy=64"); // default value @@ -2299,7 +2299,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Arg *A = Args.getLastArg(options::OPT_fbounds_checking, options::OPT_fbounds_checking_EQ)) { if (A->getNumValues()) { - StringRef val = A->getValue(Args); + StringRef val = A->getValue(); CmdArgs.push_back(Args.MakeArgString("-fbounds-checking=" + val)); } else CmdArgs.push_back("-fbounds-checking=1"); @@ -2310,39 +2310,39 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Arg *A = Args.getLastArg(optio |