Reduce the memory footprint of dsymutil. (NFC)
authorAdrian Prantl <aprantl@apple.com>
Fri, 24 Aug 2018 20:41:08 +0000 (20:41 +0000)
committerAdrian Prantl <aprantl@apple.com>
Fri, 24 Aug 2018 20:41:08 +0000 (20:41 +0000)
commit29729f152960f32fa73b0d350c6ea5ed96e61850
tree7099e89d6ef7e0bfedacc877c30c818f9166584f
parentfaf300f0695350a13c598e204d9fbd7ab969739f
Reduce the memory footprint of dsymutil. (NFC)

This (partially) fixes a regression introduced by
https://reviews.llvm.org/D43945 / r327399, which parallelized
DwarfLinker. This patch avoids parsing and allocating the memory for
all input DIEs up front and instead only allocates them in the
concurrent loop in the AnalyzeLambda. At the end of the loop the
memory from the LinkContext is cleared again.

This reduces the peak memory needed to link the debug info of a
non-modular build of the Swift compiler by >3GB.

rdar://problem/43444464

Differential Revision: https://reviews.llvm.org/D51078

llvm-svn: 340650
llvm/tools/dsymutil/DwarfLinker.cpp
llvm/tools/dsymutil/DwarfLinker.h