]> granicus.if.org Git - clang/commitdiff
[Mips] Group MIPS-related options checking function in one place.
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 9 Oct 2013 12:12:39 +0000 (12:12 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 9 Oct 2013 12:12:39 +0000 (12:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192293 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index 48e5089c980df86ce1821152a9d795680a178d80..83345c5bcd138630bf455787a70a4aacc05c8011 100644 (file)
@@ -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, ToolChain::path_list &Paths) {
   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::Triple &Triple, const ArgList &Args)
     // 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);