[WebAssembly] Rename global types to match the notation in the spec
authorNicholas Wilson <nicholas@nicholaswilson.me.uk>
Fri, 2 Mar 2018 14:54:34 +0000 (14:54 +0000)
committerNicholas Wilson <nicholas@nicholaswilson.me.uk>
Fri, 2 Mar 2018 14:54:34 +0000 (14:54 +0000)
llvm-svn: 326583

lld/wasm/WriterUtils.cpp

index 88c3757f8c1f186b891659f9c1ce639259113537..e2494b58b68f387fb372ab09dc48feafed03f466 100644 (file)
@@ -194,8 +194,6 @@ std::string lld::toString(const WasmSignature &Sig) {
 }
 
 std::string lld::toString(const WasmGlobalType &Sig) {
-  std::string S = toString(static_cast<ValType>(Sig.Type));
-  if (Sig.Mutable)
-    return "mutable " + S;
-  return S;
+  return (Sig.Mutable ? "var " : "const ") +
+      toString(static_cast<ValType>(Sig.Type));
 }