[PATCH] D61696: [COFF] Simplify Chunk::writeTo and remove OutputSectionOff, NFC

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 13:50:52 PDT 2019


rnk created this revision.
rnk added reviewers: ruiu, aganea.
Herald added a project: LLVM.

Prior to this change, every implementation of writeTo would add
OutputSectionOff to the output section buffer start before writing data.
Instead, do this math in the caller, so that it can be written once
instead of many times.

The output section offset is always equivalent to the difference between
the chunk RVA and the output section RVA, so we can replace the one
remaining usage of OutputSectionOff with that subtraction.

This doesn't change the size of SectionChunk because of alignment
requirements, but I will rearrange the fields in a follow-up change to
accomplish that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61696

Files:
  lld/COFF/Chunks.cpp
  lld/COFF/Chunks.h
  lld/COFF/DLL.cpp
  lld/COFF/PDB.cpp
  lld/COFF/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61696.198719.patch
Type: text/x-patch
Size: 17014 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190508/9add27af/attachment.bin>


More information about the llvm-commits mailing list