[llvm] 20f7f73 - [WebAssembly] Rename member in WasmYAML.h to avoid compiler warning

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 09:10:04 PDT 2022


Author: Sam Clegg
Date: 2022-03-14T09:09:43-07:00
New Revision: 20f7f733fe936580025f467bb4b82eba2a9445b0

URL: https://github.com/llvm/llvm-project/commit/20f7f733fe936580025f467bb4b82eba2a9445b0
DIFF: https://github.com/llvm/llvm-project/commit/20f7f733fe936580025f467bb4b82eba2a9445b0.diff

LOG: [WebAssembly] Rename member in WasmYAML.h to avoid compiler warning

Followup/fix for https://reviews.llvm.org/D121349.

Added: 
    

Modified: 
    llvm/include/llvm/ObjectYAML/WasmYAML.h
    llvm/lib/ObjectYAML/WasmEmitter.cpp
    llvm/lib/ObjectYAML/WasmYAML.cpp
    llvm/tools/obj2yaml/wasm2yaml.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ObjectYAML/WasmYAML.h b/llvm/include/llvm/ObjectYAML/WasmYAML.h
index 76da5582e4cfa..0f6c4f06665fb 100644
--- a/llvm/include/llvm/ObjectYAML/WasmYAML.h
+++ b/llvm/include/llvm/ObjectYAML/WasmYAML.h
@@ -83,7 +83,7 @@ struct Global {
   uint32_t Index;
   ValueType Type;
   bool Mutable;
-  InitExpr InitExpr;
+  InitExpr Init;
 };
 
 struct Import {

diff  --git a/llvm/lib/ObjectYAML/WasmEmitter.cpp b/llvm/lib/ObjectYAML/WasmEmitter.cpp
index 0787f099a4d10..6230312eff7b4 100644
--- a/llvm/lib/ObjectYAML/WasmEmitter.cpp
+++ b/llvm/lib/ObjectYAML/WasmEmitter.cpp
@@ -483,7 +483,7 @@ void WasmWriter::writeSectionContent(raw_ostream &OS,
     ++ExpectedIndex;
     writeUint8(OS, Global.Type);
     writeUint8(OS, Global.Mutable);
-    writeInitExpr(OS, Global.InitExpr);
+    writeInitExpr(OS, Global.Init);
   }
 }
 

diff  --git a/llvm/lib/ObjectYAML/WasmYAML.cpp b/llvm/lib/ObjectYAML/WasmYAML.cpp
index 08deaa4eba183..7ca422487df26 100644
--- a/llvm/lib/ObjectYAML/WasmYAML.cpp
+++ b/llvm/lib/ObjectYAML/WasmYAML.cpp
@@ -418,7 +418,7 @@ void MappingTraits<WasmYAML::Global>::mapping(IO &IO,
   IO.mapRequired("Index", Global.Index);
   IO.mapRequired("Type", Global.Type);
   IO.mapRequired("Mutable", Global.Mutable);
-  IO.mapRequired("InitExpr", Global.InitExpr);
+  IO.mapRequired("InitExpr", Global.Init);
 }
 
 void MappingTraits<WasmYAML::InitExpr>::mapping(IO &IO,

diff  --git a/llvm/tools/obj2yaml/wasm2yaml.cpp b/llvm/tools/obj2yaml/wasm2yaml.cpp
index 3a34c7ef45288..813d03da58b12 100644
--- a/llvm/tools/obj2yaml/wasm2yaml.cpp
+++ b/llvm/tools/obj2yaml/wasm2yaml.cpp
@@ -298,11 +298,11 @@ ErrorOr<WasmYAML::Object *> WasmDumper::dump() {
         G.Index = Global.Index;
         G.Type = Global.Type.Type;
         G.Mutable = Global.Type.Mutable;
-        G.InitExpr.Extended = Global.InitExpr.Extended;
+        G.Init.Extended = Global.InitExpr.Extended;
         if (Global.InitExpr.Extended) {
-          G.InitExpr.Body = Global.InitExpr.Body;
+          G.Init.Body = Global.InitExpr.Body;
         } else {
-          G.InitExpr.Inst = Global.InitExpr.Inst;
+          G.Init.Inst = Global.InitExpr.Inst;
         }
         GlobalSec->Globals.push_back(G);
       }


        


More information about the llvm-commits mailing list