Skip to content

Commit e08b4f2

Browse files
Print source filename when invalid debug info is found in LTO.
When invalid debug info is found in a module during LTO, the debug info from that module is stripped. However, we do not print the source filename, which makes it impossible to figure out where the invalid debug info is coming from. This patch prints the source file name.
1 parent 760bba4 commit e08b4f2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

llvm/lib/LTO/LTOCodeGenerator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ void LTOCodeGenerator::verifyMergedModuleOnce() {
548548
report_fatal_error("Broken module found, compilation aborted!");
549549
if (BrokenDebugInfo) {
550550
emitWarning("Invalid debug info found, debug info will be stripped");
551+
emitWarning("Source FileName: " + MergedModule->getSourceFileName());
551552
StripDebugInfo(*MergedModule);
552553
}
553554
}

llvm/lib/LTO/ThinLTOCodeGenerator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ static void verifyLoadedModule(Module &TheModule) {
182182
if (BrokenDebugInfo) {
183183
TheModule.getContext().diagnose(ThinLTODiagnosticInfo(
184184
"Invalid debug info found, debug info will be stripped", DS_Warning));
185+
TheModule.getContext().diagnose(ThinLTODiagnosticInfo(
186+
"Source File Name: " + TheModule.getSourceFileName(), DS_Warning));
185187
StripDebugInfo(TheModule);
186188
}
187189
}

0 commit comments

Comments
 (0)