Path: blob/main/contrib/llvm-project/llvm/lib/DebugInfo/PDB/Native/NativeEnumLineNumbers.cpp
35293 views
//==- NativeEnumLineNumbers.cpp - Native Type 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/NativeEnumLineNumbers.h"910#include "llvm/DebugInfo/CodeView/CodeView.h"11#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"12#include "llvm/DebugInfo/PDB/Native/NativeLineNumber.h"1314#include <vector>1516using namespace llvm;17using namespace llvm::codeview;18using namespace llvm::pdb;1920NativeEnumLineNumbers::NativeEnumLineNumbers(21std::vector<NativeLineNumber> LineNums)22: Lines(std::move(LineNums)), Index(0) {}2324uint32_t NativeEnumLineNumbers::getChildCount() const {25return static_cast<uint32_t>(Lines.size());26}2728std::unique_ptr<IPDBLineNumber>29NativeEnumLineNumbers::getChildAtIndex(uint32_t N) const {30if (N >= getChildCount())31return nullptr;32return std::make_unique<NativeLineNumber>(Lines[N]);33}3435std::unique_ptr<IPDBLineNumber> NativeEnumLineNumbers::getNext() {36return getChildAtIndex(Index++);37}3839void NativeEnumLineNumbers::reset() { Index = 0; }404142