LLVM
22.0.0git
lib
DebugInfo
PDB
DIA
DIAEnumDebugStreams.cpp
Go to the documentation of this file.
1
//==- DIAEnumDebugStreams.cpp - DIA Debug Stream 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
9
#include "
llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
"
10
#include "
llvm/DebugInfo/PDB/DIA/DIADataStream.h
"
11
#include "
llvm/DebugInfo/PDB/PDBSymbol.h
"
12
13
using namespace
llvm
;
14
using namespace
llvm::pdb
;
15
16
DIAEnumDebugStreams::DIAEnumDebugStreams
(
17
CComPtr<IDiaEnumDebugStreams> DiaEnumerator)
18
: Enumerator(DiaEnumerator) {}
19
20
uint32_t
DIAEnumDebugStreams::getChildCount
()
const
{
21
LONG
Count
= 0;
22
return
(S_OK == Enumerator->get_Count(&
Count
)) ?
Count
: 0;
23
}
24
25
std::unique_ptr<IPDBDataStream>
26
DIAEnumDebugStreams::getChildAtIndex
(
uint32_t
Index)
const
{
27
CComPtr<IDiaEnumDebugStreamData> Item;
28
VARIANT VarIndex;
29
VarIndex.vt = VT_I4;
30
VarIndex.lVal = Index;
31
if
(S_OK != Enumerator->Item(VarIndex, &Item))
32
return
nullptr
;
33
34
return
std::unique_ptr<IPDBDataStream>(
new
DIADataStream
(Item));
35
}
36
37
std::unique_ptr<IPDBDataStream>
DIAEnumDebugStreams::getNext
() {
38
CComPtr<IDiaEnumDebugStreamData> Item;
39
ULONG NumFetched = 0;
40
if
(S_OK != Enumerator->Next(1, &Item, &NumFetched))
41
return
nullptr
;
42
43
return
std::unique_ptr<IPDBDataStream>(
new
DIADataStream
(Item));
44
}
45
46
void
DIAEnumDebugStreams::reset
() { Enumerator->Reset(); }
DIADataStream.h
DIAEnumDebugStreams.h
PDBSymbol.h
llvm::pdb::DIADataStream
Definition
DIADataStream.h:17
llvm::pdb::DIAEnumDebugStreams::DIAEnumDebugStreams
DIAEnumDebugStreams(CComPtr< IDiaEnumDebugStreams > DiaEnumerator)
Definition
DIAEnumDebugStreams.cpp:16
llvm::pdb::DIAEnumDebugStreams::reset
void reset() override
Definition
DIAEnumDebugStreams.cpp:46
llvm::pdb::DIAEnumDebugStreams::getChildAtIndex
ChildTypePtr getChildAtIndex(uint32_t Index) const override
Definition
DIAEnumDebugStreams.cpp:26
llvm::pdb::DIAEnumDebugStreams::getChildCount
uint32_t getChildCount() const override
Definition
DIAEnumDebugStreams.cpp:20
llvm::pdb::DIAEnumDebugStreams::getNext
ChildTypePtr getNext() override
Definition
DIAEnumDebugStreams.cpp:37
uint32_t
llvm::pdb
Definition
LVCodeViewReader.h:44
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
llvm::Count
FunctionAddr VTableAddr Count
Definition
InstrProf.h:139
Generated on
for LLVM by
1.14.0