LLVM
22.0.0git
lib
DebugInfo
PDB
Native
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
9
#include "
llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h
"
10
11
#include "
llvm/DebugInfo/PDB/Native/NativeLineNumber.h
"
12
13
#include <vector>
14
15
using namespace
llvm
;
16
using namespace
llvm::codeview
;
17
using namespace
llvm::pdb
;
18
19
NativeEnumLineNumbers::NativeEnumLineNumbers
(
20
std::vector<NativeLineNumber> LineNums)
21
: Lines(
std
::
move
(LineNums)), Index(0) {}
22
23
uint32_t
NativeEnumLineNumbers::getChildCount
()
const
{
24
return
static_cast<
uint32_t
>
(Lines.size());
25
}
26
27
std::unique_ptr<IPDBLineNumber>
28
NativeEnumLineNumbers::getChildAtIndex
(
uint32_t
N
)
const
{
29
if
(
N
>=
getChildCount
())
30
return
nullptr
;
31
return
std::make_unique<NativeLineNumber>(Lines[
N
]);
32
}
33
34
std::unique_ptr<IPDBLineNumber>
NativeEnumLineNumbers::getNext
() {
35
return
getChildAtIndex
(Index++);
36
}
37
38
void
NativeEnumLineNumbers::reset
() { Index = 0; }
NativeEnumLineNumbers.h
NativeLineNumber.h
llvm::pdb::NativeEnumLineNumbers::NativeEnumLineNumbers
NativeEnumLineNumbers(std::vector< NativeLineNumber > LineNums)
Definition
NativeEnumLineNumbers.cpp:19
llvm::pdb::NativeEnumLineNumbers::reset
void reset() override
Definition
NativeEnumLineNumbers.cpp:38
llvm::pdb::NativeEnumLineNumbers::getChildCount
uint32_t getChildCount() const override
Definition
NativeEnumLineNumbers.cpp:23
llvm::pdb::NativeEnumLineNumbers::getNext
ChildTypePtr getNext() override
Definition
NativeEnumLineNumbers.cpp:34
llvm::pdb::NativeEnumLineNumbers::getChildAtIndex
ChildTypePtr getChildAtIndex(uint32_t Index) const override
Definition
NativeEnumLineNumbers.cpp:28
uint32_t
llvm::codeview
Definition
AppendingTypeTableBuilder.h:23
llvm::pdb
Definition
LVCodeViewReader.h:44
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
llvm::move
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:1847
std
Implement std::hash so that hash_code can be used in STL containers.
Definition
BitVector.h:851
N
#define N
Generated on
for LLVM by
1.14.0