This is an archive of the discontinued LLVM Phabricator instance.

[mlir][LLVM] Export DICompositeType as distinct MD when necessary
ClosedPublic

Authored by Dinistro on Jul 7 2023, 6:20 AM.

Details

Summary

This commit ensures that DICompositeTypes are exported as distinct
metadata nodes for structures, classes, unions, and enumerations.
Not emitting these as distinct metadata can potentially cause linking
issues involving debug sections.

Diff Detail

Event Timeline

Dinistro created this revision.Jul 7 2023, 6:20 AM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Dinistro requested review of this revision.Jul 7 2023, 6:20 AM
gysit added inline comments.Jul 9 2023, 8:50 AM
mlir/lib/Target/LLVMIR/DebugTranslation.cpp
122

nit: Returns

125

getDIType is a bit confusing since at least in MLIR DISuprogram is not a DITypeAttr. Should we call it:

template <typename NodeT, typename... Args>
static NodeT *getDistinctOrUnique(...)

or similar?

Dinistro updated this revision to Diff 538508.Jul 9 2023, 10:56 PM

address reviewer comments

Dinistro updated this revision to Diff 538513.Jul 9 2023, 11:28 PM
Dinistro marked 2 inline comments as done.

Rename templated function to reflect actual purpose better.

gysit accepted this revision.Jul 9 2023, 11:30 PM

LGTM!

This revision is now accepted and ready to land.Jul 9 2023, 11:30 PM