Skip to content

Commit 93c8684

Browse files
author
Zachary Turner
committed
[NativePDB] Higher fidelity reconstruction of AST from Debug Info.
In order to accurately put a type into the correct location in the AST we construct from debug info, we need to be able to determine what DeclContext (namespace, global, nested class, etc) that it goes into. PDB doesn't contain this mapping. It does, however, contain the reverse mapping. That is, for a given class type T, you can determine all classes Q1, Q2, ..., Qn that are nested inside of T. We need to know, for a given class type Q, what type T is it nested inside of. This patch builds this map as a pre-processing step when we first load the PDB by scanning every type. Initial tests show that while this can be slow in debug builds of LLDB, it is quite fast in release builds (less than 2 seconds for a ~1GB PDB, and it only needs to happen once). Furthermore, having this pre-processing step in place allows us to repurpose it for building up other kinds of indexing to it down the line. For the time being, this gives us very accurate reconstruction of the DeclContext hierarchy. Differential Revision: https://reviews.llvm.org/D54216 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346429 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 9d83280 commit 93c8684

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/llvm/DebugInfo/CodeView/TypeRecord.h

+4
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ class TagRecord : public TypeRecord {
429429
return (Options & ClassOptions::ForwardReference) != ClassOptions::None;
430430
}
431431

432+
bool containsNestedClass() const {
433+
return (Options & ClassOptions::ContainsNestedClass) != ClassOptions::None;
434+
}
435+
432436
bool isScoped() const {
433437
return (Options & ClassOptions::Scoped) != ClassOptions::None;
434438
}

0 commit comments

Comments
 (0)