1 //==- NativeEnumModules.cpp - Native Symbol Enumerator impl ------*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/DebugInfo/PDB/Native/NativeEnumModules.h"
12 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
13 #include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"
14 #include "llvm/DebugInfo/PDB/Native/NativeExeSymbol.h"
15 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
16 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
17 #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
18 #include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
23 NativeEnumModules::NativeEnumModules(NativeSession &PDBSession, uint32_t Index)
24 : Session(PDBSession), Index(Index) {}
26 uint32_t NativeEnumModules::getChildCount() const {
27 return Session.getSymbolCache().getNumCompilands();
30 std::unique_ptr<PDBSymbol>
31 NativeEnumModules::getChildAtIndex(uint32_t N) const {
32 return Session.getSymbolCache().getOrCreateCompiland(N);
35 std::unique_ptr<PDBSymbol> NativeEnumModules::getNext() {
36 if (Index >= getChildCount())
38 return getChildAtIndex(Index++);
41 void NativeEnumModules::reset() { Index = 0; }