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