[PATCH] D13958: Mere SHF_STRING
Rafael Ávila de Espíndola via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 24 05:43:56 PDT 2015
rafael added inline comments.
================
Comment at: ELF/OutputSections.cpp:720-724
@@ -719,5 +719,7 @@
template <class ELFT> void MergeOutputSection<ELFT>::writeTo(uint8_t *Buf) {
- for (const std::pair<ArrayRef<uint8_t>, uintX_t> &P : Offsets) {
- ArrayRef<uint8_t> Data = P.first;
+ if (shouldTailMerge()) {
+ StringRef Data = Builder.data();
memcpy(Buf, Data.data(), Data.size());
- Buf += Data.size();
+ return;
+ }
+ for (const std::pair<StringRef, size_t> &P : Builder.getMap()) {
----------------
ruiu wrote:
> This path should work for !shouldTailMerge() too, no?
No, the buffer is only created during finalize.
http://reviews.llvm.org/D13958
More information about the llvm-commits
mailing list