LLVM
22.0.0git
include
llvm
DebugInfo
LogicalView
Core
LVRange.h
Go to the documentation of this file.
1
//===-- LVRange.h -----------------------------------------------*- 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
// This file defines the LVRange class, which is used to describe a debug
10
// information range.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVRANGE_H
15
#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVRANGE_H
16
17
#include "
llvm/ADT/IntervalTree.h
"
18
#include "
llvm/DebugInfo/LogicalView/Core/LVObject.h
"
19
#include "
llvm/Support/Compiler.h
"
20
21
namespace
llvm
{
22
namespace
logicalview {
23
24
using
LVAddressRange
= std::pair<LVAddress, LVAddress>;
25
26
class
LVRangeEntry
final {
27
LVAddress
Lower = 0;
28
LVAddress
Upper = 0;
29
LVScope
*Scope =
nullptr
;
30
31
public
:
32
using
RangeType
=
LVAddress
;
33
34
LVRangeEntry
() =
delete
;
35
LVRangeEntry
(
LVAddress
LowerAddress,
LVAddress
UpperAddress,
LVScope
*Scope)
36
: Lower(LowerAddress),
Upper
(UpperAddress), Scope(Scope) {}
37
38
RangeType
lower
()
const
{
return
Lower; }
39
RangeType
upper
()
const
{
return
Upper
; }
40
LVAddressRange
addressRange
()
const
{
41
return
LVAddressRange
(
lower
(),
upper
());
42
}
43
LVScope
*
scope
()
const
{
return
Scope; }
44
};
45
46
// Class to represent a list of range addresses associated with a
47
// scope; the addresses are stored in ascending order and can overlap.
48
using
LVRangeEntries
= std::vector<LVRangeEntry>;
49
50
class
LLVM_ABI
LVRange
final :
public
LVObject
{
51
/// Map of where a user value is live, and its location.
52
using
LVRangesTree
=
IntervalTree<LVAddress, LVScope *>
;
53
using
LVAllocator
=
LVRangesTree::Allocator
;
54
55
LVAllocator
Allocator
;
56
LVRangesTree
RangesTree;
57
LVRangeEntries
RangeEntries;
58
LVAddress
Lower =
MaxAddress
;
59
LVAddress
Upper
= 0;
60
61
public
:
62
LVRange
() :
LVObject
(), RangesTree(
Allocator
) {}
63
LVRange
(
const
LVRange
&) =
delete
;
64
LVRange
&
operator=
(
const
LVRange
&) =
delete
;
65
~LVRange
() =
default
;
66
67
void
addEntry(
LVScope
*Scope,
LVAddress
LowerAddress,
LVAddress
UpperAddress);
68
void
addEntry(
LVScope
*Scope);
69
LVScope
*getEntry(
LVAddress
Address)
const
;
70
LVScope
*getEntry(
LVAddress
LowerAddress,
LVAddress
UpperAddress)
const
;
71
bool
hasEntry(
LVAddress
Low,
LVAddress
High
)
const
;
72
LVAddress
getLower
()
const
{
return
Lower; }
73
LVAddress
getUpper
()
const
{
return
Upper
; }
74
75
const
LVRangeEntries
&
getEntries
()
const
{
return
RangeEntries; }
76
77
void
clear
() {
78
RangeEntries.clear();
79
Lower =
MaxAddress
;
80
Upper
= 0;
81
}
82
bool
empty
()
const
{
return
RangeEntries.empty(); }
83
void
sort
();
84
85
void
startSearch();
86
void
endSearch
() {}
87
88
void
print
(
raw_ostream
&
OS
,
bool
Full =
true
)
const override
;
89
void
printExtra
(
raw_ostream
&
OS
,
bool
Full =
true
)
const override
{}
90
};
91
92
}
// end namespace logicalview
93
}
// end namespace llvm
94
95
#endif
// LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVRANGE_H
print
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
Definition:
ArchiveWriter.cpp:205
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition:
Compiler.h:213
IntervalTree.h
LVObject.h
High
uint64_t High
Definition:
NVVMIntrRange.cpp:46
Allocator
Basic Register Allocator
Definition:
RegAllocBasic.cpp:59
OS
raw_pwrite_stream & OS
Definition:
SampleProfWriter.cpp:51
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition:
Allocator.h:67
llvm::IntervalTree< LVAddress, LVScope * >
llvm::logicalview::LVObject
Definition:
LVObject.h:117
llvm::logicalview::LVRangeEntry
Definition:
LVRange.h:26
llvm::logicalview::LVRangeEntry::LVRangeEntry
LVRangeEntry()=delete
llvm::logicalview::LVRangeEntry::LVRangeEntry
LVRangeEntry(LVAddress LowerAddress, LVAddress UpperAddress, LVScope *Scope)
Definition:
LVRange.h:35
llvm::logicalview::LVRangeEntry::addressRange
LVAddressRange addressRange() const
Definition:
LVRange.h:40
llvm::logicalview::LVRangeEntry::lower
RangeType lower() const
Definition:
LVRange.h:38
llvm::logicalview::LVRangeEntry::upper
RangeType upper() const
Definition:
LVRange.h:39
llvm::logicalview::LVRangeEntry::scope
LVScope * scope() const
Definition:
LVRange.h:43
llvm::logicalview::LVRange
Definition:
LVRange.h:50
llvm::logicalview::LVRange::clear
void clear()
Definition:
LVRange.h:77
llvm::logicalview::LVRange::printExtra
void printExtra(raw_ostream &OS, bool Full=true) const override
Definition:
LVRange.h:89
llvm::logicalview::LVRange::getEntries
const LVRangeEntries & getEntries() const
Definition:
LVRange.h:75
llvm::logicalview::LVRange::empty
bool empty() const
Definition:
LVRange.h:82
llvm::logicalview::LVRange::operator=
LVRange & operator=(const LVRange &)=delete
llvm::logicalview::LVRange::getLower
LVAddress getLower() const
Definition:
LVRange.h:72
llvm::logicalview::LVRange::LVRange
LVRange(const LVRange &)=delete
llvm::logicalview::LVRange::getUpper
LVAddress getUpper() const
Definition:
LVRange.h:73
llvm::logicalview::LVRange::LVRange
LVRange()
Definition:
LVRange.h:62
llvm::logicalview::LVRange::~LVRange
~LVRange()=default
llvm::logicalview::LVRange::endSearch
void endSearch()
Definition:
LVRange.h:86
llvm::logicalview::LVScope
Definition:
LVScope.h:75
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:
raw_ostream.h:53
uint64_t
llvm::logicalview::MaxAddress
const LVAddress MaxAddress
Definition:
LVObject.h:95
llvm::logicalview::LVAddressRange
std::pair< LVAddress, LVAddress > LVAddressRange
Definition:
LVRange.h:24
llvm::logicalview::LVRangeEntries
std::vector< LVRangeEntry > LVRangeEntries
Definition:
LVRange.h:48
llvm::logicalview::LVAddress
uint64_t LVAddress
Definition:
LVObject.h:37
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::HexPrintStyle::Upper
@ Upper
llvm::sort
void sort(IteratorTy Start, IteratorTy End)
Definition:
STLExtras.h:1669
Generated on Sat Aug 30 2025 05:02:53 for LLVM by
1.9.6