[llvm] r302606 - [WebAssembly] Fix build error in wasm YAML code
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Tue May 9 17:14:04 PDT 2017
Author: sbc
Date: Tue May 9 19:14:04 2017
New Revision: 302606
URL: http://llvm.org/viewvc/llvm-project?rev=302606&view=rev
Log:
[WebAssembly] Fix build error in wasm YAML code
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
Modified:
llvm/trunk/include/llvm/ObjectYAML/WasmYAML.h
llvm/trunk/lib/ObjectYAML/WasmYAML.cpp
llvm/trunk/tools/obj2yaml/wasm2yaml.cpp
llvm/trunk/tools/yaml2obj/yaml2wasm.cpp
Modified: llvm/trunk/include/llvm/ObjectYAML/WasmYAML.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ObjectYAML/WasmYAML.h?rev=302606&r1=302605&r2=302606&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ObjectYAML/WasmYAML.h (original)
+++ llvm/trunk/include/llvm/ObjectYAML/WasmYAML.h Tue May 9 19:14:04 2017
@@ -69,8 +69,8 @@ struct Import {
ExportKind Kind;
union {
uint32_t SigIndex;
- Global Global;
- Table Table;
+ Global GlobalImport;
+ Table TableImport;
Limits Memory;
};
};
Modified: llvm/trunk/lib/ObjectYAML/WasmYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/WasmYAML.cpp?rev=302606&r1=302605&r2=302606&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/WasmYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/WasmYAML.cpp Tue May 9 19:14:04 2017
@@ -265,10 +265,10 @@ void MappingTraits<WasmYAML::Import>::ma
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 {
Modified: llvm/trunk/tools/obj2yaml/wasm2yaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/wasm2yaml.cpp?rev=302606&r1=302605&r2=302606&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/wasm2yaml.cpp (original)
+++ llvm/trunk/tools/obj2yaml/wasm2yaml.cpp Tue May 9 19:14:04 2017
@@ -108,11 +108,11 @@ ErrorOr<WasmYAML::Object *> WasmDumper::
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);
Modified: llvm/trunk/tools/yaml2obj/yaml2wasm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2wasm.cpp?rev=302606&r1=302605&r2=302606&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2wasm.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2wasm.cpp Tue May 9 19:14:04 2017
@@ -169,15 +169,15 @@ int WasmWriter::writeSectionContent(raw_
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;
More information about the llvm-commits
mailing list