[PATCH] D120381: [SPARC] Add isSparc for SPARC

Xiaodong Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 19:41:58 PST 2022


XiaodongLoong created this revision.
Herald added subscribers: dexonsmith, fedor.sergeev, jyknight.
XiaodongLoong requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120381

Files:
  llvm/include/llvm/ADT/Triple.h


Index: llvm/include/llvm/ADT/Triple.h
===================================================================
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -200,7 +200,6 @@
     ELFIAMCU,
     TvOS,       // Apple tvOS
     WatchOS,    // Apple watchOS
-    DriverKit,  // Apple DriverKit
     Mesa3D,
     Contiki,
     AMDPAL,     // AMD PAL Runtime
@@ -363,9 +362,6 @@
   /// with WatchOS or generic triples.
   VersionTuple getWatchOSVersion() const;
 
-  /// Parse the version number as with getOSVersion.
-  VersionTuple getDriverKitVersion() const;
-
   /// @}
   /// @name Direct Component Access
   /// @{
@@ -468,14 +464,11 @@
     return getSubArch() == Triple::ARMSubArch_v7k;
   }
 
-  /// Is this an Apple DriverKit triple.
-  bool isDriverKit() const { return getOS() == Triple::DriverKit; }
-
   bool isOSzOS() const { return getOS() == Triple::ZOS; }
 
   /// Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
   bool isOSDarwin() const {
-    return isMacOSX() || isiOS() || isWatchOS() || isDriverKit();
+    return isMacOSX() || isiOS() || isWatchOS();
   }
 
   bool isSimulatorEnvironment() const {
@@ -824,6 +817,12 @@
     return getArch() == Triple::riscv32 || getArch() == Triple::riscv64;
   }
 
+  /// Tests whether the target is Sparc.
+  bool isSparc() const {
+    return getArch() == Triple::sparc || getArch() == Triple::sparcv9 ||
+           getArch() == Triple::sparcel;
+  }
+
   /// Tests whether the target is SystemZ.
   bool isSystemZ() const {
     return getArch() == Triple::systemz;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120381.410695.patch
Type: text/x-patch
Size: 1554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220223/794348f0/attachment-0001.bin>


More information about the llvm-commits mailing list