From 5cfd306e00ddd88bbd5e50a305b7437e3ba92584 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Thu, 14 Apr 2016 17:05:56 +0000 Subject: [PATCH] Move variables closer to code scopes that uses them. NFC. llvm-svn: 266340 --- lld/ELF/Writer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 0efc57102b6d..6bb139124998 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -462,8 +462,6 @@ void Writer::scanRelocs(InputSectionBase &C, ArrayRef Rels) { if (auto *S = dyn_cast>(&Body)) S->File->IsUsed = true; - RelExpr Expr = Target->getRelExpr(Type, Body); - uintX_t Addend = getAddend(RI); const uint8_t *BufLoc = Buf + RI.r_offset; if (!RelTy::IsRela) @@ -471,7 +469,7 @@ void Writer::scanRelocs(InputSectionBase &C, ArrayRef Rels) { if (Config->EMachine == EM_MIPS) Addend += findMipsPairedAddend(Buf, BufLoc, Body, &RI, E); - bool Preemptible = Body.isPreemptible(); + RelExpr Expr = Target->getRelExpr(Type, Body); if (unsigned Processed = handleTlsRelocation(Type, Body, C, Offset, Addend, Expr)) { I += (Processed - 1); @@ -494,6 +492,8 @@ void Writer::scanRelocs(InputSectionBase &C, ArrayRef Rels) { } } + 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);