[PATCH] D41970: [WebAssembly] MC: Remove SetUsed argument when calling MCSymbol::isDefined et al

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 16:00:36 PST 2018


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL322332: [WebAssembly] MC: Remove SetUsed argument when calling MCSymbol::isDefined et al (authored by sbc, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D41970

Files:
  llvm/trunk/lib/MC/WasmObjectWriter.cpp


Index: llvm/trunk/lib/MC/WasmObjectWriter.cpp
===================================================================
--- llvm/trunk/lib/MC/WasmObjectWriter.cpp
+++ llvm/trunk/lib/MC/WasmObjectWriter.cpp
@@ -502,7 +502,7 @@
   const MCSymbolWasm *Sym = ResolveSymbol(*RelEntry.Symbol);
 
   // For undefined symbols, use zero
-  if (!Sym->isDefined(/*SetUsed=*/false))
+  if (!Sym->isDefined())
     return 0;
 
   uint32_t GlobalIndex = SymbolIndices[Sym];
@@ -1122,7 +1122,7 @@
       continue;
 
     // If the symbol is not defined in this translation unit, import it.
-    if ((!WS.isDefined(/*SetUsed=*/false) && !WS.isComdat()) ||
+    if ((!WS.isDefined() && !WS.isComdat()) ||
         WS.isVariable()) {
       WasmImport Import;
       Import.ModuleName = WS.getModuleName();
@@ -1206,7 +1206,7 @@
     unsigned Index;
 
     if (WS.isFunction()) {
-      if (WS.isDefined(/*SetUsed=*/false)) {
+      if (WS.isDefined()) {
         if (WS.getOffset() != 0)
           report_fatal_error(
               "function sections must contain one function each");
@@ -1234,7 +1234,7 @@
       if (WS.isTemporary() && !WS.getSize())
         continue;
 
-      if (!WS.isDefined(/*SetUsed=*/false))
+      if (!WS.isDefined())
         continue;
 
       if (!WS.getSize())
@@ -1263,7 +1263,7 @@
     }
 
     // If the symbol is visible outside this translation unit, export it.
-    if (WS.isDefined(/*SetUsed=*/false)) {
+    if (WS.isDefined()) {
       WasmExport Export;
       Export.FieldName = WS.getName();
       Export.Index = Index;
@@ -1278,7 +1278,7 @@
         SymbolFlags.emplace_back(WS.getName(), wasm::WASM_SYMBOL_BINDING_LOCAL);
 
       if (WS.isFunction()) {
-        auto &Section = static_cast<MCSectionWasm &>(WS.getSection(false));
+        auto &Section = static_cast<MCSectionWasm &>(WS.getSection());
         if (const MCSymbolWasm *C = Section.getGroup())
           Comdats[C->getName()].emplace_back(
               WasmComdatEntry{wasm::WASM_COMDAT_FUNCTION, Index});
@@ -1293,7 +1293,7 @@
     if (!S.isVariable())
       continue;
 
-    assert(S.isDefined(/*SetUsed=*/false));
+    assert(S.isDefined());
 
     // Find the target symbol of this weak alias and export that index
     const auto &WS = static_cast<const MCSymbolWasm &>(S);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41970.129547.patch
Type: text/x-patch
Size: 2276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180112/0883c9c0/attachment.bin>


More information about the llvm-commits mailing list