🍒 [lldb][DWARFASTParserClang] Treat DW_TAG_template_alias like we do DW_TAG_typedef #11918
+348
−174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clang gained the
-gtemplate-aliasnot too long ago, which emits C++alias templates as
DW_TAG_template_alias(instead ofDW_TAG_typedef). The main difference is thatDW_TAG_template_aliashas
DW_TAG_template_XXXchildren. The flag was not enabled by defaultbecause consumers (mainly LLDB) didn't know how to handle it. This patch
adds rudimentary support for debugging with
DW_TAG_template_alias.This patch simply creates the same kind of
TypedefDeclas we do forDW_TAG_typedef. The more complete solution would be to create aTypeAliasTemplateDecland associatedTypeAliasDecl. But that wouldrequire DWARF to carry generic template information, but currently each
DW_TAG_template_aliasrepresents a concrete instantiation. We couldprobably hack up some working AST representation that includes the
template parameters, but I currently don't see a compelling reason to.
All we need is the
DW_AT_nameand theDW_AT_typethat the typedefrefers to.
rdar://137499401
(cherry picked from commit 1f35b52)