9#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCENTRY_H
10#define LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCENTRY_H
13#include "llvm/Config/llvm-config.h"
50 enum EntryType EntryKind;
76 : EntryKind(E_TargetIndexLocation),
TIL(
Loc) {}
78 bool isLocation()
const {
return EntryKind == E_Location; }
83 return EntryKind == E_TargetIndexLocation;
85 bool isInt()
const {
return EntryKind == E_Integer; }
94#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
121 :
Expression(Expr), ValueLocEntries(Locs.begin(), Locs.end()),
126 :
Expression(Expr), ValueLocEntries(Locs.begin(), Locs.end()),
127 IsVariadic(IsVariadic) {
130 !
any_of(Locs, [](
auto LE) {
return LE.isLocation(); }));
140 "DBG_VALUE with a machine location must have a valid expression.");
148 if (ValueLocEntries.
size() !=
Other.ValueLocEntries.size())
150 bool ThisIsIndirect =
151 !IsVariadic && ValueLocEntries[0].isIndirectLocation();
152 bool OtherIsIndirect =
153 !
Other.IsVariadic &&
Other.ValueLocEntries[0].isIndirectLocation();
156 Other.Expression, OtherIsIndirect))
160 if (ThisIsIndirect || OtherIsIndirect) {
167 return ValueLocEntries ==
Other.ValueLocEntries;
173#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
200 : Begin(Begin), End(End) {
210 if (End != Next.Begin)
212 if (Values.
size() != Next.Values.size())
214 for (
unsigned EntryIdx = 0; EntryIdx < Values.
size(); ++EntryIdx)
215 if (!Values[EntryIdx].isEquivalent(Next.Values[EntryIdx]))
228 return V.isFragment();
229 })) &&
"must either have a single value or multiple pieces");
238 if (Values.
size() == 1)
243 return A.getExpression() == B.getExpression();
257 if (
A.EntryKind !=
B.EntryKind)
260 switch (
A.EntryKind) {
261 case DbgValueLocEntry::E_Location:
262 return A.Loc ==
B.Loc;
263 case DbgValueLocEntry::E_TargetIndexLocation:
264 return A.TIL ==
B.TIL;
265 case DbgValueLocEntry::E_Integer:
266 return A.Constant.Int ==
B.Constant.Int;
267 case DbgValueLocEntry::E_ConstantFP:
268 return A.Constant.CFP ==
B.Constant.CFP;
269 case DbgValueLocEntry::E_ConstantInt:
270 return A.Constant.CIP ==
B.Constant.CIP;
277 return A.ValueLocEntries ==
B.ValueLocEntries &&
278 A.Expression ==
B.Expression &&
A.IsVariadic ==
B.IsVariadic;
284 return A.getExpression()->getFragmentInfo()->OffsetInBits <
285 B.getExpression()->getFragmentInfo()->OffsetInBits;
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static bool isValid(const char C)
Returns true if C is a valid mangled character: <0-9a-zA-Z_>.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class is intended to be used as a driving class for all asm writers.
ConstantFP - Floating Point Values [float, double].
This is the shared class of boolean and integer constants.
This is an important base class in LLVM.
Basic type, like 'int' or 'float'.
bool isEntryValue() const
Check if the expression consists of exactly one entry value operand.
bool isFragment() const
Return whether this is a piece of an aggregate variable.
static bool isEqualExpression(const DIExpression *FirstExpr, bool FirstIndirect, const DIExpression *SecondExpr, bool SecondIndirect)
Determines whether two debug values should produce equivalent DWARF expressions, using their DIExpres...
A single location or constant within a variable location description, with either a single entry (wit...
DbgValueLocEntry(const ConstantFP *CFP)
TargetIndexLocation getTargetIndexLocation() const
MachineLocation Loc
Or a location in the machine frame.
friend bool operator==(const DbgValueLocEntry &, const DbgValueLocEntry &)
Compare two DbgValueLocEntries for equality.
const ConstantFP * getConstantFP() const
bool isConstantFP() const
DbgValueLocEntry(MachineLocation Loc)
DbgValueLocEntry(int64_t i)
bool isConstantInt() const
TargetIndexLocation TIL
Or a location from target specific location.
bool isIndirectLocation() const
const ConstantInt * getConstantInt() const
LLVM_DUMP_METHOD void dump() const
bool isTargetIndexLocation() const
MachineLocation getLoc() const
DbgValueLocEntry(const ConstantInt *CIP)
DbgValueLocEntry(TargetIndexLocation Loc)
The location of a single variable, composed of an expression and 0 or more DbgValueLocEntries.
DbgValueLoc(const DIExpression *Expr, DbgValueLocEntry Loc)
DbgValueLoc(const DIExpression *Expr, ArrayRef< DbgValueLocEntry > Locs, bool IsVariadic)
ArrayRef< DbgValueLocEntry > getLocEntries() const
DbgValueLoc(const DIExpression *Expr, ArrayRef< DbgValueLocEntry > Locs)
const DIExpression * getExpression() const
friend bool operator<(const DbgValueLoc &, const DbgValueLoc &)
Compare two fragments based on their offset.
friend bool operator==(const DbgValueLoc &, const DbgValueLoc &)
Compare two DbgValueLocs for equality.
LLVM_DUMP_METHOD void dump() const
bool isEquivalent(const DbgValueLoc &Other) const
This struct describes location entries emitted in the .debug_loc section.
DebugLocEntry(const MCSymbol *Begin, const MCSymbol *End, ArrayRef< DbgValueLoc > Vals)
Create a location list entry for the range [Begin, End).
void addValues(ArrayRef< DbgValueLoc > Vals)
ArrayRef< DbgValueLoc > getValues() const
const MCSymbol * getBeginSym() const
const MCSymbol * getEndSym() const
bool MergeRanges(const DebugLocEntry &Next)
Attempt to merge this DebugLocEntry with Next and return true if the merge was successful.
Builder for DebugLocStream lists.
Class representing an expression and its matching format.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
iterator erase(const_iterator CI)
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
void dump() const
Support for debugging, callable in GDB: V->dump()
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
bool operator<(int64_t V1, const APSInt &V2)
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
void sort(IteratorTy Start, IteratorTy End)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
This struct describes target specific location.
TargetIndexLocation()=default
bool operator==(const TargetIndexLocation &Other) const
TargetIndexLocation(unsigned Idx, int64_t Offset)