Otherwise we may be inserting a decl into a DeclContext that's not fully defined yet.
This simplifies/removes some clang AST node creation code. Instead, use
clang::printTemplateArgumentList().
Differential D142413
[lldb] Don't create Clang AST nodes in GetDIEClassTemplateParams aeubanks on Jan 23 2023, 3:47 PM. Authored by
Details Otherwise we may be inserting a decl into a DeclContext that's not fully defined yet. This simplifies/removes some clang AST node creation code. Instead, use
Diff Detail
Event TimelineComment Actions there may be an alternate solution involving making some declarations into definitions (at all? earlier?), but I don't have that level of understanding of lldb
Comment Actions One idea that came to mind is that instead of creating a dummy template decl in GetDIEClassTemplateParams, you could perhaps construct a clang::TemplateArgumentList from the TemplateArguments stored in TemplateParameterInfos and use the clang::printTemplateArgumentList to stringify the template arguments, passing it the printing-policy which is used in TypeSystemClang to print type-names in your current implementation.
Comment Actions this worked perfectly and simplified a lot of code, thanks!
|
Btw, what's guaranteeing that we don't call this more than once per DIE? Is there any way we could add a test that would notify us of that kind of regression? Or perhaps an assert somewhere in the DWARFASTParserClang?