[WebAssembly] Introduce a WebAssemblyTargetStreamer class.

Refactor .param, .result, .local, and .endfunc, as directives, using the
proper MCTargetStreamer mechanism, rather than fake instructions.

llvm-svn: 257511
diff --git a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
index 60e5201..9a95150 100644
--- a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
+++ b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
@@ -151,12 +151,11 @@
              WebAssemblyII::VariableOpIsImmediate)) &&
            "WebAssemblyII::VariableOpIsImmediate should be set for "
            "variable_ops immediate ops");
-    if (MII.get(MI->getOpcode()).TSFlags &
-        WebAssemblyII::VariableOpImmediateIsType)
-      // The immediates represent types.
-      O << WebAssembly::TypeToString(MVT::SimpleValueType(Op.getImm()));
-    else
-      O << Op.getImm();
+    // TODO: (MII.get(MI->getOpcode()).TSFlags &
+    //        WebAssemblyII::VariableOpImmediateIsLabel)
+    // can tell us whether this is an immediate referencing a label in the
+    // control flow stack, and it may be nice to pretty-print.
+    O << Op.getImm();
   } else if (Op.isFPImm()) {
     assert((OpNo < MII.get(MI->getOpcode()).getNumOperands() ||
             MII.get(MI->getOpcode()).TSFlags == 0) &&