[lld] r244696 - Delete dead code.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 16:27:51 PDT 2015


Thank you for doing this. This code is for COFF-ism where we have a
relocation for offset-in-a-section (so you need to know the address of
output section for a chunk.) We don't need this for ELF.

On Tue, Aug 11, 2015 at 4:19 PM, Rafael Espindola via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rafael
> Date: Tue Aug 11 18:19:06 2015
> New Revision: 244696
>
> URL: http://llvm.org/viewvc/llvm-project?rev=244696&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=244696&r1=244695&r2=244696&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Chunks.h (original)
> +++ lld/trunk/ELF/Chunks.h Tue Aug 11 18:19:06 2015
> @@ -48,11 +48,6 @@ public:
>    // It is illegal to call this function on non-section chunks.
>    virtual StringRef getSectionName() const = 0;
>
> -  // An output section has pointers to chunks in the section, and each
> -  // chunk has a back pointer to an output section.
> -  void setOutputSection(OutputSection *O) { Out = O; }
> -  OutputSection *getOutputSection() { return Out; }
> -
>  protected:
>    // The VA of this chunk in the output. The writer sets a value.
>    uint64_t VA = 0;
> @@ -60,9 +55,6 @@ protected:
>    // The offset from beginning of the output file. The writer sets a
> value.
>    uint64_t FileOff = 0;
>
> -  // The output section for this chunk.
> -  OutputSection *Out = nullptr;
> -
>    // The alignment of this chunk. The writer uses the value.
>    uint32_t Align = 1;
>  };
>
> Modified: lld/trunk/ELF/Writer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=244696&r1=244695&r2=244696&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Writer.cpp (original)
> +++ lld/trunk/ELF/Writer.cpp Tue Aug 11 18:19:06 2015
> @@ -119,7 +119,6 @@ void OutputSection::addSectionChunk(Sect
>    typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
>
>    Chunks.push_back(C);
> -  C->setOutputSection(this);
>    uintX_t Off = Header.sh_size;
>    Off = RoundUpToAlignment(Off, C->getAlign());
>    C->setVA(Off);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150811/6031070b/attachment.html>


More information about the llvm-commits mailing list