[llvm] r270462 - llvm-dwp: Ensure compressed sections are preserved long enough for use in the string pool

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 10:35:54 PDT 2016


Author: dblaikie
Date: Mon May 23 12:35:51 2016
New Revision: 270462

URL: http://llvm.org/viewvc/llvm-project?rev=270462&view=rev
Log:
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.

Modified:
    llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp

Modified: llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp?rev=270462&r1=270461&r2=270462&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp (original)
+++ llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp Mon May 23 12:35:51 2016
@@ -395,6 +395,8 @@ static Error write(MCStreamer &Out, Arra
   SmallVector<OwningBinary<object::ObjectFile>, 128> Objects;
   Objects.reserve(Inputs.size());
 
+  SmallVector<SmallString<32>, 4> UncompressedSections;
+
   for (const auto &Input : Inputs) {
     auto ErrOrObj = object::ObjectFile::createObjectFile(Input);
     if (!ErrOrObj)
@@ -413,8 +415,6 @@ static Error write(MCStreamer &Out, Arra
     StringRef CurCUIndexSection;
     StringRef CurTUIndexSection;
 
-    SmallVector<SmallString<32>, 4> UncompressedSections;
-
     for (const auto &Section : Obj.sections()) {
       if (Section.isBSS())
         continue;




More information about the llvm-commits mailing list