[PATCH] D43849: [WebAssembly] Simplify createDefined. NFC.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 13:23:42 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL326615: [WebAssembly] Simplify createDefined. NFC. (authored by ruiu, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D43849?vs=136209&id=136836#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43849

Files:
  lld/trunk/wasm/InputFiles.cpp


Index: lld/trunk/wasm/InputFiles.cpp
===================================================================
--- lld/trunk/wasm/InputFiles.cpp
+++ lld/trunk/wasm/InputFiles.cpp
@@ -175,6 +175,9 @@
   if (!Sym.isDefined())
     return nullptr;
 
+  StringRef Name = Sym.Info.Name;
+  uint32_t Flags = Sym.Info.Flags;
+
   switch (Sym.Info.Kind) {
   case WASM_SYMBOL_TYPE_FUNCTION: {
     InputFunction *Func =
@@ -185,9 +188,8 @@
     }
 
     if (Sym.isBindingLocal())
-      return make<DefinedFunction>(Sym.Info.Name, Sym.Info.Flags, this, Func);
-    return Symtab->addDefinedFunction(Sym.Info.Name, Sym.Info.Flags, this,
-                                      Func);
+      return make<DefinedFunction>(Name, Flags, this, Func);
+    return Symtab->addDefinedFunction(Name, Flags, this, Func);
   }
   case WASM_SYMBOL_TYPE_DATA: {
     InputSegment *Seg = Segments[Sym.Info.DataRef.Segment];
@@ -200,18 +202,15 @@
     uint32_t Size = Sym.Info.DataRef.Size;
 
     if (Sym.isBindingLocal())
-      return make<DefinedData>(Sym.Info.Name, Sym.Info.Flags, this, Seg, Offset,
-                               Size);
-    return Symtab->addDefinedData(Sym.Info.Name, Sym.Info.Flags, this, Seg,
-                                  Offset, Size);
+      return make<DefinedData>(Name, Flags, this, Seg, Offset, Size);
+    return Symtab->addDefinedData(Name, Flags, this, Seg, Offset, Size);
   }
   case WASM_SYMBOL_TYPE_GLOBAL:
     InputGlobal *Global =
         Globals[Sym.Info.ElementIndex - WasmObj->getNumImportedGlobals()];
     if (Sym.isBindingLocal())
-      return make<DefinedGlobal>(Sym.Info.Name, Sym.Info.Flags, this, Global);
-    return Symtab->addDefinedGlobal(Sym.Info.Name, Sym.Info.Flags, this,
-                                    Global);
+      return make<DefinedGlobal>(Name, Flags, this, Global);
+    return Symtab->addDefinedGlobal(Name, Flags, this, Global);
   }
   llvm_unreachable("unkown symbol kind");
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43849.136836.patch
Type: text/x-patch
Size: 1936 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180302/6eb20f3a/attachment.bin>


More information about the llvm-commits mailing list