LLVM  8.0.1
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 
16 DIAEnumTables::DIAEnumTables(CComPtr<IDiaEnumTables> DiaEnumerator)
17  : Enumerator(DiaEnumerator) {}
18 
20  LONG Count = 0;
21  return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
22 }
23 
24 std::unique_ptr<IPDBTable>
26  CComPtr<IDiaTable> Item;
27  VARIANT Var;
28  Var.vt = VT_UINT;
29  Var.uintVal = Index;
30  if (S_OK != Enumerator->Item(Var, &Item))
31  return nullptr;
32 
33  return std::unique_ptr<IPDBTable>(new DIATable(Item));
34 }
35 
36 std::unique_ptr<IPDBTable> DIAEnumTables::getNext() {
37  CComPtr<IDiaTable> Item;
38  ULONG CeltFetched = 0;
39  if (S_OK != Enumerator->Next(1, &Item, &CeltFetched))
40  return nullptr;
41 
42  return std::unique_ptr<IPDBTable>(new DIATable(Item));
43 }
44 
45 void DIAEnumTables::reset() { Enumerator->Reset(); }
std::unique_ptr< IPDBTable > getNext() override
This class represents lattice values for constants.
Definition: AllocatorList.h:24
uint32_t getChildCount() const override
std::unique_ptr< IPDBTable > getChildAtIndex(uint32_t Index) const override
DIAEnumTables(CComPtr< IDiaEnumTables > DiaEnumerator)