]> granicus.if.org Git - clang/commitdiff
[RISCV][NFC] Make use of Triple::isRISCV
authorAlex Bradbury <asb@lowrisc.org>
Mon, 8 Jul 2019 15:07:12 +0000 (15:07 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Mon, 8 Jul 2019 15:07:12 +0000 (15:07 +0000)
Use new helper introduced in rL365327.

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

lib/Driver/ToolChains/Gnu.cpp
lib/Driver/ToolChains/Linux.cpp

index c8520968e45ee53645f3218c398da367c55742b4..33cdd3585c29766e84b9a8e1fc951c92c1237731 100644 (file)
@@ -933,10 +933,6 @@ static bool isMicroMips(const ArgList &Args) {
   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::GCCInstallationDetector::ScanGCCForMultilibs(
   } 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);
index 7168b7f1192afb22a6e78eeb62d47aad28cab13f..4c82912a16f7290c6dae9331f0a9aa4b8fe00f0e 100644 (file)
@@ -276,8 +276,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
   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);