LLVM 20.0.0git
DIAEnumLineNumbers.cpp
Go to the documentation of this file.
1//==- DIAEnumLineNumbers.cpp - DIA Line Number Enumerator impl ---*- C++ -*-==//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
12
13using namespace llvm;
14using namespace llvm::pdb;
15
17 CComPtr<IDiaEnumLineNumbers> DiaEnumerator)
18 : Enumerator(DiaEnumerator) {}
19
21 LONG Count = 0;
22 return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
23}
24
25std::unique_ptr<IPDBLineNumber>
27 CComPtr<IDiaLineNumber> Item;
28 if (S_OK != Enumerator->Item(Index, &Item))
29 return nullptr;
30
31 return std::unique_ptr<IPDBLineNumber>(new DIALineNumber(Item));
32}
33
34std::unique_ptr<IPDBLineNumber> DIAEnumLineNumbers::getNext() {
35 CComPtr<IDiaLineNumber> Item;
36 ULONG NumFetched = 0;
37 if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
38 return nullptr;
39
40 return std::unique_ptr<IPDBLineNumber>(new DIALineNumber(Item));
41}
42
43void DIAEnumLineNumbers::reset() { Enumerator->Reset(); }
uint32_t getChildCount() const override
ChildTypePtr getChildAtIndex(uint32_t Index) const override
ChildTypePtr getNext() override
DIAEnumLineNumbers(CComPtr< IDiaEnumLineNumbers > DiaEnumerator)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18