This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Support Fortran 'use <external module>' statement.
ClosedPublic

Authored by cchen15 on Dec 17 2020, 8:29 AM.

Details

Summary

The main change in this patch is to add a 'IsDecl' field to DIModule so that when IsDecl is set to true, the debug info entry generated for the module would be marked as a declaration. That way, the debugger (GDB at least) would look up the definition of the module in the gloabl scope.

Please see the comments in llvm/test/DebugInfo/X86/dimodule.ll for what the debug info entries would look like.

Diff Detail

Event Timeline

cchen15 created this revision.Dec 17 2020, 8:29 AM
cchen15 requested review of this revision.Dec 17 2020, 8:29 AM
Herald added a project: Restricted Project. · View Herald Transcript
SouraVX accepted this revision.Dec 17 2020, 10:19 PM

LGTM! Thanks for the patch.
One small thing, do you mind adding a one liner to release notes ? It would help in tracking extensions to Debug Metadata(previous extensions of DIModule were part of LLVM11).

This revision is now accepted and ready to land.Dec 17 2020, 10:19 PM

LGTM! Thanks for the patch.
One small thing, do you mind adding a one liner to release notes ? It would help in tracking extensions to Debug Metadata(previous extensions of DIModule were part of LLVM11).

Will do. Thanks for the review.

aprantl accepted this revision.Dec 18 2020, 8:49 AM

Thank you, this makes sense!

gkm added a subscriber: gkm.Dec 18 2020, 11:53 AM

@cchen15 @SouraVX @aprantl

This diff breaks git source trees on case-insensitive filesystems, such as on macOS.
I did this on Linux, which is case-sensitive:

$ find . |fgrep -i llvm/test/DebugInfo/X86/DIModule.ll
./llvm/test/DebugInfo/X86/DIModule.ll
./llvm/test/DebugInfo/X86/dimodule.ll

On a case-insensitive filesystem, these names collide and one overwrites the other, yeilding a tree with irreconcilable conflicts.

Please fix ASAP! Thanx!

In D93462#2463742, @gkm wrote:

@cchen15 @SouraVX @aprantl

This diff breaks git source trees on case-insensitive filesystems, such as on macOS.
I did this on Linux, which is case-sensitive:

$ find . |fgrep -i llvm/test/DebugInfo/X86/DIModule.ll
./llvm/test/DebugInfo/X86/DIModule.ll
./llvm/test/DebugInfo/X86/dimodule.ll

On a case-insensitive filesystem, these names collide and one overwrites the other, yeilding a tree with irreconcilable conflicts.

Please fix ASAP! Thanx!

My apologies for the snafu.

There is a patch proposed at https://reviews.llvm.org/D93559.

gkm added a comment.Dec 18 2020, 12:12 PM

Awesome! Thank you @cchen15 !