LLVM  7.0.0
NativeEnumModules.cpp
Go to the documentation of this file.
1 //==- NativeEnumModules.cpp - Native Symbol Enumerator impl ------*- C++ -*-==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 
18 
19 namespace llvm {
20 namespace pdb {
21 
23  const DbiModuleList &Modules,
25  : Session(PDBSession), Modules(Modules), Index(Index) {}
26 
28  return static_cast<uint32_t>(Modules.getModuleCount());
29 }
30 
31 std::unique_ptr<PDBSymbol>
33  if (Index >= Modules.getModuleCount())
34  return nullptr;
35  return Session.createCompilandSymbol(Modules.getModuleDescriptor(Index));
36 }
37 
38 std::unique_ptr<PDBSymbol> NativeEnumModules::getNext() {
39  if (Index >= Modules.getModuleCount())
40  return nullptr;
41  return getChildAtIndex(Index++);
42 }
43 
44 void NativeEnumModules::reset() { Index = 0; }
45 
47  return new NativeEnumModules(Session, Modules, Index);
48 }
49 
50 }
51 }
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
DbiModuleDescriptor getModuleDescriptor(uint32_t Modi) const
std::unique_ptr< PDBSymbol > getNext() override
uint32_t getModuleCount() const
uint32_t getChildCount() const override
NativeEnumModules(NativeSession &Session, const DbiModuleList &Modules, uint32_t Index=0)
std::unique_ptr< PDBSymbol > getChildAtIndex(uint32_t Index) const override
std::unique_ptr< PDBSymbolCompiland > createCompilandSymbol(DbiModuleDescriptor MI)
NativeEnumModules * clone() const override