[all-commits] [llvm/llvm-project] b5e49e: [lldb] Ignore certain Clang type sugar when creati...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Tue Sep 22 04:38:03 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b5e49e91cb90eda1f926139c8567e27f1b664cc1
      https://github.com/llvm/llvm-project/commit/b5e49e91cb90eda1f926139c8567e27f1b664cc1
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-09-22 (Tue, 22 Sep 2020)

  Changed paths:
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
    A lldb/test/API/lang/cpp/elaborated-types/Makefile
    A lldb/test/API/lang/cpp/elaborated-types/TestElaboratedTypes.py
    A lldb/test/API/lang/cpp/elaborated-types/main.cpp

  Log Message:
  -----------
  [lldb] Ignore certain Clang type sugar when creating the type name

Clang has some type sugar that only serves as a way to preserve the way a user
has typed a certain type in the source code. These types are currently not
unwrapped when we query the type name for a Clang type, which means that this
type sugar actually influences what formatters are picked for a certain type.
Currently if a user decides to reference a type by doing `::GlobalDecl Var = 3;`,
the type formatter for `GlobalDecl` will not be used (as the type sugar
around the type gives it the name `::GlobalDecl`. The same goes for other ways
to spell out a type such as `auto` etc.

With this patch most of this type sugar gets stripped when the full type name is
calculated. Typedefs are not getting desugared as that seems counterproductive.
I also don't desugar atomic types as that's technically not type sugar.

Reviewed By: jarin

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




More information about the All-commits mailing list