[PATCH] D13119: [WebAssembly] Switch to a more traditional assembly syntax

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 14:54:14 PDT 2015


sunfish marked 6 inline comments as done.

================
Comment at: lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:190
@@ -261,1 +189,3 @@
+
   if (!Rt->isVoidTy() || !F->arg_empty()) {
+    SmallString<128> Str;
----------------
jfb wrote:
> Is this check needed? It seems like the below code does the right thing without it.
EmitRawText automatically appends a newline, so this avoids printing an extra newline in that case.

================
Comment at: lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:229
@@ +228,3 @@
+    // TODO: wasm64
+    OS << "i32.const " << toSymbol(MI->getOperand(1).getGlobal()->getName());
+    break;
----------------
jfb wrote:
> Should we just drop GLOBAL since it's not in the design anymore?
We need to keep global addresses symbolic until link time. So even if wasm itself doesn't have GLOBAL, we need something like it at this stage.

================
Comment at: lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:289
@@ +288,3 @@
+       << regToString(MI->getOperand(0).getReg()) << ", "
+          "@pop";
+    OutStreamer->EmitRawText(OS.str());
----------------
jfb wrote:
> `@pop` is a bit confusing since it's more of an internal opcode not an identifier (which we use `@` for). Maybe `%pop` or something (since we're already using `$` and `#` looks like a comment)?
How about just `pop`?


Repository:
  rL LLVM

http://reviews.llvm.org/D13119





More information about the llvm-commits mailing list