LLVM  8.0.1
DIAEnumInjectedSources.cpp
Go to the documentation of this file.
1 //==- DIAEnumSourceFiles.cpp - DIA Source File 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<IDiaEnumInjectedSources> 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<IPDBInjectedSource>
28  CComPtr<IDiaInjectedSource> Item;
29  if (S_OK != Enumerator->Item(Index, &Item))
30  return nullptr;
31 
32  return std::unique_ptr<IPDBInjectedSource>(new DIAInjectedSource(Item));
33 }
34 
35 std::unique_ptr<IPDBInjectedSource> DIAEnumInjectedSources::getNext() {
36  CComPtr<IDiaInjectedSource> Item;
37  ULONG NumFetched = 0;
38  if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
39  return nullptr;
40 
41  return std::unique_ptr<IPDBInjectedSource>(new DIAInjectedSource(Item));
42 }
43 
44 void DIAEnumInjectedSources::reset() { Enumerator->Reset(); }
This class represents lattice values for constants.
Definition: AllocatorList.h:24
DIAEnumInjectedSources(CComPtr< IDiaEnumInjectedSources > DiaEnumerator)
ChildTypePtr getChildAtIndex(uint32_t Index) const override