[all-commits] [llvm/llvm-project] f48270: [lldb] Centralize type "desugaring" logic in Clang...

Pavel Labath via All-commits all-commits at lists.llvm.org
Tue Dec 10 05:04:46 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f482708149138088f74f6b01668208a8c037563c
      https://github.com/llvm/llvm-project/commit/f482708149138088f74f6b01668208a8c037563c
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2019-12-10 (Tue, 10 Dec 2019)

  Changed paths:
    M lldb/source/Symbol/ClangASTContext.cpp

  Log Message:
  -----------
  [lldb] Centralize type "desugaring" logic in ClangASTContext

Summary:
A *lot* of ClangASTContext functions contained repetitive code for
"desugaring" certain kinds of clang types. This patch creates a utility
function for performing this task.

Right now it handles four types (auto, elaborated, paren and typedef),
as these are the types that were handled everywhere. There are probably
other kinds of types that could/should be added here too (TypeOf,
decltype, ...), but I'm leaving that for a separate patch as doing that
would not be NFC (though I'm pretty sure that adding them will not hurt,
and it may in fact fix some bugs).

In another patch I'd like to add "atomic" type to this list to properly
display atomic structs.

Since sometimes one may want to handle a certain kind of type specially
(right now we have code which does that with typedefs), the Desugar
function takes a "mask" argument, which can supress desugaring of
certain kinds of types.

Reviewers: teemperor, shafik

Subscribers: jfb, lldb-commits

Tags: #lldb

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




More information about the All-commits mailing list