LLVM  14.0.0git
NativeEnumSymbols.cpp
Go to the documentation of this file.
1 //==- NativeEnumSymbols.cpp - Native 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 
10 
16 
17 using namespace llvm;
18 using namespace llvm::codeview;
19 using namespace llvm::pdb;
20 
21 NativeEnumSymbols::NativeEnumSymbols(NativeSession &PDBSession,
22  std::vector<SymIndexId> Symbols)
23  : Symbols(std::move(Symbols)), Index(0), Session(PDBSession) {}
24 
26  return static_cast<uint32_t>(Symbols.size());
27 }
28 
29 std::unique_ptr<PDBSymbol>
31  if (N < Symbols.size()) {
32  return Session.getSymbolCache().getSymbolById(Symbols[N]);
33  }
34  return nullptr;
35 }
36 
37 std::unique_ptr<PDBSymbol> NativeEnumSymbols::getNext() {
38  return getChildAtIndex(Index++);
39 }
40 
41 void NativeEnumSymbols::reset() { Index = 0; }
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::pdb::NativeEnumSymbols::getNext
std::unique_ptr< PDBSymbol > getNext() override
Definition: NativeEnumSymbols.cpp:37
NativeEnumSymbols.h
PDBSymbolTypeEnum.h
llvm::pdb::NativeEnumSymbols::getChildCount
uint32_t getChildCount() const override
Definition: NativeEnumSymbols.cpp:25
PDBSymbol.h
llvm::pdb
Definition: ConcreteSymbolEnumerator.h:20
llvm::pdb::SymbolCache::getSymbolById
std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const
Definition: SymbolCache.cpp:242
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::pdb::NativeSession::getSymbolCache
SymbolCache & getSymbolCache()
Definition: NativeSession.h:109
IPDBEnumChildren.h
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1609
llvm::pdb::NativeEnumSymbols::reset
void reset() override
Definition: NativeEnumSymbols.cpp:41
uint32_t
std
Definition: BitVector.h:838
llvm::pdb::NativeEnumSymbols::getChildAtIndex
std::unique_ptr< PDBSymbol > getChildAtIndex(uint32_t Index) const override
Definition: NativeEnumSymbols.cpp:30
llvm::pdb::NativeSession
Definition: NativeSession.h:28
NativeTypeEnum.h
llvm::codeview
Definition: AppendingTypeTableBuilder.h:22
N
#define N
NativeSession.h