Skip to content

[DWARFLinker] Only extract unit DIEs when cloning clang modules #69495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions llvm/lib/DWARFLinker/DWARFLinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2682,12 +2682,12 @@ Error DWARFLinker::link() {
continue;
}

// In a first phase, just read in the debug info and load all clang modules.
// Clone all the clang modules with requires extracting the DIE units. We
// don't need the full debug info until the Analyze phase.
OptContext.CompileUnits.reserve(
OptContext.File.Dwarf->getNumCompileUnits());

for (const auto &CU : OptContext.File.Dwarf->compile_units()) {
auto CUDie = CU->getUnitDIE(false);
auto CUDie = CU->getUnitDIE(/*ExtractUnitDIEOnly=*/true);
if (Options.Verbose) {
outs() << "Input compilation unit:";
DIDumpOptions DumpOpts;
Expand Down Expand Up @@ -2728,9 +2728,9 @@ Error DWARFLinker::link() {
return;

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

if (!CUDie || LLVM_UNLIKELY(Options.Update) ||
Expand Down