This is an archive of the discontinued LLVM Phabricator instance.

Add template type and value parameter metadata nodes to template variable specializations
ClosedPublic

Authored by ormris on Sep 13 2018, 1:27 PM.

Details

Summary

Add an optional attribute referring to a tuple of type and value template parameter nodes to the DIGlobalVariable node. This allows us to record the parameters of template variable specializations.

Diff Detail

Event Timeline

ormris created this revision.Sep 13 2018, 1:27 PM
JDevlieghere added inline comments.Sep 14 2018, 6:36 AM
lib/CodeGen/CGDebugInfo.cpp
3126

What's the meaning of this comment?

lib/CodeGen/CGDebugInfo.h
654

s/templateParameters/TemplateParameters/ (same for the rest of this patch)

ormris added inline comments.Sep 14 2018, 9:18 AM
lib/CodeGen/CGDebugInfo.cpp
3126

Hmm... That should be removed.

lib/CodeGen/CGDebugInfo.h
654

OK. Will fix.

ormris updated this revision to Diff 165789.EditedSep 17 2018, 10:59 AM
  • Removed unneeded comment
  • Renamed variable
  • Rebased
ormris marked 2 inline comments as done.Sep 17 2018, 11:00 AM

Generally this looks good, but I'd like for the other to have a look first (at this and the other patch) before accepting.

lib/CodeGen/CGDebugInfo.cpp
1783

Might be nice to add a comment here saying what you're doing in this block and below. Looks like the top one is for partial specialization and the bottom one for the general case?

1783

I also suggest to extract TS->getSpecializedTemplateOrPartial() into a variable to make this a little less dense.

Generally this looks good, but I'd like for the other to have a look first (at this and the other patch) before accepting.

Sounds good. Thanks for your comments!

lib/CodeGen/CGDebugInfo.cpp
1783

Hmm... Yeah. I'll take a look at clarifying this section.

ormris updated this revision to Diff 167849.Oct 1 2018, 3:53 PM
  • Clarify CGDebugInfo::CollectVarTemplateParams
ormris marked 2 inline comments as done.Oct 1 2018, 3:54 PM
This revision is now accepted and ready to land.Oct 3 2018, 7:03 AM
ormris added a comment.Oct 3 2018, 9:40 AM

Thanks! I'll go ahead and commit this.

ormris retitled this revision from Add Parameters to DW_AT_name Attribute of Template Variables to Add template type and value parameter metadata nodes to template variable specializations.Oct 3 2018, 11:41 AM
ormris edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.