[Lldb-commits] [PATCH] D71212: [lldb] Centralize type "desugaring" logic in ClangASTContext

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 9 08:33:50 PST 2019


labath created this revision.
labath added reviewers: teemperor, shafik.
Herald added a subscriber: jfb.
Herald added a project: LLDB.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71212

Files:
  lldb/source/Symbol/ClangASTContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71212.232868.patch
Type: text/x-patch
Size: 53145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191209/2a98e5c4/attachment-0001.bin>


More information about the lldb-commits mailing list