Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:45

0001 //===- ConcreteSymbolEnumerator.h -------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H
0010 #define LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H
0011 
0012 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
0013 #include "llvm/DebugInfo/PDB/PDBTypes.h"
0014 #include "llvm/Support/Casting.h"
0015 #include <algorithm>
0016 #include <cstdint>
0017 #include <memory>
0018 
0019 namespace llvm {
0020 namespace pdb {
0021 
0022 template <typename ChildType>
0023 class ConcreteSymbolEnumerator : public IPDBEnumChildren<ChildType> {
0024 public:
0025   ConcreteSymbolEnumerator(std::unique_ptr<IPDBEnumSymbols> SymbolEnumerator)
0026       : Enumerator(std::move(SymbolEnumerator)) {}
0027 
0028   ~ConcreteSymbolEnumerator() override = default;
0029 
0030   uint32_t getChildCount() const override {
0031     return Enumerator->getChildCount();
0032   }
0033 
0034   std::unique_ptr<ChildType> getChildAtIndex(uint32_t Index) const override {
0035     std::unique_ptr<PDBSymbol> Child = Enumerator->getChildAtIndex(Index);
0036     return unique_dyn_cast_or_null<ChildType>(Child);
0037   }
0038 
0039   std::unique_ptr<ChildType> getNext() override {
0040     return unique_dyn_cast_or_null<ChildType>(Enumerator->getNext());
0041   }
0042 
0043   void reset() override { Enumerator->reset(); }
0044 
0045 private:
0046 
0047   std::unique_ptr<IPDBEnumSymbols> Enumerator;
0048 };
0049 
0050 } // end namespace pdb
0051 } // end namespace llvm
0052 
0053 #endif // LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H