[lld] r345393 - Rename warnUnorderableSymbol maybeWarnUnorderableSymbol because the function doesn't always emit a warning.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 26 08:07:12 PDT 2018


Author: ruiu
Date: Fri Oct 26 08:07:12 2018
New Revision: 345393

URL: http://llvm.org/viewvc/llvm-project?rev=345393&view=rev
Log:
Rename warnUnorderableSymbol maybeWarnUnorderableSymbol because the function doesn't always emit a warning.

Modified:
    lld/trunk/ELF/Driver.cpp
    lld/trunk/ELF/Symbols.cpp
    lld/trunk/ELF/Symbols.h
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=345393&r1=345392&r2=345393&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Fri Oct 26 08:07:12 2018
@@ -662,8 +662,8 @@ static void readCallGraph(MemoryBufferRe
         warn(MB.getBufferIdentifier() + ": no such symbol: " + Name);
       return nullptr;
     }
+    maybeWarnUnorderableSymbol(Sym);
 
-    warnUnorderableSymbol(Sym);
     if (Defined *DR = dyn_cast_or_null<Defined>(Sym))
       return dyn_cast_or_null<InputSectionBase>(DR->Section);
     return nullptr;

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=345393&r1=345392&r2=345393&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Fri Oct 26 08:07:12 2018
@@ -260,7 +260,7 @@ void elf::printTraceSymbol(Symbol *Sym)
   message(toString(Sym->File) + S + Sym->getName());
 }
 
-void elf::warnUnorderableSymbol(const Symbol *Sym) {
+void elf::maybeWarnUnorderableSymbol(const Symbol *Sym) {
   if (!Config->WarnSymbolOrdering)
     return;
 

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=345393&r1=345392&r2=345393&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Fri Oct 26 08:07:12 2018
@@ -405,7 +405,7 @@ void replaceSymbol(Symbol *S, ArgT &&...
     printTraceSymbol(S);
 }
 
-void warnUnorderableSymbol(const Symbol *Sym);
+void maybeWarnUnorderableSymbol(const Symbol *Sym);
 } // namespace elf
 } // namespace lld
 

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=345393&r1=345392&r2=345393&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Fri Oct 26 08:07:12 2018
@@ -1105,7 +1105,7 @@ static DenseMap<const InputSectionBase *
     SymbolOrderEntry &Ent = It->second;
     Ent.Present = true;
 
-    warnUnorderableSymbol(&Sym);
+    maybeWarnUnorderableSymbol(&Sym);
 
     if (auto *D = dyn_cast<Defined>(&Sym)) {
       if (auto *Sec = dyn_cast_or_null<InputSectionBase>(D->Section)) {




More information about the llvm-commits mailing list