]> granicus.if.org Git - llvm/commitdiff
[WebAssembly] COWS has been renamed to WASI.
authorDan Gohman <dan433584@gmail.com>
Wed, 16 Jan 2019 05:23:52 +0000 (05:23 +0000)
committerDan Gohman <dan433584@gmail.com>
Wed, 16 Jan 2019 05:23:52 +0000 (05:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351297 91177308-0d34-0410-b5e6-96231b3b80d8

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

index b070ae3c97be9698bcbfe81c76e0f59710a35fda..e06a68e273176a47800dd3594df9e35793382551 100644 (file)
@@ -186,8 +186,8 @@ public:
     AMDPAL,     // AMD PAL Runtime
     HermitCore, // HermitCore Unikernel/Multikernel
     Hurd,       // GNU/Hurd
-    COWS,       // Capability-Oriented WebAssembly Syscalls
-    LastOSType = COWS
+    WASI,       // Experimental WebAssembly OS
+    LastOSType = WASI
   };
   enum EnvironmentType {
     UnknownEnvironment,
@@ -588,9 +588,9 @@ public:
     return getOS() == Triple::Hurd;
   }
 
-  /// Tests whether the OS is COWS.
-  bool isOSCOWS() const {
-    return getOS() == Triple::COWS;
+  /// Tests whether the OS is WASI.
+  bool isOSWASI() const {
+    return getOS() == Triple::WASI;
   }
 
   /// Tests whether the OS uses glibc.
index 4ca48dfaeee1d90512f0c5e5706e2f0d37f37d8c..26d9327f620881880c3d90087109b4dde450fc8a 100644 (file)
@@ -208,7 +208,7 @@ StringRef Triple::getOSTypeName(OSType Kind) {
   case AMDPAL: return "amdpal";
   case HermitCore: return "hermit";
   case Hurd: return "hurd";
-  case COWS: return "cows";
+  case WASI: return "wasi";
   }
 
   llvm_unreachable("Invalid OSType");
@@ -506,7 +506,7 @@ static Triple::OSType parseOS(StringRef OSName) {
     .StartsWith("amdpal", Triple::AMDPAL)
     .StartsWith("hermit", Triple::HermitCore)
     .StartsWith("hurd", Triple::Hurd)
-    .StartsWith("cows", Triple::COWS)
+    .StartsWith("wasi", Triple::WASI)
     .Default(Triple::UnknownOS);
 }
 
index bb31b8b622581084dc8f3c775c3553969f99fdfc..bc7f9321caaeaef9aad4e4054518ca2a43ab30f2 100644 (file)
@@ -253,10 +253,10 @@ TEST(TripleTest, ParsedIDs) {
   EXPECT_EQ(Triple::UnknownOS, T.getOS());
   EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
 
-  T = Triple("wasm32-unknown-cows-musl");
+  T = Triple("wasm32-unknown-wasi-musl");
   EXPECT_EQ(Triple::wasm32, T.getArch());
   EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
-  EXPECT_EQ(Triple::COWS, T.getOS());
+  EXPECT_EQ(Triple::WASI, T.getOS());
   EXPECT_EQ(Triple::Musl, T.getEnvironment());
 
   T = Triple("wasm64-unknown-unknown");
@@ -265,10 +265,10 @@ TEST(TripleTest, ParsedIDs) {
   EXPECT_EQ(Triple::UnknownOS, T.getOS());
   EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
 
-  T = Triple("wasm64-unknown-cows-musl");
+  T = Triple("wasm64-unknown-wasi-musl");
   EXPECT_EQ(Triple::wasm64, T.getArch());
   EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
-  EXPECT_EQ(Triple::COWS, T.getOS());
+  EXPECT_EQ(Triple::WASI, T.getOS());
   EXPECT_EQ(Triple::Musl, T.getEnvironment());
 
   T = Triple("avr-unknown-unknown");
@@ -1247,17 +1247,17 @@ TEST(TripleTest, FileFormat) {
 
   EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-unknown").getObjectFormat());
   EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-unknown").getObjectFormat());
-  EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-cows-musl").getObjectFormat());
-  EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-cows-musl").getObjectFormat());
+  EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-wasi-musl").getObjectFormat());
+  EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-wasi-musl").getObjectFormat());
 
   EXPECT_EQ(Triple::Wasm,
             Triple("wasm32-unknown-unknown-wasm").getObjectFormat());
   EXPECT_EQ(Triple::Wasm,
             Triple("wasm64-unknown-unknown-wasm").getObjectFormat());
   EXPECT_EQ(Triple::Wasm,
-            Triple("wasm32-unknown-cows-musl-wasm").getObjectFormat());
+            Triple("wasm32-unknown-wasi-musl-wasm").getObjectFormat());
   EXPECT_EQ(Triple::Wasm,
-            Triple("wasm64-unknown-cows-musl-wasm").getObjectFormat());
+            Triple("wasm64-unknown-wasi-musl-wasm").getObjectFormat());
 
   Triple MSVCNormalized(Triple::normalize("i686-pc-windows-msvc-elf"));
   EXPECT_EQ(Triple::ELF, MSVCNormalized.getObjectFormat());