[lld] r258795 - Simplify. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 23:17:28 PST 2016


Author: ruiu
Date: Tue Jan 26 01:17:27 2016
New Revision: 258795

URL: http://llvm.org/viewvc/llvm-project?rev=258795&view=rev
Log:
Simplify. NFC.

Modified:
    lld/trunk/ELF/OutputSections.cpp

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=258795&r1=258794&r2=258795&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Jan 26 01:17:27 2016
@@ -348,14 +348,14 @@ template <class ELFT> void RelocationSec
       continue;
 
     auto R = static_cast<const Elf_Rela &>(RI);
-    uintX_t Addend;
+    auto S = static_cast<Elf_Rela *>(P);
+    uintX_t A = NeedsGot ? 0 : R.r_addend;
     if (CBP)
-      Addend = NeedsGot ? 0 : R.r_addend;
+      S->r_addend = A;
     else if (Body)
-      Addend = getSymVA<ELFT>(*Body) + (NeedsGot ? 0 : R.r_addend);
+      S->r_addend = getSymVA<ELFT>(*Body) + A;
     else
-      Addend = getLocalRelTarget(File, R, R.r_addend);
-    static_cast<Elf_Rela *>(P)->r_addend = Addend;
+      S->r_addend = getLocalRelTarget(File, R, A);
   }
 }
 




More information about the llvm-commits mailing list