]> granicus.if.org Git - llvm/commitdiff
[WebAssembly] Fix build error in wasm YAML code
authorSam Clegg <sbc@chromium.org>
Wed, 10 May 2017 00:14:04 +0000 (00:14 +0000)
committerSam Clegg <sbc@chromium.org>
Wed, 10 May 2017 00:14:04 +0000 (00:14 +0000)
This warning didn't show up on my local build
but is causing the bots to fail.  Seems like a
bad idea to have types and variables with the
same name anyhow.

Differential Revision: https://reviews.llvm.org/D33022

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302606 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ObjectYAML/WasmYAML.h
lib/ObjectYAML/WasmYAML.cpp
tools/obj2yaml/wasm2yaml.cpp
tools/yaml2obj/yaml2wasm.cpp

index 747cd6240558d79ed25ba7a4811c9901ccd7b77c..7b70c9537827a928994cea46d5d0410b203ea99f 100644 (file)
@@ -69,8 +69,8 @@ struct Import {
   ExportKind Kind;
   union {
     uint32_t SigIndex;
-    Global Global;
-    Table Table;
+    Global GlobalImport;
+    Table TableImport;
     Limits Memory;
   };
 };
index 514ae55b3b65446de75b90d2da9febc1dea5300e..910d32f16af97f9435b3241ddce5d8ebc540fc3e 100644 (file)
@@ -265,10 +265,10 @@ void MappingTraits<WasmYAML::Import>::mapping(IO &IO,
   if (Import.Kind == wasm::WASM_EXTERNAL_FUNCTION) {
     IO.mapRequired("SigIndex", Import.SigIndex);
   } else if (Import.Kind == wasm::WASM_EXTERNAL_GLOBAL) {
-    IO.mapRequired("GlobalType", Import.Global.Type);
-    IO.mapRequired("GlobalMutable", Import.Global.Mutable);
+    IO.mapRequired("GlobalType", Import.GlobalImport.Type);
+    IO.mapRequired("GlobalMutable", Import.GlobalImport.Mutable);
   } else if (Import.Kind == wasm::WASM_EXTERNAL_TABLE) {
-    IO.mapRequired("Table", Import.Table);
+    IO.mapRequired("Table", Import.TableImport);
   } else if (Import.Kind == wasm::WASM_EXTERNAL_MEMORY ) {
     IO.mapRequired("Memory", Import.Memory);
   } else {
index 6efa2ac77b553fc4932a4f9ec1bc72768b834e3c..d4d978f028e25746e7581c45c2dbf8a616c14683 100644 (file)
@@ -108,11 +108,11 @@ ErrorOr<WasmYAML::Object *> WasmDumper::dump() {
           Im.SigIndex = Import.SigIndex;
           break;
         case wasm::WASM_EXTERNAL_GLOBAL:
-          Im.Global.Type = Import.Global.Type;
-          Im.Global.Mutable = Import.Global.Mutable;
+          Im.GlobalImport.Type = Import.Global.Type;
+          Im.GlobalImport.Mutable = Import.Global.Mutable;
           break;
         case wasm::WASM_EXTERNAL_TABLE:
-          Im.Table = make_table(Import.Table);
+          Im.TableImport = make_table(Import.Table);
           break;
         case wasm::WASM_EXTERNAL_MEMORY:
           Im.Memory = make_limits(Import.Memory);
index 502b1e6855515f626ebe9d87960263267c1742ba..5c8aba33ee80af312b598804e3f5ae9bc635ad37 100644 (file)
@@ -169,15 +169,15 @@ int WasmWriter::writeSectionContent(raw_ostream &OS,
       encodeULEB128(Import.SigIndex, OS);
       break;
     case wasm::WASM_EXTERNAL_GLOBAL:
-      encodeSLEB128(Import.Global.Type, OS);
-      writeUint8(OS, Import.Global.Mutable);
+      encodeSLEB128(Import.GlobalImport.Type, OS);
+      writeUint8(OS, Import.GlobalImport.Mutable);
       break;
     case wasm::WASM_EXTERNAL_MEMORY:
       writeLimits(Import.Memory, OS);
       break;
     case wasm::WASM_EXTERNAL_TABLE:
-      encodeSLEB128(Import.Table.ElemType, OS);
-      writeLimits(Import.Table.TableLimits, OS);
+      encodeSLEB128(Import.TableImport.ElemType, OS);
+      writeLimits(Import.TableImport.TableLimits, OS);
       break;
     default:
       errs() << "Unknown import type: " << Import.Kind;