[PATCH] D143229: [FunctionImporter] Add flag to disable upgrading debug info
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 8 11:26:49 PST 2023
aeubanks added a comment.
In D143229#4107958 <https://reviews.llvm.org/D143229#4107958>, @mehdi_amini wrote:
> 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?
We don't typically run the verifier in assert builds because it's expensive. We assume that input bitcode passes the verifier.
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