[lld] r244896 - Delete dead code.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 07:48:49 PDT 2015


Author: rafael
Date: Thu Aug 13 09:48:49 2015
New Revision: 244896

URL: http://llvm.org/viewvc/llvm-project?rev=244896&view=rev
Log:
Delete dead code.

Modified:
    lld/trunk/ELF/Chunks.h
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Chunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Chunks.h?rev=244896&r1=244895&r2=244896&view=diff
==============================================================================
--- lld/trunk/ELF/Chunks.h (original)
+++ lld/trunk/ELF/Chunks.h Thu Aug 13 09:48:49 2015
@@ -37,10 +37,8 @@ public:
   virtual void writeTo(uint8_t *Buf) = 0;
 
   // The writer sets and uses the addresses.
-  uint64_t getVA() { return VA; }
   uint64_t getFileOff() { return FileOff; }
   uint32_t getAlign() { return Align; }
-  void setVA(uint64_t V) { VA = V; }
   void setFileOff(uint64_t V) { FileOff = V; }
 
   // Returns the section name if this is a section chunk.
@@ -48,9 +46,6 @@ public:
   virtual StringRef getSectionName() const = 0;
 
 protected:
-  // The VA of this chunk in the output. The writer sets a value.
-  uint64_t VA = 0;
-
   // The offset from beginning of the output file. The writer sets a value.
   uint64_t FileOff = 0;
 

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=244896&r1=244895&r2=244896&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Aug 13 09:48:49 2015
@@ -114,8 +114,6 @@ template <class ELFT> void Writer<ELFT>:
 
 template <class ELFT> void OutputSection<ELFT>::setVA(uintX_t VA) {
   Header.sh_addr = VA;
-  for (Chunk *C : Chunks)
-    C->setVA(C->getVA() + VA);
 }
 
 template <class ELFT> void OutputSection<ELFT>::setFileOffset(uintX_t Off) {
@@ -131,7 +129,6 @@ void OutputSection<ELFT>::addSectionChun
   Chunks.push_back(C);
   uintX_t Off = Header.sh_size;
   Off = RoundUpToAlignment(Off, C->getAlign());
-  C->setVA(Off);
   C->setFileOff(Off);
   Off += C->getSize();
   Header.sh_size = Off;




More information about the llvm-commits mailing list