[llvm] r322332 - [WebAssembly] MC: Remove SetUsed argument when calling MCSymbol::isDefined et al

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 15:59:16 PST 2018


Author: sbc
Date: Thu Jan 11 15:59:16 2018
New Revision: 322332

URL: http://llvm.org/viewvc/llvm-project?rev=322332&view=rev
Log:
[WebAssembly] MC: Remove SetUsed argument when calling MCSymbol::isDefined et al

Summary:
This argument (the isUsed flag) seems to only be relevant
when parsing.  Other calls sites such as these don't seem
to ever use it.

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish

Differential Revision: https://reviews.llvm.org/D41970

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

Modified: llvm/trunk/lib/MC/WasmObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WasmObjectWriter.cpp?rev=322332&r1=322331&r2=322332&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WasmObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WasmObjectWriter.cpp Thu Jan 11 15:59:16 2018
@@ -502,7 +502,7 @@ WasmObjectWriter::getProvisionalValue(co
   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 @@ void WasmObjectWriter::writeObject(MCAss
       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 @@ void WasmObjectWriter::writeObject(MCAss
     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 @@ void WasmObjectWriter::writeObject(MCAss
       if (WS.isTemporary() && !WS.getSize())
         continue;
 
-      if (!WS.isDefined(/*SetUsed=*/false))
+      if (!WS.isDefined())
         continue;
 
       if (!WS.getSize())
@@ -1263,7 +1263,7 @@ void WasmObjectWriter::writeObject(MCAss
     }
 
     // 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 @@ void WasmObjectWriter::writeObject(MCAss
         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 @@ void WasmObjectWriter::writeObject(MCAss
     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);




More information about the llvm-commits mailing list