[lld] r266340 - Move variables closer to code scopes that uses them. NFC.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 14 10:05:56 PDT 2016
Author: grimar
Date: Thu Apr 14 12:05:56 2016
New Revision: 266340
URL: http://llvm.org/viewvc/llvm-project?rev=266340&view=rev
Log:
Move variables closer to code scopes that uses them. NFC.
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=266340&r1=266339&r2=266340&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Apr 14 12:05:56 2016
@@ -462,8 +462,6 @@ void Writer<ELFT>::scanRelocs(InputSecti
if (auto *S = dyn_cast<SharedSymbol<ELFT>>(&Body))
S->File->IsUsed = true;
- RelExpr Expr = Target->getRelExpr(Type, Body);
-
uintX_t Addend = getAddend<ELFT>(RI);
const uint8_t *BufLoc = Buf + RI.r_offset;
if (!RelTy::IsRela)
@@ -471,7 +469,7 @@ void Writer<ELFT>::scanRelocs(InputSecti
if (Config->EMachine == EM_MIPS)
Addend += findMipsPairedAddend<ELFT>(Buf, BufLoc, Body, &RI, E);
- bool Preemptible = Body.isPreemptible();
+ RelExpr Expr = Target->getRelExpr(Type, Body);
if (unsigned Processed =
handleTlsRelocation<ELFT>(Type, Body, C, Offset, Addend, Expr)) {
I += (Processed - 1);
@@ -494,6 +492,8 @@ void Writer<ELFT>::scanRelocs(InputSecti
}
}
+ bool Preemptible = Body.isPreemptible();
+
// If a relocation needs PLT, we create a PLT and a GOT slot
// for the symbol.
TargetInfo::PltNeed NeedPlt = Target->needsPlt(Type, Body);
More information about the llvm-commits
mailing list