Skip to content

Commit 20f7f73

Browse files
committed
[WebAssembly] Rename member in WasmYAML.h to avoid compiler warning
Followup/fix for https://reviews.llvm.org/D121349.
1 parent 5da83ee commit 20f7f73

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

llvm/include/llvm/ObjectYAML/WasmYAML.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct Global {
8383
uint32_t Index;
8484
ValueType Type;
8585
bool Mutable;
86-
InitExpr InitExpr;
86+
InitExpr Init;
8787
};
8888

8989
struct Import {

llvm/lib/ObjectYAML/WasmEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ void WasmWriter::writeSectionContent(raw_ostream &OS,
483483
++ExpectedIndex;
484484
writeUint8(OS, Global.Type);
485485
writeUint8(OS, Global.Mutable);
486-
writeInitExpr(OS, Global.InitExpr);
486+
writeInitExpr(OS, Global.Init);
487487
}
488488
}
489489

llvm/lib/ObjectYAML/WasmYAML.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ void MappingTraits<WasmYAML::Global>::mapping(IO &IO,
418418
IO.mapRequired("Index", Global.Index);
419419
IO.mapRequired("Type", Global.Type);
420420
IO.mapRequired("Mutable", Global.Mutable);
421-
IO.mapRequired("InitExpr", Global.InitExpr);
421+
IO.mapRequired("InitExpr", Global.Init);
422422
}
423423

424424
void MappingTraits<WasmYAML::InitExpr>::mapping(IO &IO,

llvm/tools/obj2yaml/wasm2yaml.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@ ErrorOr<WasmYAML::Object *> WasmDumper::dump() {
298298
G.Index = Global.Index;
299299
G.Type = Global.Type.Type;
300300
G.Mutable = Global.Type.Mutable;
301-
G.InitExpr.Extended = Global.InitExpr.Extended;
301+
G.Init.Extended = Global.InitExpr.Extended;
302302
if (Global.InitExpr.Extended) {
303-
G.InitExpr.Body = Global.InitExpr.Body;
303+
G.Init.Body = Global.InitExpr.Body;
304304
} else {
305-
G.InitExpr.Inst = Global.InitExpr.Inst;
305+
G.Init.Inst = Global.InitExpr.Inst;
306306
}
307307
GlobalSec->Globals.push_back(G);
308308
}

0 commit comments

Comments
 (0)