]> granicus.if.org Git - clang/commitdiff
Change final case of Driver::getToolChain to "if/else/else/else..."
authorDouglas Katzman <dougk@google.com>
Tue, 26 May 2015 18:01:33 +0000 (18:01 +0000)
committerDouglas Katzman <dougk@google.com>
Tue, 26 May 2015 18:01:33 +0000 (18:01 +0000)
Differential Revision: http://reviews.llvm.org/D9939

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238225 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp

index 7e52b1fbca9703bf2d6165294906e82dea159595..65d0049b0b49e00f6fe4c031c4c1880472aab940 100644 (file)
@@ -2025,8 +2025,8 @@ static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple,
 
 const ToolChain &Driver::getToolChain(const ArgList &Args,
                                       StringRef DarwinArchName) const {
-  llvm::Triple Target = computeTargetTriple(DefaultTargetTriple, Args,
-                                            DarwinArchName);
+  llvm::Triple Target =
+      computeTargetTriple(DefaultTargetTriple, Args, DarwinArchName);
 
   ToolChain *&TC = ToolChains[Target.str()];
   if (!TC) {
@@ -2097,29 +2097,20 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
       }
       break;
     default:
-      // TCE is an OSless target
-      if (Target.getArchName() == "tce") {
+      // Of these targets, Hexagon is the only one that might have
+      // an OS of Linux, in which case it got handled above already.
+      if (Target.getArchName() == "tce")
         TC = new toolchains::TCEToolChain(*this, Target, Args);
-        break;
-      }
-      // If Hexagon is configured as an OSless target
-      if (Target.getArch() == llvm::Triple::hexagon) {
+      else if (Target.getArch() == llvm::Triple::hexagon)
         TC = new toolchains::Hexagon_TC(*this, Target, Args);
-        break;
-      }
-      if (Target.getArch() == llvm::Triple::xcore) {
+      else if (Target.getArch() == llvm::Triple::xcore)
         TC = new toolchains::XCore(*this, Target, Args);
-        break;
-      }
-      if (Target.isOSBinFormatELF()) {
+      else if (Target.isOSBinFormatELF())
         TC = new toolchains::Generic_ELF(*this, Target, Args);
-        break;
-      }
-      if (Target.isOSBinFormatMachO()) {
+      else if (Target.isOSBinFormatMachO())
         TC = new toolchains::MachO(*this, Target, Args);
-        break;
-      }
-      TC = new toolchains::Generic_GCC(*this, Target, Args);
+      else
+        TC = new toolchains::Generic_GCC(*this, Target, Args);
       break;
     }
   }