Revert "[GVN] MemorySSA for GVN: add optional `AllowMemorySSA`"
[llvm-project.git] / llvm / lib / DebugInfo / PDB / DIA / DIAEnumFrameData.cpp
blob8a181b448a270f1de7a8f2b9b69568688907310f
1 //==- DIAEnumFrameData.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 //===----------------------------------------------------------------------===//
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 {
19 LONG Count = 0;
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))
27 return nullptr;
29 return std::unique_ptr<IPDBFrameData>(new DIAFrameData(Item));
32 std::unique_ptr<IPDBFrameData> DIAEnumFrameData::getNext() {
33 CComPtr<IDiaFrameData> Item;
34 ULONG NumFetched = 0;
35 if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
36 return nullptr;
38 return std::unique_ptr<IPDBFrameData>(new DIAFrameData(Item));
41 void DIAEnumFrameData::reset() { Enumerator->Reset(); }