LLVM  13.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 
12 #include "llvm/ADT/Optional.h"
14 
15 namespace llvm {
16 
17 class 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. None 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.
27 
28  /// The expression itself.
30 };
31 
32 inline bool operator==(const DWARFLocationExpression &L,
33  const DWARFLocationExpression &R) {
34  return L.Range == R.Range && L.Expr == R.Expr;
35 }
36 
37 inline bool operator!=(const DWARFLocationExpression &L,
38  const DWARFLocationExpression &R) {
39  return !(L == R);
40 }
41 
42 raw_ostream &operator<<(raw_ostream &OS, const DWARFLocationExpression &Loc);
43 
44 /// Represents a set of absolute location expressions.
45 using DWARFLocationExpressionsVector = std::vector<DWARFLocationExpression>;
46 
47 } // end namespace llvm
48 
49 #endif // LLVM_DEBUGINFO_DWARF_DWARFLOCATIONEXPRESSION_H
llvm::DWARFLocationExpressionsVector
std::vector< DWARFLocationExpression > DWARFLocationExpressionsVector
Represents a set of absolute location expressions.
Definition: DWARFLocationExpression.h:45
llvm
Definition: AllocatorList.h:23
Optional.h
llvm::SmallVector< uint8_t, 4 >
DWARFAddressRange.h
llvm::DWARFLocationExpression
Represents a single DWARF expression, whose value is location-dependent.
Definition: DWARFLocationExpression.h:22
llvm::operator!=
bool operator!=(uint64_t V1, const APInt &V2)
Definition: APInt.h:2039
llvm::Optional
Definition: APInt.h:33
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::DWARFLocationExpression::Expr
SmallVector< uint8_t, 4 > Expr
The expression itself.
Definition: DWARFLocationExpression.h:29
llvm::operator==
bool operator==(uint64_t V1, const APInt &V2)
Definition: APInt.h:2037
llvm::DWARFLocationExpression::Range
Optional< DWARFAddressRange > Range
The address range in which this expression is valid.
Definition: DWARFLocationExpression.h:26