This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvmir] Add filename debug info when converting from LLVMIR.
ClosedPublic

Authored by gysit on Oct 3 2022, 2:52 AM.

Details

Summary

The revision enriches the debug locations generated during LLVMIR to MLIR translation with file name information and adds a separate test to exercise the debug location translation.

Diff Detail

Event Timeline

gysit created this revision.Oct 3 2022, 2:52 AM
Herald added a project: Restricted Project. · View Herald Transcript
gysit requested review of this revision.Oct 3 2022, 2:52 AM
ftynse accepted this revision.Oct 3 2022, 2:55 AM
ftynse added inline comments.
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
190–192

Nit: API-level entries should use /// for comments.

241–242

Is this still useful? Maybe use it to cache UnknownLoc::get()?

mlir/test/Target/LLVMIR/Import/debug-info.ll
10

Nit: basic block names are not guaranteed either, use something like ^{{.*}} instead.

This revision is now accepted and ready to land.Oct 3 2022, 2:55 AM
gysit updated this revision to Diff 464643.Oct 3 2022, 3:03 AM

Tried to make the linter work.

gysit updated this revision to Diff 464645.Oct 3 2022, 3:13 AM

Address comments.

gysit updated this revision to Diff 464646.Oct 3 2022, 3:19 AM

Address test comment.

gysit marked 3 inline comments as done.Oct 3 2022, 3:23 AM

I was not sure if there was a specific intention behind the unknownLoc but I assume UnknownLoc did not exist at the time.

This revision was landed with ongoing or failed builds.Oct 3 2022, 5:20 AM
This revision was automatically updated to reflect the committed changes.