9 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCENTRY_H 10 #define LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCENTRY_H 13 #include "llvm/Config/llvm-config.h" 30 : Index(Idx), Offset(Offset) {}
33 return Index == Other.
Index && Offset == Other.
Offset;
50 enum EntryType EntryKind;
68 : Expression(Expr), EntryKind(E_Integer) {
72 : Expression(Expr), EntryKind(E_ConstantFP) {
76 : Expression(Expr), EntryKind(E_ConstantInt) {
80 : Expression(Expr), EntryKind(E_Location), Loc(Loc) {
81 assert(cast<DIExpression>(Expr)->isValid());
84 : Expression(Expr), EntryKind(E_TargetIndexLocation), TIL(Loc) {}
86 bool isLocation()
const {
return EntryKind == E_Location; }
88 return EntryKind == E_TargetIndexLocation;
90 bool isInt()
const {
return EntryKind == E_Integer; }
98 bool isFragment()
const {
return getExpression()->isFragment(); }
99 bool isEntryVal()
const {
return getExpression()->isEntryValue(); }
103 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 106 llvm::dbgs() <<
"Loc = { reg=" << Loc.getReg() <<
" ";
107 if (Loc.isIndirect())
110 }
else if (isConstantInt())
112 else if (isConstantFP())
137 : Begin(Begin), End(End) {
147 if ((End == Next.Begin && Values == Next.Values)) {
162 })) &&
"must either have a single value or multiple pieces");
186 if (A.EntryKind != B.EntryKind)
189 if (A.Expression != B.Expression)
192 switch (A.EntryKind) {
193 case DbgValueLoc::E_Location:
195 case DbgValueLoc::E_TargetIndexLocation:
197 case DbgValueLoc::E_Integer:
198 return A.Constant.
Int == B.Constant.
Int;
199 case DbgValueLoc::E_ConstantFP:
200 return A.Constant.
CFP == B.Constant.
CFP;
201 case DbgValueLoc::E_ConstantInt:
202 return A.Constant.
CIP == B.Constant.
CIP;
bool MergeRanges(const DebugLocEntry &Next)
Attempt to merge this DebugLocEntry with Next and return true if the merge was successful.
Builder for DebugLocStream lists.
void addValues(ArrayRef< DbgValueLoc > Vals)
This struct describes location entries emitted in the .debug_loc section.
This class represents lattice values for constants.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
const ConstantFP * getConstantFP() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool isConstantFP() const
DbgValueLoc(const DIExpression *Expr, int64_t i)
DebugLocEntry(const MCSymbol *Begin, const MCSymbol *End, ArrayRef< DbgValueLoc > Vals)
Create a location list entry for the range [Begin, End).
DbgValueLoc(const DIExpression *Expr, TargetIndexLocation Loc)
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
const ConstantInt * getConstantInt() const
void dump() const
Support for debugging, callable in GDB: V->dump()
TargetIndexLocation getTargetIndexLocation() const
const MCSymbol * getBeginSym() const
DbgValueLoc(const DIExpression *Expr, const ConstantFP *CFP)
bool operator==(const TargetIndexLocation &Other) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
TargetIndexLocation TIL
Or a location from target specific location.
static Optional< FragmentInfo > getFragmentInfo(expr_op_iterator Start, expr_op_iterator End)
Retrieve the details of this fragment expression.
DbgValueLoc(const DIExpression *Expr, const ConstantInt *CIP)
const DIExpression * getExpression() const
TargetIndexLocation()=default
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
MachineLocation Loc
Or a location in the machine frame.
ConstantFP - Floating Point Values [float, double].
This class is intended to be used as a driving class for all asm writers.
LLVM_DUMP_METHOD void dump() const
iterator erase(const_iterator CI)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void sort(IteratorTy Start, IteratorTy End)
ArrayRef< DbgValueLoc > getValues() const
This is the shared class of boolean and integer constants.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
bool isTargetIndexLocation() const
const MCSymbol * getEndSym() const
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
MachineLocation getLoc() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool operator<(int64_t V1, const APSInt &V2)
bool isConstantInt() const
This struct describes target specific location.
TargetIndexLocation(unsigned Idx, int64_t Offset)
DbgValueLoc(const DIExpression *Expr, MachineLocation Loc)
A single location or constant.
Basic type, like 'int' or 'float'.