LLVM  14.0.0git
DIAEnumSymbols.cpp
Go to the documentation of this file.
1 //==- DIAEnumSymbols.cpp - DIA Symbol 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 
13 
14 using namespace llvm;
15 using namespace llvm::pdb;
16 
18  CComPtr<IDiaEnumSymbols> DiaEnumerator)
19  : Session(PDBSession), Enumerator(DiaEnumerator) {}
20 
22  LONG Count = 0;
23  return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
24 }
25 
26 std::unique_ptr<PDBSymbol>
28  CComPtr<IDiaSymbol> Item;
29  if (S_OK != Enumerator->Item(Index, &Item))
30  return nullptr;
31 
32  std::unique_ptr<DIARawSymbol> RawSymbol(new DIARawSymbol(Session, Item));
33  return std::unique_ptr<PDBSymbol>(PDBSymbol::create(Session, std::move(RawSymbol)));
34 }
35 
36 std::unique_ptr<PDBSymbol> DIAEnumSymbols::getNext() {
37  CComPtr<IDiaSymbol> Item;
38  ULONG NumFetched = 0;
39  if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
40  return nullptr;
41 
42  std::unique_ptr<DIARawSymbol> RawSymbol(new DIARawSymbol(Session, Item));
43  return std::unique_ptr<PDBSymbol>(
44  PDBSymbol::create(Session, std::move(RawSymbol)));
45 }
46 
47 void DIAEnumSymbols::reset() { Enumerator->Reset(); }
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::pdb::DIAEnumSymbols::getChildAtIndex
std::unique_ptr< PDBSymbol > getChildAtIndex(uint32_t Index) const override
Definition: DIAEnumSymbols.cpp:27
llvm::pdb::DIAEnumSymbols::reset
void reset() override
Definition: DIAEnumSymbols.cpp:47
DIAEnumSymbols.h
llvm::pdb::DIASession
Definition: DIASession.h:22
llvm::pdb::DIAEnumSymbols::getChildCount
uint32_t getChildCount() const override
Definition: DIAEnumSymbols.cpp:21
llvm::pdb::PDBSymbol::create
static std::unique_ptr< PDBSymbol > create(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > RawSymbol)
Definition: PDBSymbol.cpp:102
llvm::HighlightColor::Enumerator
@ Enumerator
llvm::pdb::DIAEnumSymbols::DIAEnumSymbols
DIAEnumSymbols(const DIASession &Session, CComPtr< IDiaEnumSymbols > DiaEnumerator)
Definition: DIAEnumSymbols.cpp:17
PDBSymbol.h
llvm::pdb
Definition: ConcreteSymbolEnumerator.h:20
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
DIASession.h
uint32_t
DIARawSymbol.h
llvm::pdb::DIARawSymbol
Definition: DIARawSymbol.h:18
llvm::pdb::DIAEnumSymbols::getNext
std::unique_ptr< PDBSymbol > getNext() override
Definition: DIAEnumSymbols.cpp:36