[PATCH] D11500: Add amdopencl environment to triple

Matt Arsenault Matthew.Arsenault at amd.com
Fri Jul 24 18:29:02 PDT 2015


arsenm created this revision.
arsenm added a reviewer: echristo.
arsenm added a subscriber: llvm-commits.

This is used by the AMD x86 OpenCL implementation
to change some ABI details on Windows and Linux.


http://reviews.llvm.org/D11500

Files:
  include/llvm/ADT/Triple.h
  lib/Support/Triple.cpp
  unittests/ADT/TripleTest.cpp

Index: unittests/ADT/TripleTest.cpp
===================================================================
--- unittests/ADT/TripleTest.cpp
+++ unittests/ADT/TripleTest.cpp
@@ -319,6 +319,8 @@
   EXPECT_EQ(Triple::Darwin, T.getOS());
   EXPECT_EQ("i386-pc-darwin", T.getTriple());
 
+  T.setEnvironmentName("amdopencl");
+  EXPECT_EQ(Triple::AMDOpenCL, T.getEnvironment());
 }
 
 TEST(TripleTest, BitWidthPredicates) {
Index: lib/Support/Triple.cpp
===================================================================
--- lib/Support/Triple.cpp
+++ lib/Support/Triple.cpp
@@ -179,6 +179,7 @@
   case MSVC: return "msvc";
   case Itanium: return "itanium";
   case Cygnus: return "cygnus";
+  case AMDOpenCL: return "amdopencl";
   }
 
   llvm_unreachable("Invalid EnvironmentType!");
@@ -378,6 +379,7 @@
     .StartsWith("msvc", Triple::MSVC)
     .StartsWith("itanium", Triple::Itanium)
     .StartsWith("cygnus", Triple::Cygnus)
+    .StartsWith("amdopencl", Triple::AMDOpenCL)
     .Default(Triple::UnknownEnvironment);
 }
 
Index: include/llvm/ADT/Triple.h
===================================================================
--- include/llvm/ADT/Triple.h
+++ include/llvm/ADT/Triple.h
@@ -157,6 +157,7 @@
     MSVC,
     Itanium,
     Cygnus,
+    AMDOpenCL
   };
   enum ObjectFormatType {
     UnknownObjectFormat,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11500.30628.patch
Type: text/x-patch
Size: 1317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150725/f8141660/attachment.bin>


More information about the llvm-commits mailing list