[PATCH] D12002: Initial WebAssembly support in clang

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 2 18:22:02 PDT 2015


echristo accepted this revision.
echristo added a reviewer: echristo.
echristo added a comment.

A couple things inline that need changing, but feel free to commit after without a repost.

-eric


================
Comment at: lib/Basic/Targets.cpp:6943-6944
@@ +6942,4 @@
+
+      Diags.Report(diag::err_opt_not_valid_with_opt) << Feature
+                                                     << "-target-feature";
+      return false;
----------------
The backend should handle any weirdness here with missing features especially as this will report an error based on -cc1 compilation and not the main command line.

I.e. it's not necessary, that said if you feel wedded to it there's no problem either.

================
Comment at: lib/Basic/Targets.cpp:7635-7639
@@ +7634,7 @@
+    // Until specific variations are defined, don't permit any.
+    if (!(Triple == llvm::Triple("wasm32-unknown-unknown")) ||
+        (!Triple.getVendorName().empty() &&
+         Triple.getVendorName() != "unknown") ||
+        (!Triple.getOSName().empty() && Triple.getOSName() != "unknown") ||
+        (Triple.hasEnvironment() && Triple.getEnvironmentName() != "unknown"))
+      return nullptr;
----------------
Why not just a positive test?

================
Comment at: lib/Basic/Targets.cpp:7643-7649
@@ +7642,9 @@
+  case llvm::Triple::wasm64:
+    // Until specific variations are defined, don't permit any.
+    if (!(Triple == llvm::Triple("wasm64-unknown-unknown")) ||
+        (!Triple.getVendorName().empty() &&
+         Triple.getVendorName() != "unknown") ||
+        (!Triple.getOSName().empty() && Triple.getOSName() != "unknown") ||
+        (Triple.hasEnvironment() && Triple.getEnvironmentName() != "unknown"))
+      return nullptr;
+    return new WebAssemblyOSTargetInfo<WebAssembly64TargetInfo>(Triple);
----------------
Ditto.

(I said this just below, but it seems to have gotten munged in the newer version)


Repository:
  rL LLVM

http://reviews.llvm.org/D12002





More information about the cfe-commits mailing list