[Lldb-commits] [PATCH] D54357: [NativePDB] Improved support for nested type reconstruction

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 9 14:34:13 PST 2018


zturner created this revision.
zturner added reviewers: lemo, aleksandr.urakov.
Herald added a subscriber: hiraditya.

In a previous patch, we pre-processed the TPI stream in order to build the reverse mapping from nested type -> parent type so that we could accurately reconstruct a DeclContext hierarchy.

However, there were some issues.  An `LF_NESTTYPE` record is really just a typedef, so although it happens to be used to indicate the name of the nested type and referring to the global record which defines the type, it is also used for every other kind of nested typedef.  When we rebuild the `DeclContext` hierarchy, we want it to be as accurate as possible, which means that if we have something like:

  struct A {
    struct B {};
    using C = B;
  };

We don't want to create two `CXXRecordDecl`s in the AST each with the exact same definition.  We just want to create one for `B` and then define `C` as an alias to `B`.  Previously, however, it would not be able to distinguish between the two cases and it would treat `A::B` and `A::C` as being two classes each with separate definitions.  We address the first half of improving the pre-processing logic so that only actual definitions are treated this way.

Later, in a followup patch, we can handle the case of nested typedefs since we're already going to be enumerating the field list anyway and this patch introduces the general framework for distinguishing between the two cases.


https://reviews.llvm.org/D54357

Files:
  lldb/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit
  lldb/lit/SymbolFile/NativePDB/nested-types.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp
  llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54357.173447.patch
Type: text/x-patch
Size: 11435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181109/442cb8bf/attachment.bin>


More information about the lldb-commits mailing list