LLVM  12.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 
11 #include "llvm/ADT/STLExtras.h"
18 
19 using namespace llvm;
20 using namespace llvm::codeview;
21 using namespace llvm::pdb;
22 
23 NativeEnumLineNumbers::NativeEnumLineNumbers(
24  std::vector<NativeLineNumber> LineNums)
25  : Lines(std::move(LineNums)), Index(0) {}
26 
28  return static_cast<uint32_t>(Lines.size());
29 }
30 
31 std::unique_ptr<IPDBLineNumber>
33  if (N >= getChildCount())
34  return nullptr;
35  return std::make_unique<NativeLineNumber>(Lines[N]);
36 }
37 
38 std::unique_ptr<IPDBLineNumber> NativeEnumLineNumbers::getNext() {
39  return getChildAtIndex(Index++);
40 }
41 
42 void NativeEnumLineNumbers::reset() { Index = 0; }
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Definition: BitVector.h:959
ChildTypePtr getChildAtIndex(uint32_t Index) const override
uint32_t getChildCount() const override
#define N