LLVM 20.0.0git
NativeEnumLineNumbers.cpp
Go to the documentation of this file.
1//==- NativeEnumLineNumbers.cpp - Native Type 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
12
13#include <vector>
14
15using namespace llvm;
16using namespace llvm::codeview;
17using namespace llvm::pdb;
18
20 std::vector<NativeLineNumber> LineNums)
21 : Lines(std::move(LineNums)), Index(0) {}
22
24 return static_cast<uint32_t>(Lines.size());
25}
26
27std::unique_ptr<IPDBLineNumber>
29 if (N >= getChildCount())
30 return nullptr;
31 return std::make_unique<NativeLineNumber>(Lines[N]);
32}
33
34std::unique_ptr<IPDBLineNumber> NativeEnumLineNumbers::getNext() {
35 return getChildAtIndex(Index++);
36}
37
38void NativeEnumLineNumbers::reset() { Index = 0; }
NativeEnumLineNumbers(std::vector< NativeLineNumber > LineNums)
uint32_t getChildCount() const override
ChildTypePtr getChildAtIndex(uint32_t Index) const override
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