r365329 - [RISCV][NFC] Make use of Triple::isRISCV

Alex Bradbury via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 8 08:07:12 PDT 2019


Author: asb
Date: Mon Jul  8 08:07:12 2019
New Revision: 365329

URL: http://llvm.org/viewvc/llvm-project?rev=365329&view=rev
Log:
[RISCV][NFC] Make use of Triple::isRISCV

Use new helper introduced in rL365327.

Modified:
    cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
    cfe/trunk/lib/Driver/ToolChains/Linux.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=365329&r1=365328&r2=365329&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Mon Jul  8 08:07:12 2019
@@ -933,10 +933,6 @@ static bool isMicroMips(const ArgList &A
   return A && A->getOption().matches(options::OPT_mmicromips);
 }
 
-static bool isRISCV(llvm::Triple::ArchType Arch) {
-  return Arch == llvm::Triple::riscv32 || Arch == llvm::Triple::riscv64;
-}
-
 static bool isMSP430(llvm::Triple::ArchType Arch) {
   return Arch == llvm::Triple::msp430;
 }
@@ -2312,7 +2308,7 @@ bool Generic_GCC::GCCInstallationDetecto
   } else if (TargetTriple.isMIPS()) {
     if (!findMIPSMultilibs(D, TargetTriple, Path, Args, Detected))
       return false;
-  } else if (isRISCV(TargetArch)) {
+  } else if (TargetTriple.isRISCV()) {
     findRISCVMultilibs(D, TargetTriple, Path, Args, Detected);
   } else if (isMSP430(TargetArch)) {
     findMSP430Multilibs(D, TargetTriple, Path, Args, Detected);

Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=365329&r1=365328&r2=365329&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Mon Jul  8 08:07:12 2019
@@ -276,8 +276,7 @@ Linux::Linux(const Driver &D, const llvm
   const bool IsAndroid = Triple.isAndroid();
   const bool IsMips = Triple.isMIPS();
   const bool IsHexagon = Arch == llvm::Triple::hexagon;
-  const bool IsRISCV =
-      Arch == llvm::Triple::riscv32 || Arch == llvm::Triple::riscv64;
+  const bool IsRISCV = Triple.isRISCV();
 
   if (IsMips && !SysRoot.empty())
     ExtraOpts.push_back("--sysroot=" + SysRoot);




More information about the cfe-commits mailing list