[lld] r309051 - Reduce templating. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 16:15:35 PDT 2017


Author: rafael
Date: Tue Jul 25 16:15:35 2017
New Revision: 309051

URL: http://llvm.org/viewvc/llvm-project?rev=309051&view=rev
Log:
Reduce templating. NFC.

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=309051&r1=309050&r2=309051&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Jul 25 16:15:35 2017
@@ -358,9 +358,8 @@ static int compareDefined(Symbol *S, boo
 // We have a new non-common defined symbol with the specified binding. Return 1
 // if the new symbol should win, -1 if the new symbol should lose, or 0 if there
 // is a conflict. If the new symbol wins, also update the binding.
-template <typename ELFT>
 static int compareDefinedNonCommon(Symbol *S, bool WasInserted, uint8_t Binding,
-                                   bool IsAbsolute, typename ELFT::uint Value,
+                                   bool IsAbsolute, uint64_t Value,
                                    StringRef Name) {
   if (int Cmp = compareDefined(S, WasInserted, Binding, Name)) {
     if (Cmp > 0)
@@ -466,8 +465,8 @@ Symbol *SymbolTable<ELFT>::addRegular(St
   bool WasInserted;
   std::tie(S, WasInserted) = insert(Name, Type, getVisibility(StOther),
                                     /*CanOmitFromDynSym*/ false, File);
-  int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted, Binding,
-                                          Section == nullptr, Value, Name);
+  int Cmp = compareDefinedNonCommon(S, WasInserted, Binding, Section == nullptr,
+                                    Value, Name);
   if (Cmp > 0)
     replaceBody<DefinedRegular>(S, Name, /*IsLocal=*/false, StOther, Type,
                                 Value, Size, Section, File);
@@ -512,8 +511,8 @@ Symbol *SymbolTable<ELFT>::addBitcode(St
   bool WasInserted;
   std::tie(S, WasInserted) =
       insert(Name, Type, getVisibility(StOther), CanOmitFromDynSym, F);
-  int Cmp = compareDefinedNonCommon<ELFT>(S, WasInserted, Binding,
-                                          /*IsAbs*/ false, /*Value*/ 0, Name);
+  int Cmp = compareDefinedNonCommon(S, WasInserted, Binding,
+                                    /*IsAbs*/ false, /*Value*/ 0, Name);
   if (Cmp > 0)
     replaceBody<DefinedRegular>(S, Name, /*IsLocal=*/false, StOther, Type, 0, 0,
                                 nullptr, F);




More information about the llvm-commits mailing list