[PATCH] D11776: WebAssembly: textual emission uses expected opcode names

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 18:57:23 PDT 2015


jfb added inline comments.

================
Comment at: lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:85
@@ +84,3 @@
+  for (; N[Pos] != '\0' && N[Pos] != '_'; ++Pos)
+    N[Pos] = std::tolower(N[Pos]);
+  return SmallString<32>(&N[0], &N[Pos]);
----------------
majnemer wrote:
> sunfish wrote:
> > Please avoid std::tolower since it has locale-specific behavior, and compiler output should not be locale-specific.
> FYI we have such a function in LLVM, `ascii_tolower`, but it would need to move to a header file.
I used `StringRef::lower`.

================
Comment at: lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:111
@@ -98,3 +110,3 @@
   case WebAssembly::ARGUMENT_Float64:
-    OS << "argument " << MI->getOperand(1).getImm();
+    OS << Name(TII, MI) << ' ' << MI->getOperand(1).getImm();
     PrintOperands = false;
----------------
sunfish wrote:
> We should really just teach the generic operand printing code below how to handle immediate operands, and then even the ARGUMENT opcodes can just go through the generic path.
Yes, will do in a follow-up.


http://reviews.llvm.org/D11776





More information about the llvm-commits mailing list