LLVM 22.0.0git
ConcreteSymbolEnumerator.h
Go to the documentation of this file.
1//===- ConcreteSymbolEnumerator.h -------------------------------*- 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#ifndef LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H
10#define LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H
11
16#include <algorithm>
17#include <cstdint>
18#include <memory>
19
20namespace llvm {
21namespace pdb {
22
23template <typename ChildType>
24class ConcreteSymbolEnumerator : public IPDBEnumChildren<ChildType> {
25public:
26 ConcreteSymbolEnumerator(std::unique_ptr<IPDBEnumSymbols> SymbolEnumerator)
27 : Enumerator(std::move(SymbolEnumerator)) {}
28
29 ~ConcreteSymbolEnumerator() override = default;
30
31 uint32_t getChildCount() const override {
32 return Enumerator->getChildCount();
33 }
34
35 std::unique_ptr<ChildType> getChildAtIndex(uint32_t Index) const override {
36 std::unique_ptr<PDBSymbol> Child = Enumerator->getChildAtIndex(Index);
38 }
39
40 std::unique_ptr<ChildType> getNext() override {
41 return unique_dyn_cast_or_null<ChildType>(Enumerator->getNext());
42 }
43
44 void reset() override { Enumerator->reset(); }
45
46private:
47
48 std::unique_ptr<IPDBEnumSymbols> Enumerator;
49};
50
51} // end namespace pdb
52} // end namespace llvm
53
54#endif // LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H
~ConcreteSymbolEnumerator() override=default
std::unique_ptr< ChildType > getNext() override
std::unique_ptr< ChildType > getChildAtIndex(uint32_t Index) const override
ConcreteSymbolEnumerator(std::unique_ptr< IPDBEnumSymbols > SymbolEnumerator)
This is an optimization pass for GlobalISel generic memory operations.
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:1847
CastInfo< X, std::unique_ptr< Y > >::CastResultType unique_dyn_cast_or_null(std::unique_ptr< Y > &Val)
Definition Casting.h:793
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:870