diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:01:25 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:01:25 +0000 |
commit | d8e91e46262bc44006913e6796843909f1ac7bcd (patch) | |
tree | 7d0c143d9b38190e0fa0180805389da22cd834c5 /lib/DebugInfo/PDB/Native/NativeEnumModules.cpp | |
parent | b7eb8e35e481a74962664b63dfb09483b200209a (diff) |
Notes
Diffstat (limited to 'lib/DebugInfo/PDB/Native/NativeEnumModules.cpp')
-rw-r--r-- | lib/DebugInfo/PDB/Native/NativeEnumModules.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp b/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp index a65782e2d4fc..6e4d56443a07 100644 --- a/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp +++ b/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp @@ -10,42 +10,35 @@ #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.getSymbolCache().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.getSymbolCache().getOrCreateCompiland(N); } std::unique_ptr<PDBSymbol> NativeEnumModules::getNext() { - if (Index >= Modules.getModuleCount()) + if (Index >= getChildCount()) return nullptr; return getChildAtIndex(Index++); } void NativeEnumModules::reset() { Index = 0; } -NativeEnumModules *NativeEnumModules::clone() const { - return new NativeEnumModules(Session, Modules, Index); -} - } } |