LLVM
13.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/ADT/STLExtras.h
"
12
#include "
llvm/DebugInfo/CodeView/DebugLinesSubsection.h
"
13
#include "
llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
"
14
#include "
llvm/DebugInfo/PDB/IPDBEnumChildren.h
"
15
#include "
llvm/DebugInfo/PDB/Native/NativeLineNumber.h
"
16
#include "
llvm/DebugInfo/PDB/Native/NativeSession.h
"
17
#include "
llvm/DebugInfo/PDB/Native/NativeSourceFile.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
27
uint32_t
NativeEnumLineNumbers::getChildCount
()
const
{
28
return
static_cast<
uint32_t
>
(Lines.size());
29
}
30
31
std::unique_ptr<IPDBLineNumber>
32
NativeEnumLineNumbers::getChildAtIndex
(
uint32_t
N
)
const
{
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; }
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:23
llvm::codeview::DebugSubsectionKind::Lines
@ Lines
NativeEnumLineNumbers.h
llvm::pdb::NativeEnumLineNumbers::getChildCount
uint32_t getChildCount() const override
Definition:
NativeEnumLineNumbers.cpp:27
STLExtras.h
DebugSubsectionRecord.h
llvm::pdb::NativeEnumLineNumbers::getNext
ChildTypePtr getNext() override
Definition:
NativeEnumLineNumbers.cpp:38
llvm::pdb
Definition:
ConcreteSymbolEnumerator.h:20
Index
uint32_t Index
Definition:
ELFObjHandler.cpp:84
DebugLinesSubsection.h
IPDBEnumChildren.h
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:1556
llvm::pdb::NativeEnumLineNumbers::getChildAtIndex
ChildTypePtr getChildAtIndex(uint32_t Index) const override
Definition:
NativeEnumLineNumbers.cpp:32
uint32_t
std
Definition:
BitVector.h:941
NativeSourceFile.h
llvm::codeview
Definition:
AppendingTypeTableBuilder.h:23
N
#define N
NativeLineNumber.h
llvm::pdb::NativeEnumLineNumbers::reset
void reset() override
Definition:
NativeEnumLineNumbers.cpp:42
NativeSession.h
Generated on Fri Mar 5 2021 21:42:32 for LLVM by
1.8.17