diff options
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp index a65782e2d4f..f54568865aa 100644 --- a/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp @@ -10,33 +10,30 @@ #include "llvm/DebugInfo/PDB/Native/NativeEnumModules.h" #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" -#include "llvm/DebugInfo/PDB/Native/DbiModuleList.h" #include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h" +#include "llvm/DebugInfo/PDB/Native/NativeExeSymbol.h" #include "llvm/DebugInfo/PDB/Native/NativeSession.h" #include "llvm/DebugInfo/PDB/PDBSymbol.h" #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h" +#include "llvm/DebugInfo/PDB/PDBSymbolExe.h" namespace llvm { namespace pdb { -NativeEnumModules::NativeEnumModules(NativeSession &PDBSession, - const DbiModuleList &Modules, - uint32_t Index) - : Session(PDBSession), Modules(Modules), Index(Index) {} +NativeEnumModules::NativeEnumModules(NativeSession &PDBSession, uint32_t Index) + : Session(PDBSession), Index(Index) {} uint32_t NativeEnumModules::getChildCount() const { - return static_cast<uint32_t>(Modules.getModuleCount()); + return Session.getNativeGlobalScope().getNumCompilands(); } std::unique_ptr<PDBSymbol> -NativeEnumModules::getChildAtIndex(uint32_t Index) const { - if (Index >= Modules.getModuleCount()) - return nullptr; - return Session.createCompilandSymbol(Modules.getModuleDescriptor(Index)); +NativeEnumModules::getChildAtIndex(uint32_t N) const { + return Session.getNativeGlobalScope().getOrCreateCompiland(N); } std::unique_ptr<PDBSymbol> NativeEnumModules::getNext() { - if (Index >= Modules.getModuleCount()) + if (Index >= getChildCount()) return nullptr; return getChildAtIndex(Index++); } @@ -44,7 +41,7 @@ std::unique_ptr<PDBSymbol> NativeEnumModules::getNext() { void NativeEnumModules::reset() { Index = 0; } NativeEnumModules *NativeEnumModules::clone() const { - return new NativeEnumModules(Session, Modules, Index); + return new NativeEnumModules(Session, Index); } } |