r192293 - [Mips] Group MIPS-related options checking function in one place.
Simon Atanasyan
simon at atanasyan.com
Wed Oct 9 05:12:39 PDT 2013
Author: atanasyan
Date: Wed Oct 9 07:12:39 2013
New Revision: 192293
URL: http://llvm.org/viewvc/llvm-project?rev=192293&view=rev
Log:
[Mips] Group MIPS-related options checking function in one place.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=192293&r1=192292&r2=192293&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Oct 9 07:12:39 2013
@@ -1294,6 +1294,13 @@ static bool isMips16(const ArgList &Args
return A && A->getOption().matches(options::OPT_mips16);
}
+static bool isMips32r2(const ArgList &Args) {
+ Arg *A = Args.getLastArg(options::OPT_march_EQ,
+ options::OPT_mcpu_EQ);
+
+ return A && A->getValue() == StringRef("mips32r2");
+}
+
static bool isMicroMips(const ArgList &Args) {
Arg *A = Args.getLastArg(options::OPT_mmicromips,
options::OPT_mno_micromips);
@@ -2174,13 +2181,6 @@ static void addPathIfExists(Twine Path,
if (llvm::sys::fs::exists(Path)) Paths.push_back(Path.str());
}
-static bool isMipsR2Arch(const ArgList &Args) {
- Arg *A = Args.getLastArg(options::OPT_march_EQ,
- options::OPT_mcpu_EQ);
-
- return A && A->getValue() == StringRef("mips32r2");
-}
-
static StringRef getMultilibDir(const llvm::Triple &Triple,
const ArgList &Args) {
if (!isMipsArch(Triple.getArch()))
@@ -2276,7 +2276,7 @@ Linux::Linux(const Driver &D, const llvm
// the parent prefix of the GCC installation.
// FIXME: It would be cleaner to model this as a variant of multilib. IE,
// instead of 'lib64' it would be 'lib/el'.
- if (IsAndroid && IsMips && isMipsR2Arch(Args)) {
+ if (IsAndroid && IsMips && isMips32r2(Args)) {
assert(GCCInstallation.getBiarchSuffix().empty() &&
"Unexpected bi-arch suffix");
addPathIfExists(GCCInstallation.getInstallPath() + "/mips-r2", Paths);
More information about the cfe-commits
mailing list