[lld] r282851 - [ELF] - Inlined template argument variable. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 06:46:34 PDT 2016


Author: grimar
Date: Fri Sep 30 08:46:34 2016
New Revision: 282851

URL: http://llvm.org/viewvc/llvm-project?rev=282851&view=rev
Log:
[ELF] - Inlined template argument variable. NFC.

Modified:
    lld/trunk/ELF/InputSection.cpp

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=282851&r1=282850&r2=282851&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Fri Sep 30 08:46:34 2016
@@ -315,7 +315,6 @@ static typename ELFT::uint getSymVA(uint
 template <class ELFT>
 template <class RelTy>
 void InputSection<ELFT>::relocateNonAlloc(uint8_t *Buf, ArrayRef<RelTy> Rels) {
-  const unsigned Bits = sizeof(uintX_t) * 8;
   for (const RelTy &Rel : Rels) {
     uint32_t Type = Rel.getType(Config->Mips64EL);
     uintX_t Offset = this->getOffset(Rel.r_offset);
@@ -331,8 +330,8 @@ void InputSection<ELFT>::relocateNonAllo
     }
 
     uintX_t AddrLoc = this->OutSec->getVA() + Offset;
-    uint64_t SymVA =
-        SignExtend64<Bits>(getSymVA<ELFT>(Type, Addend, AddrLoc, Sym, R_ABS));
+    uint64_t SymVA = SignExtend64<sizeof(uintX_t) * 8>(
+        getSymVA<ELFT>(Type, Addend, AddrLoc, Sym, R_ABS));
     Target->relocateOne(BufLoc, Type, SymVA);
   }
 }




More information about the llvm-commits mailing list