Skip to content

Commit e9719ba

Browse files
authored
Merge pull request #7643 from apple/cherrypick/rebranch/077d89f0ee84
[DWARFLinker] Only extract unit DIEs when cloning clang modules (llvm#69495)
2 parents 6b8f65a + 791931a commit e9719ba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/DWARFLinker/DWARFLinker.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2658,12 +2658,12 @@ Error DWARFLinker::link() {
26582658
continue;
26592659
}
26602660

2661-
// In a first phase, just read in the debug info and load all clang modules.
2661+
// Clone all the clang modules with requires extracting the DIE units. We
2662+
// don't need the full debug info until the Analyze phase.
26622663
OptContext.CompileUnits.reserve(
26632664
OptContext.File.Dwarf->getNumCompileUnits());
2664-
26652665
for (const auto &CU : OptContext.File.Dwarf->compile_units()) {
2666-
auto CUDie = CU->getUnitDIE(false);
2666+
auto CUDie = CU->getUnitDIE(/*ExtractUnitDIEOnly=*/true);
26672667
if (Options.Verbose) {
26682668
outs() << "Input compilation unit:";
26692669
DIDumpOptions DumpOpts;
@@ -2704,9 +2704,9 @@ Error DWARFLinker::link() {
27042704
return;
27052705

27062706
for (const auto &CU : Context.File.Dwarf->compile_units()) {
2707-
// The !isClangModuleRef condition effectively skips over fully resolved
2708-
// skeleton units.
2709-
auto CUDie = CU->getUnitDIE();
2707+
// Previously we only extracted the unit DIEs. We need the full debug info
2708+
// now.
2709+
auto CUDie = CU->getUnitDIE(/*ExtractUnitDIEOnly=*/false);
27102710
std::string PCMFile = getPCMFile(CUDie, Options.ObjectPrefixMap);
27112711

27122712
if (!CUDie || LLVM_UNLIKELY(Options.Update) ||

0 commit comments

Comments
 (0)