diff --git a/include/llvm/ObjectYAML/WasmYAML.h b/include/llvm/ObjectYAML/WasmYAML.h index 747cd624055..7b70c953782 100644 --- a/include/llvm/ObjectYAML/WasmYAML.h +++ b/include/llvm/ObjectYAML/WasmYAML.h @@ -69,8 +69,8 @@ struct Import { ExportKind Kind; union { uint32_t SigIndex; - Global Global; - Table Table; + Global GlobalImport; + Table TableImport; Limits Memory; }; }; diff --git a/lib/ObjectYAML/WasmYAML.cpp b/lib/ObjectYAML/WasmYAML.cpp index 514ae55b3b6..910d32f16af 100644 --- a/lib/ObjectYAML/WasmYAML.cpp +++ b/lib/ObjectYAML/WasmYAML.cpp @@ -265,10 +265,10 @@ void MappingTraits::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 { diff --git a/tools/obj2yaml/wasm2yaml.cpp b/tools/obj2yaml/wasm2yaml.cpp index 6efa2ac77b5..d4d978f028e 100644 --- a/tools/obj2yaml/wasm2yaml.cpp +++ b/tools/obj2yaml/wasm2yaml.cpp @@ -108,11 +108,11 @@ ErrorOr 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); diff --git a/tools/yaml2obj/yaml2wasm.cpp b/tools/yaml2obj/yaml2wasm.cpp index 502b1e68555..5c8aba33ee8 100644 --- a/tools/yaml2obj/yaml2wasm.cpp +++ b/tools/yaml2obj/yaml2wasm.cpp @@ -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;