[Lldb-commits] [PATCH] D54053: [NativePDB] Add the ability to create clang record decls from mangled names.
Zachary Turner via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Nov 2 15:01:19 PDT 2018
zturner created this revision.
zturner added reviewers: aleksandr.urakov, labath, lemo.
Herald added subscribers: erik.pilkington, mgorny.
Previously we were not able to accurately represent tag record types with clang record decls. The primary reason for this is that for type information PDB only contains fully instantiated type names. It does not contain rich information about namespaces, declaration contexts (e.g. parent classes, function scopes for local classes, etc), template parameters, or anything else. All you have is a big long string that is a fully instantiated type name. What it does give you, however, is the mangled name of this type. So we can extract all of the relevant information (minus the distinction between outer class and outer namespace) from the mangled name. This patch is the start of this effort.
It uses LLVM's demangler to demangle the name, and treat each component as one component of a namespace chain.
Obviously this is not true in the general case, as something like `Foo<int>::Bar(double)::`1'::LocalClass<7>::NestedClass` will get treated as if it were in a series of namespaces. However, it's a good start, and clang doesn't actually care for most uses. So we can improve on this incrementally with subsequent patches to make this more accurate.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 10836 bytes
Desc: not available
More information about the lldb-commits