[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://r
[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://reviews.llvm.org/D128077
show more ...
[lldb] Make the ClassTemplateDecl merging logic in TypeSystemClang respect template parametersDWARF doesn't describe templates itself but only actual template instantiations.Because of that LLDB h
[lldb] Make the ClassTemplateDecl merging logic in TypeSystemClang respect template parametersDWARF doesn't describe templates itself but only actual template instantiations.Because of that LLDB has to infer the parameters of the class templatedeclarations from the actual instantiations when creating the internal Clang ASTfrom debug infoBecause there is no dedicated DIE for the class template, LLDB also creates the`ClassTemplateDecl` implicitly when parsing a template instantiation. To avoidcreating one ClassTemplateDecls for every instantiation,`TypeSystemClang::CreateClassTemplateDecl` will check if there is already a`ClassTemplateDecl` in the requested `DeclContext` and will reuse a foundfitting declaration.The logic that checks if a found class template fits to an instantiation iscurrently just comparing the name of the template. So right now we map`template<typename T> struct S;` to an instantiation with the values `S<1, 2,3>` even though they clearly don't belong together.This causes crashes later on when for example the Itanium mangler's`TemplateArgManglingInfo::needExactType` method tries to find fitting the classtemplate parameter that fits to an instantiation value. In the example above itwill try to find the parameter for the value `2` but will just trigger aboundary check when retrieving the parameter with index 1 from the classtemplate.There are two ways we can end up with an instantiation that doesn't fit to aclass template with the same name:1. We have two TUs with two templates that have the same name and internal linkage.2. A forward declared template instantiation is emitted by GCC and Clang without an empty list of parameter values.This patch makes the check for whether a class template declaration can bereused more sophisticated by also comparing whether the parameter values can fitto the found class template. If we can't find a fitting class template wejustcreate a second class template with the fitting parameters.Fixes rdar://76592821Reviewed By: kastiglioneDifferential Revision: https://reviews.llvm.org/D100662