Go to the documentation of this file.
16 #ifndef LLVM_IR_DEBUGINFO_H
17 #define LLVM_IR_DEBUGINFO_H
34 class DbgVariableIntrinsic;
118 void processScope(
DIScope *Scope);
119 void processType(
DIType *DT);
152 return make_range(Scopes.begin(), Scopes.end());
199 typename std::iterator_traits<
200 Value::user_iterator>::iterator_category,
201 DbgAssignIntrinsic *, std::ptrdiff_t,
202 DbgAssignIntrinsic **,
203 DbgAssignIntrinsic *&> {
217 if (
auto *
ID = Inst->
getMetadata(LLVMContext::MD_DIAssignID))
246 return std::tie(
LHS.Var,
LHS.DL) < std::tie(
RHS.Var,
RHS.DL);
249 return std::tie(
LHS.Var,
LHS.DL) == std::tie(
RHS.Var,
RHS.DL);
263 bool DebugPrints =
false);
310 #endif // LLVM_IR_DEBUGINFO_H
A set of analyses that are preserved following a run of a transformation pass.
AssignmentInfo(const DataLayout &DL, AllocaInst const *Base, uint64_t OffsetInBits, uint64_t SizeInBits)
bool StripDebugInfo(Module &M)
Strip debug info in the module if it exists.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
A parsed version of the target data layout string in and methods for querying it.
void reset()
Clear all lists.
A CRTP mix-in to automatically provide informational APIs needed for passes.
unsigned type_count() const
void deleteAssignmentMarkers(const Instruction *Inst)
Delete the llvm.dbg.assign intrinsics linked to Inst.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
bool isAssignmentTrackingEnabled(const Module &M)
Return true if assignment tracking is enabled for module M.
const AllocaInst * Base
Base storage.
void findDbgUsers(SmallVectorImpl< DbgVariableIntrinsic * > &DbgInsts, Value *V)
Finds the debug info intrinsics describing a value.
uint64_t SizeInBits
Number of bits stored.
DbgAssignIntrinsic * operator*() const
DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.
void RAUW(DIAssignID *Old, DIAssignID *New)
Replace all uses (and attachments) of Old with New.
CRTP base class for adapting an iterator to a different type.
Convert @llvm.dbg.declare intrinsics into sets of @llvm.dbg.assign intrinsics by treating stores to t...
This is the common base class for memset/memcpy/memmove.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
DbgAssignIt(Value::user_iterator It)
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional ldr LCPI1_0 ldr ldr tst movne lsr ldr LCPI1_1 and r0 bx lr it saves an instruction and a register It might be profitable to cse MOVi16 if there are lots of bit immediates with the same bottom half Robert Muth started working on an alternate jump table implementation that does not put the tables in line in the text This is more like the llvm default jump table implementation This might be useful sometime Several revisions of patches are on the mailing beginning at
TinyPtrVector< DbgVariableIntrinsic * > FindDbgAddrUses(Value *V)
Finds all intrinsics declaring local variables as living in the memory that 'V' points to.
friend bool operator<(const VarRecord &LHS, const VarRecord &RHS)
iterator_range< compile_unit_iterator > compile_units() const
Utility to find all debug info in a module.
AssignmentMarkerRange getAssignmentMarkers(DIAssignID *ID)
Return a range of dbg.assign intrinsics which use \ID as an operand.
SmallVectorImpl< DIType * >::const_iterator type_iterator
Describes properties of a store that has a static size and offset into a some base storage.
DIAssignID * getAssignID() const
SmallVectorImpl< DIScope * >::const_iterator scope_iterator
TinyPtrVector< DbgDeclareInst * > FindDbgDeclareUses(Value *V)
Like FindDbgAddrUses, but only returns dbg.declare intrinsics, not dbg.addr.
bool stripDebugInfo(Function &F)
AssignmentInstRange getAssignmentInsts(DIAssignID *ID)
Return a range of instructions (typically just one) that have ID as an attachment.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
std::optional< AssignmentInfo > getAssignmentInfo(const DataLayout &DL, const MemIntrinsic *I)
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
unsigned scope_count() const
void processSubprogram(DISubprogram *SP)
Process subprogram.
This is the common base class for debug info intrinsics for variables.
An instruction for storing to memory.
void trackAssignments(Function::iterator Start, Function::iterator End, const StorageToVarsMap &Vars, const DataLayout &DL, bool DebugPrints=false)
Track assignments to Vars between Start and End.
void findDbgValues(SmallVectorImpl< DbgValueInst * > &DbgValues, Value *V)
Finds the llvm.dbg.value intrinsics describing a value.
DebugLoc getDebugValueLoc(DbgVariableIntrinsic *DII)
Produce a DebugLoc to use for each dbg.declare that is promoted to a dbg.value.
void deleteAll(Function *F)
Remove all Assignment Tracking related intrinsics and metadata from F.
typename SuperClass::const_iterator const_iterator
void processModule(const Module &M)
Process entire module and collect debug info anchors.
SmallVectorImpl< DIGlobalVariableExpression * >::const_iterator global_variable_expression_iterator
A Module instance is used to store all the information related to an LLVM module.
iterator_range< global_variable_expression_iterator > global_variables() const
void processLocation(const Module &M, const DILocation *Loc)
Process debug info location.
iterator_range< subprogram_iterator > subprograms() const
unsigned subprogram_count() const
Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface o...
void processVariable(const Module &M, const DbgVariableIntrinsic &DVI)
Process DbgVariableIntrinsic.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This represents the llvm.dbg.assign instruction.
Machine Check Debug Module
void updateLoopMetadataDebugLocations(Instruction &I, function_ref< Metadata *(Metadata *)> Updater)
Update the debug locations contained within the MD_loop metadata attached to the instruction I,...
SmallVectorImpl< DISubprogram * >::const_iterator subprogram_iterator
High level: this is an iterator for llvm.dbg.assign intrinsics.
Base class for scope-like contexts.
user_iterator_impl< User > user_iterator
Helper struct for trackAssignments, below.
unsigned compile_unit_count() const
uint64_t OffsetInBits
Offset into Base.
friend bool operator==(const VarRecord &LHS, const VarRecord &RHS)
VarRecord(DILocalVariable *Var, DILocation *DL)
A pair of DIGlobalVariable and DIExpression.
bool StoreToWholeAlloca
SizeInBits equals the size of the base storage.
bool stripNonLineTableDebugInfo(Module &M)
Downgrade the debug info in a module to contain only line table information.
A range adaptor for a pair of iterators.
A container for analyses that lazily runs them and caches their results.
unsigned getDebugMetadataVersionFromModule(const Module &M)
Return Debug Info Metadata Version by checking module flags.
iterator_range< scope_iterator > scopes() const
an instruction to allocate memory on the stack
iterator_range< type_iterator > types() const
void processInstruction(const Module &M, const Instruction &I)
Process a single instruction and collect debug info anchors.
SmallVectorImpl< DICompileUnit * >::const_iterator compile_unit_iterator
VarRecord(DbgVariableIntrinsic *DVI)
unsigned global_variable_count() const
BasicBlockListType::iterator iterator