LLVM  8.0.1
DIAEnumDebugStreams.cpp
Go to the documentation of this file.
1 //==- DIAEnumDebugStreams.cpp - DIA Debug Stream 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 
13 
14 using namespace llvm;
15 using namespace llvm::pdb;
16 
18  CComPtr<IDiaEnumDebugStreams> DiaEnumerator)
19  : Enumerator(DiaEnumerator) {}
20 
22  LONG Count = 0;
23  return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
24 }
25 
26 std::unique_ptr<IPDBDataStream>
28  CComPtr<IDiaEnumDebugStreamData> Item;
29  VARIANT VarIndex;
30  VarIndex.vt = VT_I4;
31  VarIndex.lVal = Index;
32  if (S_OK != Enumerator->Item(VarIndex, &Item))
33  return nullptr;
34 
35  return std::unique_ptr<IPDBDataStream>(new DIADataStream(Item));
36 }
37 
38 std::unique_ptr<IPDBDataStream> DIAEnumDebugStreams::getNext() {
39  CComPtr<IDiaEnumDebugStreamData> Item;
40  ULONG NumFetched = 0;
41  if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
42  return nullptr;
43 
44  return std::unique_ptr<IPDBDataStream>(new DIADataStream(Item));
45 }
46 
47 void DIAEnumDebugStreams::reset() { Enumerator->Reset(); }
This class represents lattice values for constants.
Definition: AllocatorList.h:24
DIAEnumDebugStreams(CComPtr< IDiaEnumDebugStreams > DiaEnumerator)
uint32_t getChildCount() const override
ChildTypePtr getChildAtIndex(uint32_t Index) const override