This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Emit DW_TAG_enumeration_type for referenced global enumerator.
ClosedPublic

Authored by ychen on Sep 3 2019, 9:29 PM.

Event Timeline

ychen created this revision.Sep 3 2019, 9:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 3 2019, 9:29 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

What is the reason for this change? The test case and comment changes don't seem related to the actual code change, which would affect DIGlobalVariables.

rnk added inline comments.Sep 4 2019, 11:26 AM
clang/lib/CodeGen/CGDebugInfo.cpp
4441–4462

Please simplify the logic and make these comments more coherent and understandable. This return is redundant with the later return, for example.

Basically, rC361400 removed an otherwise unused call to getOrCreateType. getOrCreateType happens to have the side effect of recording all enum types on the side in DIBuilder::AllEnumTypes, which are eventually referred to by the compile unit.

ychen updated this revision to Diff 218769.Sep 4 2019, 12:37 PM
  • address comment
ychen marked an inline comment as done.Sep 4 2019, 12:38 PM
rnk accepted this revision.Sep 4 2019, 1:02 PM

lgtm, thanks!

This revision is now accepted and ready to land.Sep 4 2019, 1:02 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2019, 1:56 PM
ychen added a comment.Sep 4 2019, 1:59 PM
In D67141#1658238, @rnk wrote:

lgtm, thanks!

Thank you!