1 //==- DIAEnumFrameData.cpp ---------------------------------------*- C++ -*-==//
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
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h"
10 #include "llvm/DebugInfo/PDB/DIA/DIAFrameData.h"
11 #include "llvm/DebugInfo/PDB/DIA/DIASession.h"
13 using namespace llvm::pdb
;
15 DIAEnumFrameData::DIAEnumFrameData(CComPtr
<IDiaEnumFrameData
> DiaEnumerator
)
16 : Enumerator(DiaEnumerator
) {}
18 uint32_t DIAEnumFrameData::getChildCount() const {
20 return (S_OK
== Enumerator
->get_Count(&Count
)) ? Count
: 0;
23 std::unique_ptr
<IPDBFrameData
>
24 DIAEnumFrameData::getChildAtIndex(uint32_t Index
) const {
25 CComPtr
<IDiaFrameData
> Item
;
26 if (S_OK
!= Enumerator
->Item(Index
, &Item
))
29 return std::unique_ptr
<IPDBFrameData
>(new DIAFrameData(Item
));
32 std::unique_ptr
<IPDBFrameData
> DIAEnumFrameData::getNext() {
33 CComPtr
<IDiaFrameData
> Item
;
35 if (S_OK
!= Enumerator
->Next(1, &Item
, &NumFetched
))
38 return std::unique_ptr
<IPDBFrameData
>(new DIAFrameData(Item
));
41 void DIAEnumFrameData::reset() { Enumerator
->Reset(); }