LLVM 20.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
14
15using namespace llvm;
16using namespace llvm::codeview;
17using namespace llvm::pdb;
18
20 std::vector<SymIndexId> Symbols)
21 : Symbols(std::move(Symbols)), Index(0), Session(PDBSession) {}
22
24 return static_cast<uint32_t>(Symbols.size());
25}
26
27std::unique_ptr<PDBSymbol>
29 if (N < Symbols.size()) {
30 return Session.getSymbolCache().getSymbolById(Symbols[N]);
31 }
32 return nullptr;
33}
34
35std::unique_ptr<PDBSymbol> NativeEnumSymbols::getNext() {
36 return getChildAtIndex(Index++);
37}
38
39void NativeEnumSymbols::reset() { Index = 0; }
std::unique_ptr< PDBSymbol > getNext() override
uint32_t getChildCount() const override
NativeEnumSymbols(NativeSession &Session, std::vector< SymIndexId > Symbols)
std::unique_ptr< PDBSymbol > getChildAtIndex(uint32_t Index) const override
SymbolCache & getSymbolCache()
std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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:1873
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858
#define N