[lld] r278446 - Remove useless local variable.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 17:36:56 PDT 2016


Author: ruiu
Date: Thu Aug 11 19:36:56 2016
New Revision: 278446

URL: http://llvm.org/viewvc/llvm-project?rev=278446&view=rev
Log:
Remove useless local variable.

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=278446&r1=278445&r2=278446&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Aug 11 19:36:56 2016
@@ -386,13 +386,12 @@ template <class ELFT> void assignOffsets
 }
 
 template <class ELFT> void LinkerScript<ELFT>::assignAddresses() {
-  ArrayRef<OutputSectionBase<ELFT> *> Sections = *OutputSections;
   // Orphan sections are sections present in the input files which
   // are not explicitly placed into the output file by the linker script.
   // We place orphan sections at end of file.
   // Other linkers places them using some heuristics as described in
   // https://sourceware.org/binutils/docs/ld/Orphan-Sections.html#Orphan-Sections.
-  for (OutputSectionBase<ELFT> *Sec : Sections) {
+  for (OutputSectionBase<ELFT> *Sec : *OutputSections) {
     StringRef Name = Sec->getName();
     if (getSectionIndex(Name) == INT_MAX)
       Opt.Commands.push_back(llvm::make_unique<OutputSectionCommand>(Name));
@@ -422,7 +421,7 @@ template <class ELFT> void LinkerScript<
     // one section with such name, if the alignment, flags or type
     // attribute differs.
     auto *Cmd = cast<OutputSectionCommand>(Base.get());
-    for (OutputSectionBase<ELFT> *Sec : Sections) {
+    for (OutputSectionBase<ELFT> *Sec : *OutputSections) {
       if (Sec->getName() != Cmd->Name)
         continue;
 




More information about the llvm-commits mailing list