LLVM  7.0.0
DIAEnumTables.cpp
Go to the documentation of this file.
1 //===- DIAEnumTables.cpp - DIA Table 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 
12 
13 using namespace llvm;
14 using namespace llvm::pdb;
15 
17  CComPtr<IDiaEnumTables> DiaEnumerator)
18  : Enumerator(DiaEnumerator) {}
19 
21  LONG Count = 0;
22  return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
23 }
24 
25 std::unique_ptr<IPDBTable>
27  CComPtr<IDiaTable> Item;
28  VARIANT Var;
29  Var.vt = VT_UINT;
30  Var.uintVal = Index;
31  if (S_OK != Enumerator->Item(Var, &Item))
32  return nullptr;
33 
34  return std::unique_ptr<IPDBTable>(new DIATable(Item));
35 }
36 
37 std::unique_ptr<IPDBTable> DIAEnumTables::getNext() {
38  CComPtr<IDiaTable> Item;
39  ULONG CeltFetched = 0;
40  if (S_OK != Enumerator->Next(1, &Item, &CeltFetched))
41  return nullptr;
42 
43  return std::unique_ptr<IPDBTable>(new DIATable(Item));
44 }
45 
46 void DIAEnumTables::reset() { Enumerator->Reset(); }
47 
49  CComPtr<IDiaEnumTables> EnumeratorClone;
50  if (S_OK != Enumerator->Clone(&EnumeratorClone))
51  return nullptr;
52  return new DIAEnumTables(EnumeratorClone);
53 }
std::unique_ptr< IPDBTable > getNext() override
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
uint32_t getChildCount() const override
DIAEnumTables * clone() const override
std::unique_ptr< IPDBTable > getChildAtIndex(uint32_t Index) const override
DIAEnumTables(CComPtr< IDiaEnumTables > DiaEnumerator)