[lld] r298789 - Remove redundant local variables.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 25 19:27:50 PDT 2017


Author: ruiu
Date: Sat Mar 25 21:27:50 2017
New Revision: 298789

URL: http://llvm.org/viewvc/llvm-project?rev=298789&view=rev
Log:
Remove redundant local variables.

Modified:
    lld/trunk/ELF/Relocations.cpp

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=298789&r1=298788&r2=298789&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Sat Mar 25 21:27:50 2017
@@ -700,8 +700,6 @@ static void scanRelocs(InputSectionBase
   typedef typename ELFT::uint uintX_t;
 
   const elf::ObjectFile<ELFT> *File = Sec.getFile<ELFT>();
-  ArrayRef<uint8_t> SectionData = Sec.Data;
-  const uint8_t *Buf = SectionData.begin();
   OffsetGetter GetOffset(Sec);
 
   for (auto I = Rels.begin(), E = Rels.end(); I != E; ++I) {
@@ -735,8 +733,8 @@ static void scanRelocs(InputSectionBase
       continue;
 
     bool Preemptible = isPreemptible(Body, Type);
-    Expr = adjustExpr(*File, Body, Expr, Type, Buf + Rel.r_offset, Sec,
-                      Rel.r_offset);
+    Expr = adjustExpr(*File, Body, Expr, Type, Sec.Data.data() + Rel.r_offset,
+                      Sec, Rel.r_offset);
     if (ErrorCount)
       continue;
 
@@ -746,7 +744,7 @@ static void scanRelocs(InputSectionBase
                        R_GOTREL_FROM_END, R_PPC_TOC>(Expr))
       In<ELFT>::Got->HasGotOffRel = true;
 
-    int64_t Addend = computeAddend(*File, Buf, E, Rel, Expr, Body);
+    int64_t Addend = computeAddend(*File, Sec.Data.data(), E, Rel, Expr, Body);
 
     if (unsigned Processed =
             handleTlsRelocation<ELFT>(Type, Body, Sec, Offset, Addend, Expr)) {




More information about the llvm-commits mailing list