[WebAssembly] Use the new offset syntax for memory operands in inline asm.
[oota-llvm.git] / lib / Target / WebAssembly / WebAssemblyAsmPrinter.cpp
index 68cfee42802c345df77e70efcd61bbb40956e742..079c864c7bc1c15e9a7bc5c8d238fad2829ea0af 100644 (file)
@@ -260,7 +260,9 @@ bool WebAssemblyAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
     report_fatal_error("There are no defined alternate asm variants");
 
   if (!ExtraCode) {
-    OS << regToString(MI->getOperand(OpNo));
+    // TODO: For now, we just hard-code 0 as the constant offset; teach
+    // SelectInlineAsmMemoryOperand how to do address mode matching.
+    OS << "0(" + regToString(MI->getOperand(OpNo)) + ')';
     return false;
   }