[lld] r266064 - Simplify now that we always have a .got.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 06:23:28 PDT 2016


Author: rafael
Date: Tue Apr 12 08:23:27 2016
New Revision: 266064

URL: http://llvm.org/viewvc/llvm-project?rev=266064&view=rev
Log:
Simplify now that we always have a .got.

Modified:
    lld/trunk/ELF/Target.cpp

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=266064&r1=266063&r2=266064&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Tue Apr 12 08:23:27 2016
@@ -1921,9 +1921,7 @@ bool MipsTargetInfo<ELFT>::isRelRelative
 // the value for the symbol.
 template <class ELFT> typename ELFT::uint getMipsGpAddr() {
   unsigned GPOffset = 0x7ff0;
-  if (uint64_t V = Out<ELFT>::Got->getVA())
-    return V + GPOffset;
-  return 0;
+  return Out<ELFT>::Got->getVA() + GPOffset;
 }
 
 template uint32_t getMipsGpAddr<ELF32LE>();




More information about the llvm-commits mailing list