This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Prioritize DILocalScope over file loc
ClosedPublic

Authored by Dinistro on Feb 28 2023, 7:35 AM.

Details

Summary

This commit ensures that the LLVMIR export prioritizes existing
DILocalScope attribute information as location scopes over files
constructed from filenames. All DILocalScope attributes contain file
information, so no information is lost. The previous implementation
caused the introduction of superfluous DILexicalBlockFile nodes in
certain cases. The old implementation remains as a fallback when no
DILocalScope is present.

Diff Detail

Event Timeline

Dinistro created this revision.Feb 28 2023, 7:35 AM
Herald added a project: Restricted Project. · View Herald Transcript
Dinistro requested review of this revision.Feb 28 2023, 7:35 AM
gysit added inline comments.Feb 28 2023, 8:01 AM
mlir/lib/Target/LLVMIR/DebugTranslation.cpp
294
Dinistro updated this revision to Diff 501158.Feb 28 2023, 8:28 AM

fix nullptr comparison

gysit accepted this revision.Feb 28 2023, 8:31 AM

LGTM!

FYI @rriddle. Let us know if you have any concerns.

This revision is now accepted and ready to land.Feb 28 2023, 8:31 AM
This revision was automatically updated to reflect the committed changes.