[lld] r330491 - [ELF] Swap argument names: use Old to refer to original symbol and New for incoming one

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 20 15:50:15 PDT 2018


Author: maskray
Date: Fri Apr 20 15:50:15 2018
New Revision: 330491

URL: http://llvm.org/viewvc/llvm-project?rev=330491&view=rev
Log:
[ELF] Swap argument names: use Old to refer to original symbol and New for incoming one

Reviewers: ruiu, espindola

Subscribers: emaste, arichardson, llvm-commits

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

Modified:
    lld/trunk/ELF/SymbolTable.cpp

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=330491&r1=330490&r2=330491&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Fri Apr 20 15:50:15 2018
@@ -339,9 +339,9 @@ static uint8_t getVisibility(uint8_t StO
 // files) form group 2. E forms group 3. I think that you can see how this
 // group assignment rule simulates the traditional linker's semantics.
 static void checkBackrefs(StringRef Name, InputFile *Old, InputFile *New) {
-  if (Config->WarnBackrefs && Old && New->GroupId < Old->GroupId)
-    warn("backward reference detected: " + Name + " in " + toString(Old) +
-         " refers to " + toString(New));
+  if (Config->WarnBackrefs && New && Old->GroupId < New->GroupId)
+    warn("backward reference detected: " + Name + " in " + toString(New) +
+         " refers to " + toString(Old));
 }
 
 template <class ELFT>
@@ -376,7 +376,7 @@ Symbol *SymbolTable::addUndefined(String
       return S;
     }
 
-    checkBackrefs(Name, File, S->File);
+    checkBackrefs(Name, S->File, File);
     fetchLazy<ELFT>(S);
   }
   return S;




More information about the llvm-commits mailing list