[PDB] Create a SymbolCache class.
Part of the responsibility of the native PDB reader is to cache
symbols the first time they are accessed, so they can then be
looked up by an ID. Furthermore, we need to resolve type indices
to records that we vend to the user, and other things. Previously
this code was all thrown together a bit haphazardly in the native
session class, but it makes sense to collect all of this into a
single class whose sole responsibility is to manage the collection
of known symbols.
llvm-svn: 341608
diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp
index f545688..9dd66f3 100644
--- a/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp
@@ -24,12 +24,12 @@
: Session(PDBSession), Index(Index) {}
uint32_t NativeEnumModules::getChildCount() const {
- return Session.getNativeGlobalScope().getNumCompilands();
+ return Session.getSymbolCache().getNumCompilands();
}
std::unique_ptr<PDBSymbol>
NativeEnumModules::getChildAtIndex(uint32_t N) const {
- return Session.getNativeGlobalScope().getOrCreateCompiland(N);
+ return Session.getSymbolCache().getOrCreateCompiland(N);
}
std::unique_ptr<PDBSymbol> NativeEnumModules::getNext() {