Drop the OS from the WebAssembly target triple for now.
authorDan Gohman <dan433584@gmail.com>
Tue, 30 Jun 2015 03:52:25 +0000 (03:52 +0000)
committerDan Gohman <dan433584@gmail.com>
Tue, 30 Jun 2015 03:52:25 +0000 (03:52 +0000)
This unbreaks TripleTest.Normalization. We'll have to come up with a new
plan for the OS component of the target triple for WebAssembly.

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

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

index f26cadb0154dc2ff49449c574e47b03d7aad802e..06f5870119c8f539a8ed43da143c35239161d149 100644 (file)
@@ -153,8 +153,7 @@ public:
     NVCL,       // NVIDIA OpenCL
     AMDHSA,     // AMD HSA Runtime
     PS4,
-    WebAssembly,
-    LastOSType = WebAssembly
+    LastOSType = PS4
   };
   enum EnvironmentType {
     UnknownEnvironment,
index 1bd0d0187d575d9caf12b5a959b60b5d84532a4f..92be0e047f624a2d448f7b52389b9f3d03cea312 100644 (file)
@@ -177,7 +177,6 @@ const char *Triple::getOSTypeName(OSType Kind) {
   case NVCL: return "nvcl";
   case AMDHSA: return "amdhsa";
   case PS4: return "ps4";
-  case WebAssembly: return "wasm";
   }
 
   llvm_unreachable("Invalid OSType");
@@ -415,7 +414,6 @@ static Triple::OSType parseOS(StringRef OSName) {
     .StartsWith("nvcl", Triple::NVCL)
     .StartsWith("amdhsa", Triple::AMDHSA)
     .StartsWith("ps4", Triple::PS4)
-    .StartsWith("wasm", Triple::WebAssembly)
     .Default(Triple::UnknownOS);
 }
 
index dfeebacfdaaaeeea4020a6c3328ff8a74e186bce..d50768412d74011f46fab1176ad337dab1226fd1 100644 (file)
@@ -182,16 +182,16 @@ TEST(TripleTest, ParsedIDs) {
   EXPECT_EQ(Triple::CloudABI, T.getOS());
   EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
 
-  T = Triple("wasm32-unknown-wasm");
+  T = Triple("wasm32-unknown-unknown");
   EXPECT_EQ(Triple::wasm32, T.getArch());
   EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
-  EXPECT_EQ(Triple::WebAssembly, T.getOS());
+  EXPECT_EQ(Triple::UnknownOS, T.getOS());
   EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
 
-  T = Triple("wasm64-unknown-wasm");
+  T = Triple("wasm64-unknown-unknown");
   EXPECT_EQ(Triple::wasm64, T.getArch());
   EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
-  EXPECT_EQ(Triple::WebAssembly, T.getOS());
+  EXPECT_EQ(Triple::UnknownOS, T.getOS());
   EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
 
   T = Triple("huh");