[all-commits] [llvm/llvm-project] e0e7bb: [lldb] Always include template arguments that have...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Mon Nov 30 07:41:24 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e0e7bbeb545516c50a0354efc34d329453558c9c
      https://github.com/llvm/llvm-project/commit/e0e7bbeb545516c50a0354efc34d329453558c9c
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-11-30 (Mon, 30 Nov 2020)

  Changed paths:
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
    A lldb/test/API/lang/cpp/default-template-args/Makefile
    A lldb/test/API/lang/cpp/default-template-args/TestDefaultTemplateArgs.py
    A lldb/test/API/lang/cpp/default-template-args/main.cpp

  Log Message:
  -----------
  [lldb] Always include template arguments that have their default value in the internal type name

Our type formatters/summaries match on the internal type name we generate in LLDB for Clang types.

These names were generated using Clang's default printing policy. However Clang's
default printing policy got tweaked over the last month to make the generated type
names more readable (by for example excluding inline/anonymous namespaces and
removing template arguments that have their default value). This broke the formatter
system where LLDB's matching logic now no longer can format certain types as
the new type names generated by Clang's default printing policy no longer match
the type names that LLDB/the user specified.

I already introduced LLDB's own type printing policy and fixed the inline/anonymous
namespaces in da121fff1184267a405f81a87f7314df2d474e1c (just to get the
test suite passing again).

This patch is restoring the old type printing behaviour where always include the template
arguments in the internal type name (even if they match the default args). This should get
template type formatters/summaries working again in the rare situation where we do
know template default arguments within LLDB. This can only happen when either having
a template that was parsed in the expression parser or when we get type information from a C++ module.

The Clang change that removed defaulted template arguments from Clang's printing policy was
e7f3e2103cdb567dda4fd52f81bf4bc07179f5a8

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D92311




More information about the All-commits mailing list