Summary
This patch makes debug-info generation aware of the
[[clang::preferred_name]] attribute. The attribute tells clang
to print the annotated class template as some typedef (e.g., in
diagnostics).
When printing a typename for emission into DW_AT_name this patch now
uses the preferred_name (if available). This is behind an LLDB tuning
because by default we try to avoid diverging GCC and Clang typename
format (which is why the PrintingPolicy::UsePreferredNames has
previously been disabled by default in CGDebugInfo).
Motivation
This will reduce noise in type summaries when showing variable
types in LLDB. E.g.,:
(lldb) v (std::vector<std::basic_string<char> >) vec = size=0 {}
becomes
(lldb) v (std::vector<std::string>) vec = size=0 {}
Testing
- Added Clang test
- Adjusted LLDB API tests
Is -debug-info-kind=limited needed here? Using it here is odd since LLDB doesn't really support it and favors =standalone instead.