[PATCH] D143229: [FunctionImporter] Don't upgrade debug info if llvm.idents match
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 6 12:43:06 PST 2023
mehdi_amini added a comment.
Looking at the implementation:
/// Check the debug info version number, if it is out-dated, drop the debug
/// info. Return true if module is modified.
bool llvm::UpgradeDebugInfo(Module &M) {
unsigned Version = getDebugMetadataVersionFromModule(M);
if (Version == DEBUG_METADATA_VERSION) {
bool BrokenDebugInfo = false;
if (verifyModule(M, &llvm::errs(), &BrokenDebugInfo))
report_fatal_error("Broken module found, compilation aborted!");
if (!BrokenDebugInfo)
// Everything is ok.
return false;
else {
// Diagnose malformed debug info.
DiagnosticInfoIgnoringInvalidDebugMetadata Diag(M);
M.getContext().diagnose(Diag);
}
}
...
1. Contrary to the name of the API, this does not seem to "upgrade" anything: it merely drops outdated debug info. (Am I missing something?)
2. This runs the verifier but does not fail verification on debug info related issue, instead it'll drop metadata when something is wrong there.
So are we re-running the IR verifier independently? And if we don't what kind of inconsistency would we be setting up?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143229/new/
https://reviews.llvm.org/D143229
More information about the llvm-commits
mailing list