47#ifndef LLVM_IR_DEBUGPROGRAMINSTRUCTION_H
48#define LLVM_IR_DEBUGPROGRAMINSTRUCTION_H
100 operator T *()
const {
return get(); }
108 explicit operator bool()
const {
return Ref; }
114 return Ref ==
Other.Ref;
117 return Ref !=
Other.Ref;
161 bool IsForDebug)
const;
209 LLVM_ABI void insertBefore(self_iterator InsertBefore);
210 LLVM_ABI void insertAfter(self_iterator InsertAfter);
211 LLVM_ABI void moveBefore(self_iterator MoveBefore);
212 LLVM_ABI void moveAfter(self_iterator MoveAfter);
258 bool IsForDebug)
const;
372 std::bidirectional_iterator_tag,
Value *> {
426 bool AllowEmpty =
false);
434 LLVM_ABI unsigned getNumVariableLocationOps()
const;
452 LLVM_ABI bool isKillLocation()
const;
478 "Location for a DbgVariableRecord must be either ValueAsMetadata or "
483 LLVM_ABI std::optional<DbgVariableFragmentInfo> getFragment()
const;
496 LLVM_ABI std::optional<uint64_t> getFragmentSizeInBits()
const;
552 bool IsForDebug)
const;
619 bool IsForDebug)
const;
654 bool InsertAtHead =
false);
686inline iterator_range<simple_ilist<DbgRecord>::iterator>
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static const Function * getParent(const Value *V)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
#define LLVM_TEMPLATE_ABI
MachineInstr unsigned OpIdx
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
bool isKillAddress(const DbgVariableRecord *DVR)
static SymbolRef::Type getType(const Symbol *Sym)
static Function * getFunction(FunctionType *Ty, const Twine &Name, Module *M)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM Basic Block Representation.
This is the common base class for debug info intrinsics.
This represents the llvm.dbg.label instruction.
MDNode * getRawLabel() const
LLVM_ABI DbgLabelRecord * clone() const
static bool classof(const DbgRecord *E)
Support type inquiry through isa, cast, and dyn_cast.
static LLVM_ABI DbgLabelRecord * createUnresolvedDbgLabelRecord(MDNode *Label, MDNode *DL)
For use during parsing; creates a DbgLabelRecord from as-of-yet unresolved MDNodes.
void setLabel(DILabel *NewLabel)
DILabel * getLabel() const
LLVM_ABI DbgLabelInst * createDebugIntrinsic(Module *M, Instruction *InsertBefore) const
Per-instruction record of debug-info.
static iterator_range< simple_ilist< DbgRecord >::iterator > getEmptyDbgRecordRange()
LLVM_ABI void removeFromParent()
LLVM_ABI void dump() const
Instruction * MarkedInstr
Link back to the Instruction that owns this marker.
LLVM_ABI iterator_range< simple_ilist< DbgRecord >::iterator > cloneDebugInfoFrom(DbgMarker *From, std::optional< simple_ilist< DbgRecord >::iterator > FromHere, bool InsertAtHead=false)
Clone all DbgMarkers from From into this marker.
LLVM_ABI void insertDbgRecordAfter(DbgRecord *New, DbgRecord *InsertAfter)
Insert a DbgRecord after a DbgRecord contained within this marker.
LLVM_ABI void print(raw_ostream &O, bool IsForDebug=false) const
Implement operator<< on DbgMarker.
LLVM_ABI void removeMarker()
Handle the removal of a marker: the position of debug-info has gone away, but the stored debug record...
LLVM_ABI void absorbDebugValues(DbgMarker &Src, bool InsertAtHead)
Transfer any DbgRecords from Src into this DbgMarker.
LLVM_ABI void dropDbgRecords()
Erase all DbgRecords in this DbgMarker.
LLVM_ABI iterator_range< simple_ilist< DbgRecord >::iterator > getDbgRecordRange()
Produce a range over all the DbgRecords in this Marker.
LLVM_ABI void dropOneDbgRecord(DbgRecord *DR)
Erase a single DbgRecord from this marker.
LLVM_ABI const BasicBlock * getParent() const
simple_ilist< DbgRecord > StoredDbgRecords
List of DbgRecords, the non-instruction equivalent of llvm.dbg.
LLVM_ABI void eraseFromParent()
LLVM_ABI void insertDbgRecord(DbgRecord *New, bool InsertAtHead)
Insert a DbgRecord into this DbgMarker, at the end of the list.
static LLVM_ABI DbgMarker EmptyDbgMarker
We generally act like all llvm Instructions have a range of DbgRecords attached to them,...
A typed tracking MDNode reference that does not require a definition for its parameter type.
T * get() const
Get the underlying type.
bool operator!=(const DbgRecordParamRef &Other) const
DbgRecordParamRef()=default
MDNode * getAsMDNode() const
Return this as a MDNode.
bool operator==(const DbgRecordParamRef &Other) const
Base class for non-instruction debug metadata records that have positions within IR.
DbgRecord(Kind RecordKind, DebugLoc DL)
simple_ilist< DbgRecord >::iterator self_iterator
DebugLoc getDebugLoc() const
Kind RecordKind
Subclass discriminator.
~DbgRecord()=default
Similarly to Value, we avoid paying the cost of a vtable by protecting the dtor and having deleteReco...
DbgRecord * getNextNode()
simple_ilist< DbgRecord >::const_iterator const_self_iterator
Kind
Subclass discriminator.
void setDebugLoc(DebugLoc Loc)
Kind getRecordKind() const
const DbgMarker * getMarker() const
DbgMarker * Marker
Marker that this DbgRecord is linked into.
void setMarker(DbgMarker *M)
DbgRecord * getPrevNode()
This is the common base class for debug info intrinsics for variables.
location_op_iterator(ValueAsMetadata **MultiIter)
location_op_iterator & operator--()
location_op_iterator(ValueAsMetadata *SingleIter)
bool operator==(const location_op_iterator &RHS) const
location_op_iterator & operator++()
location_op_iterator & operator=(const location_op_iterator &R)
const Value * operator*() const
location_op_iterator(const location_op_iterator &R)
Record of a variable value-assignment, aka a non instruction representation of the dbg....
LLVM_ABI DbgVariableRecord(const DbgVariableIntrinsic *DVI)
Create a new DbgVariableRecord representing the intrinsic DVI, for example the assignment represented...
bool isEquivalentTo(const DbgVariableRecord &Other) const
LocationType getType() const
DbgRecordParamRef< DIExpression > Expression
bool isValueOfVariable() const
Determine if this describes the value of a local variable.
bool hasValidLocation() const
Returns true if this DbgVariableRecord has no empty MDNodes in its location list.
LocationType Type
Classification of the debug-info record that this DbgVariableRecord represents.
MDNode * getRawExpression() const
DbgRecordParamRef< DILocalVariable > Variable
void setAddressExpression(DIExpression *NewExpr)
DbgVariableFragmentInfo getFragmentOrEntireVariable() const
Get the FragmentInfo for the variable if it exists, otherwise return a FragmentInfo that covers the e...
MDNode * getRawAddressExpression() const
bool isAddressOfVariable() const
Does this describe the address of a local variable.
LLVM_ABI std::optional< uint64_t > getFragmentSizeInBits() const
Get the size (in bits) of the variable, or fragment of the variable that is described.
Value * getValue(unsigned OpIdx=0) const
static LLVM_ABI DbgVariableRecord * createUnresolvedDbgVariableRecord(LocationType Type, Metadata *Val, MDNode *Variable, MDNode *Expression, MDNode *AssignID, Metadata *Address, MDNode *AddressExpression, MDNode *DI)
Used to create DbgVariableRecords during parsing, where some metadata references may still be unresol...
void setRawLocation(Metadata *NewLocation)
Use of this should generally be avoided; instead, replaceVariableLocationOp and addVariableLocationOp...
static LLVM_ABI DbgVariableRecord * createDbgVariableRecord(Value *Location, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI)
static LLVM_ABI DbgVariableRecord * createDVRDeclare(Value *Address, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI)
LLVM_ABI void handleChangedLocation(Metadata *NewLocation)
Handle changes to the location of the Value(s) that we refer to happening "under our feet".
void setVariable(DILocalVariable *NewVar)
void setExpression(DIExpression *NewExpr)
DIExpression * getExpression() const
Metadata * getRawAssignID() const
LLVM_ABI Value * getVariableLocationOp(unsigned OpIdx) const
MDNode * getRawVariable() const
DILocalVariable * getVariable() const
static bool classof(const DbgRecord *E)
Support type inquiry through isa, cast, and dyn_cast.
Metadata * getRawLocation() const
Returns the metadata operand for the first location description.
bool isDbgDeclare() const
void setAddress(Value *V)
static LLVM_ABI DbgVariableRecord * createDVRAssign(Value *Val, DILocalVariable *Variable, DIExpression *Expression, DIAssignID *AssignID, Value *Address, DIExpression *AddressExpression, const DILocation *DI)
Metadata * getRawAddress() const
friend class DebugValueUser
@ End
Marks the end of the concrete types.
@ Any
To indicate all LocationTypes in searches.
LLVM_ABI std::optional< DbgVariableFragmentInfo > getFragment() const
static LLVM_ABI DbgVariableRecord * createLinkedDVRAssign(Instruction *LinkedInstr, Value *Val, DILocalVariable *Variable, DIExpression *Expression, Value *Address, DIExpression *AddressExpression, const DILocation *DI)
bool isIdenticalToWhenDefined(const DbgVariableRecord &Other) const
DbgRecordParamRef< DIExpression > AddressExpression
DIExpression * getAddressExpression() const
std::array< Metadata *, 3 > DebugValues
void resetDebugValue(size_t Idx, Metadata *DebugValue)
This is an important class for using LLVM in a threaded context.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Manage lifetime of a slot tracker for printing IR.
A Module instance is used to store all the information related to an LLVM module.
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
LLVM Value Representation.
self_iterator getIterator()
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
A simple intrusive list implementation.
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, false >::type iterator
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, true >::type const_iterator
struct LLVMOpaqueDbgRecord * LLVMDbgRecordRef
This file defines classes to implement an intrusive doubly linked list class (i.e.
This file defines the ilist_node class template, which is a convenient base class for creating classe...
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
TypedTrackingMDRef< MDNode > TrackingMDNodeRef
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)
template class LLVM_TEMPLATE_ABI DbgRecordParamRef< DIExpression >
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
auto map_range(ContainerTy &&C, FuncTy F)
iterator_range< simple_ilist< DbgRecord >::iterator > getDbgRecordRange(DbgMarker *DebugMarker)
Inline helper to return a range of DbgRecords attached to a marker.
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > make_filter_range(RangeT &&Range, PredicateT Pred)
Convenience function that takes a range of elements and a predicate, and return a new filter_iterator...
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
template class LLVM_TEMPLATE_ABI DbgRecordParamRef< DILocalVariable >
static auto filterDbgVars(iterator_range< simple_ilist< DbgRecord >::iterator > R)
Filter the DbgRecord range to DbgVariableRecord types only and downcast.
template class LLVM_TEMPLATE_ABI DbgRecordParamRef< DILabel >