Path: blob/main/contrib/llvm-project/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp
35293 views
//==- NativeEnumModules.cpp - Native Symbol Enumerator impl ------*- C++ -*-==//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "llvm/DebugInfo/PDB/Native/NativeEnumModules.h"910#include "llvm/DebugInfo/PDB/Native/NativeSession.h"11#include "llvm/DebugInfo/PDB/Native/SymbolCache.h"12#include "llvm/DebugInfo/PDB/PDBSymbol.h"13#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"1415namespace llvm {16namespace pdb {1718NativeEnumModules::NativeEnumModules(NativeSession &PDBSession, uint32_t Index)19: Session(PDBSession), Index(Index) {}2021uint32_t NativeEnumModules::getChildCount() const {22return Session.getSymbolCache().getNumCompilands();23}2425std::unique_ptr<PDBSymbol>26NativeEnumModules::getChildAtIndex(uint32_t N) const {27return Session.getSymbolCache().getOrCreateCompiland(N);28}2930std::unique_ptr<PDBSymbol> NativeEnumModules::getNext() {31if (Index >= getChildCount())32return nullptr;33return getChildAtIndex(Index++);34}3536void NativeEnumModules::reset() { Index = 0; }3738}39}404142