OSDN Git Service

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)
commit5309f160df7a945ac067d97d3cc3bc5b73bfa313
treed2204de436e7d70173267ae392607d39395e7aae
parent84d4a7bcc97512fd4f0b00005938faf2f981124d
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340650 91177308-0d34-0410-b5e6-96231b3b80d8
tools/dsymutil/DwarfLinker.cpp
tools/dsymutil/DwarfLinker.h