This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Add stringLocationExp field to DIStringType
ClosedPublic

Authored by cchen15 on Jan 18 2022, 10:38 AM.

Details

Summary

DIStringType is used to encode the debug info of a character object in Fortran. A Fortran deferred-length character object is typically implemented as a pair of the following two pieces of info: A pointer to the raw storage of the characters, and the length of the object. The stringLocationExp field contains the DIExpression to get to the raw storage.

This patch also enables the emission of DW_AT_data_location attribute in a DW_TAG_string_type debug info entry based on stringLocationExp in DIStringType.

A test is added to ensure that the bitcode reader is backward compatible with the old DIStringType format.

Diff Detail

Event Timeline

cchen15 created this revision.Jan 18 2022, 10:38 AM
cchen15 requested review of this revision.Jan 18 2022, 10:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2022, 10:38 AM
cchen15 updated this revision to Diff 400943.Jan 18 2022, 12:08 PM

Format fixes.

aprantl added inline comments.Jan 24 2022, 12:58 PM
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
1426

Would it be possible to load this in a backwards-compatible way, so old records of size 8 still work?

cchen15 added inline comments.Jan 24 2022, 2:04 PM
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
1426

Thanks for pointing this out. It will be addressed in the next patch.

cchen15 updated this revision to Diff 402660.Jan 24 2022, 2:05 PM
cchen15 updated this revision to Diff 403000.Jan 25 2022, 12:20 PM
cchen15 edited the summary of this revision. (Show Details)
cchen15 added a project: debug-info.

Added a test for backward compatibility.

aprantl accepted this revision.Jan 26 2022, 8:38 AM
This revision is now accepted and ready to land.Jan 26 2022, 8:38 AM
This revision was landed with ongoing or failed builds.Jan 26 2022, 8:57 AM
This revision was automatically updated to reflect the committed changes.