LLVM 22.0.0git
DWARFLocationExpression.h
Go to the documentation of this file.
1//===- DWARFLocationExpression.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#ifndef LLVM_DEBUGINFO_DWARF_DWARFLOCATIONEXPRESSION_H
10#define LLVM_DEBUGINFO_DWARF_DWARFLOCATIONEXPRESSION_H
11
14
15namespace llvm {
16
17class raw_ostream;
18
19/// Represents a single DWARF expression, whose value is location-dependent.
20/// Typically used in DW_AT_location attributes to describe the location of
21/// objects.
23 /// The address range in which this expression is valid. std::nullopt denotes a
24 /// default entry which is valid in addresses not covered by other location
25 /// expressions, or everywhere if there are no other expressions.
26 std::optional<DWARFAddressRange> Range;
27
28 /// The expression itself.
30};
31
33 const DWARFLocationExpression &R) {
34 return L.Range == R.Range && L.Expr == R.Expr;
35}
36
38 const DWARFLocationExpression &R) {
39 return !(L == R);
40}
41
42LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
43 const DWARFLocationExpression &Loc);
44
45/// Represents a set of absolute location expressions.
46using DWARFLocationExpressionsVector = std::vector<DWARFLocationExpression>;
47
48} // end namespace llvm
49
50#endif // LLVM_DEBUGINFO_DWARF_DWARFLOCATIONEXPRESSION_H
#define LLVM_ABI
Definition Compiler.h:213
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
bool operator!=(uint64_t V1, const APInt &V2)
Definition APInt.h:2113
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
std::vector< DWARFLocationExpression > DWARFLocationExpressionsVector
Represents a set of absolute location expressions.
Represents a single DWARF expression, whose value is location-dependent.
SmallVector< uint8_t, 4 > Expr
The expression itself.
std::optional< DWARFAddressRange > Range
The address range in which this expression is valid.