summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-11-13 20:07:32 +0000
committerZachary Turner <zturner@google.com>2018-11-13 20:07:32 +0000
commit03a24052f394f7e3e4713dd409d8fa3a126643f9 (patch)
treedb898386519d16a04d4becccf9967783326c576a /llvm/lib/DebugInfo/PDB
parentc2728bc932238b6d37c9024d037920d4b1572e2b (diff)
downloadbcm5719-llvm-03a24052f394f7e3e4713dd409d8fa3a126643f9.tar.gz
bcm5719-llvm-03a24052f394f7e3e4713dd409d8fa3a126643f9.zip
[NativePDB] Improved support for nested type reconstruction.
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 CXXRecordDecls 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. Differential Revision: https://reviews.llvm.org/D54357 llvm-svn: 346786
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp b/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp
index 44781705bfa..eadecadc2a7 100644
--- a/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp
@@ -215,6 +215,7 @@ TpiStream::findFullDeclForForwardRef(TypeIndex ForwardRefTI) const {
}
codeview::CVType TpiStream::getType(codeview::TypeIndex Index) {
+ assert(!Index.isSimple());
return Types->getType(Index);
}
OpenPOWER on IntegriCloud