From 2e9bd89306a042e37df5d6734fb6d62d69efbbfc Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 23 May 2016 17:35:51 +0000 Subject: llvm-dwp: Ensure compressed sections are preserved long enough for use in the string pool Now that the string pool is referential rather than maintaining its own copy of string data, compressed sections (well, technically only the debug_str section*) need to be preserved for the lifetime of the pool to match. * I'm not currently optimizing for memory footprint with compressed input - the major memory limit I'm hitting is on dwp+dwp merge steps and we aren't currently compressing contents in dwp files, just in the .dwo inputs. llvm-svn: 270462 --- llvm/tools/llvm-dwp/llvm-dwp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/tools') diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp index 9a43420f710..b88f0ef37d7 100644 --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -395,6 +395,8 @@ static Error write(MCStreamer &Out, ArrayRef Inputs) { SmallVector, 128> Objects; Objects.reserve(Inputs.size()); + SmallVector, 4> UncompressedSections; + for (const auto &Input : Inputs) { auto ErrOrObj = object::ObjectFile::createObjectFile(Input); if (!ErrOrObj) @@ -413,8 +415,6 @@ static Error write(MCStreamer &Out, ArrayRef Inputs) { StringRef CurCUIndexSection; StringRef CurTUIndexSection; - SmallVector, 4> UncompressedSections; - for (const auto &Section : Obj.sections()) { if (Section.isBSS()) continue; -- cgit v1.2.3