[llvm-commits] [llvm] r153882 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp unittests/ADT/TripleTest.cpp
Hal Finkel
hfinkel at anl.gov
Mon Apr 2 11:31:34 PDT 2012
Author: hfinkel
Date: Mon Apr 2 13:31:33 2012
New Revision: 153882
URL: http://llvm.org/viewvc/llvm-project?rev=153882&view=rev
Log:
Add triple support for the IBM BG/P and BG/Q supercomputers.
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
llvm/trunk/lib/Support/Triple.cpp
llvm/trunk/unittests/ADT/TripleTest.cpp
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=153882&r1=153881&r2=153882&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Mon Apr 2 13:31:33 2012
@@ -72,7 +72,9 @@
Apple,
PC,
- SCEI
+ SCEI,
+ BGP,
+ BGQ
};
enum OSType {
UnknownOS,
@@ -95,7 +97,8 @@
Haiku,
Minix,
RTEMS,
- NativeClient
+ NativeClient,
+ CNK // BG/P Compute-Node Kernel
};
enum EnvironmentType {
UnknownEnvironment,
Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=153882&r1=153881&r2=153882&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Mon Apr 2 13:31:33 2012
@@ -88,6 +88,8 @@
case Apple: return "apple";
case PC: return "pc";
case SCEI: return "scei";
+ case BGP: return "bgp";
+ case BGQ: return "bgq";
}
llvm_unreachable("Invalid VendorType!");
@@ -116,6 +118,7 @@
case Minix: return "minix";
case RTEMS: return "rtems";
case NativeClient: return "nacl";
+ case CNK: return "cnk";
}
llvm_unreachable("Invalid OSType");
@@ -258,6 +261,8 @@
.Case("apple", Triple::Apple)
.Case("pc", Triple::PC)
.Case("scei", Triple::SCEI)
+ .Case("bgp", Triple::BGP)
+ .Case("bgq", Triple::BGQ)
.Default(Triple::UnknownVendor);
}
@@ -282,6 +287,7 @@
.StartsWith("minix", Triple::Minix)
.StartsWith("rtems", Triple::RTEMS)
.StartsWith("nacl", Triple::NativeClient)
+ .StartsWith("cnk", Triple::CNK)
.Default(Triple::UnknownOS);
}
Modified: llvm/trunk/unittests/ADT/TripleTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/TripleTest.cpp?rev=153882&r1=153881&r2=153882&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp (original)
+++ llvm/trunk/unittests/ADT/TripleTest.cpp Mon Apr 2 13:31:33 2012
@@ -87,6 +87,24 @@
EXPECT_EQ(Triple::Linux, T.getOS());
EXPECT_EQ(Triple::GNU, T.getEnvironment());
+ T = Triple("powerpc-bgp-linux");
+ EXPECT_EQ(Triple::ppc, T.getArch());
+ EXPECT_EQ(Triple::BGP, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+
+ T = Triple("powerpc-bgp-cnk");
+ EXPECT_EQ(Triple::ppc, T.getArch());
+ EXPECT_EQ(Triple::BGP, T.getVendor());
+ EXPECT_EQ(Triple::CNK, T.getOS());
+ EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+
+ T = Triple("powerpc64-bgq-linux");
+ EXPECT_EQ(Triple::ppc64, T.getArch());
+ EXPECT_EQ(Triple::BGQ, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+
T = Triple("powerpc-dunno-notsure");
EXPECT_EQ(Triple::ppc, T.getArch());
EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
More information about the llvm-commits
mailing list