From: Rui Ueyama Date: Fri, 11 Nov 2016 03:54:59 +0000 (+0000) Subject: Remove a member from InputSectionData and use the pool instead. X-Git-Tag: llvmorg-4.0.0-rc1~4940 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82664d9d4cdce96882caee8dced7c5200fd5a1c6;p=platform%2Fupstream%2Fllvm.git Remove a member from InputSectionData and use the pool instead. llvm-svn: 286557 --- diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 83fb3aa601b7..9823f4adfd10 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -13,6 +13,7 @@ #include "Error.h" #include "InputFiles.h" #include "LinkerScript.h" +#include "Memory.h" #include "OutputSections.h" #include "SyntheticSections.h" #include "Target.h" @@ -167,11 +168,10 @@ template void InputSectionBase::uncompress() { std::tie(Buf, Size) = getRawCompressedData(Data); // Uncompress Buf. - UncompressedData.reset(new uint8_t[Size]); - if (zlib::uncompress(toStringRef(Buf), (char *)UncompressedData.get(), - Size) != zlib::StatusOK) + char *OutputBuf = BAlloc.Allocate(Size); + if (zlib::uncompress(toStringRef(Buf), OutputBuf, Size) != zlib::StatusOK) fatal(getName(this) + ": error while uncompressing section"); - Data = ArrayRef(UncompressedData.get(), Size); + Data = ArrayRef((uint8_t *)OutputBuf, Size); } template diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index d39ee4c6189f..0d16bd50d688 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -66,9 +66,6 @@ public: return llvm::makeArrayRef((const T *)Data.data(), S / sizeof(T)); } - // If a section is compressed, this has the uncompressed section data. - std::unique_ptr UncompressedData; - std::vector Relocations; };