LLVM 19.0.0git
DIAEnumSectionContribs.cpp
Go to the documentation of this file.
1//==- DIAEnumSectionContribs.cpp ---------------------------------*- 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 const DIASession &PDBSession,
18 CComPtr<IDiaEnumSectionContribs> DiaEnumerator)
19 : Session(PDBSession), Enumerator(DiaEnumerator) {}
20
22 LONG Count = 0;
23 return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
24}
25
26std::unique_ptr<IPDBSectionContrib>
28 CComPtr<IDiaSectionContrib> Item;
29 if (S_OK != Enumerator->Item(Index, &Item))
30 return nullptr;
31
32 return std::unique_ptr<IPDBSectionContrib>(
33 new DIASectionContrib(Session, Item));
34}
35
36std::unique_ptr<IPDBSectionContrib> DIAEnumSectionContribs::getNext() {
37 CComPtr<IDiaSectionContrib> Item;
38 ULONG NumFetched = 0;
39 if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
40 return nullptr;
41
42 return std::unique_ptr<IPDBSectionContrib>(
43 new DIASectionContrib(Session, Item));
44}
45
46void DIAEnumSectionContribs::reset() { Enumerator->Reset(); }
DIAEnumSectionContribs(const DIASession &PDBSession, CComPtr< IDiaEnumSectionContribs > DiaEnumerator)
ChildTypePtr getChildAtIndex(uint32_t Index) const override
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18