LLVM 20.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
13
14namespace llvm {
15
16class raw_ostream;
17
18/// Represents a single DWARF expression, whose value is location-dependent.
19/// Typically used in DW_AT_location attributes to describe the location of
20/// objects.
22 /// The address range in which this expression is valid. std::nullopt denotes a
23 /// default entry which is valid in addresses not covered by other location
24 /// expressions, or everywhere if there are no other expressions.
25 std::optional<DWARFAddressRange> Range;
26
27 /// The expression itself.
29};
30
32 const DWARFLocationExpression &R) {
33 return L.Range == R.Range && L.Expr == R.Expr;
34}
35
37 const DWARFLocationExpression &R) {
38 return !(L == R);
39}
40
41raw_ostream &operator<<(raw_ostream &OS, const DWARFLocationExpression &Loc);
42
43/// Represents a set of absolute location expressions.
44using DWARFLocationExpressionsVector = std::vector<DWARFLocationExpression>;
45
46} // end namespace llvm
47
48#endif // LLVM_DEBUGINFO_DWARF_DWARFLOCATIONEXPRESSION_H
raw_pwrite_stream & OS
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1196
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool operator!=(uint64_t V1, const APInt &V2)
Definition: APInt.h:2082
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
std::vector< DWARFLocationExpression > DWARFLocationExpressionsVector
Represents a set of absolute location expressions.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:303
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.