LLVM: include/llvm/IR/DebugInfo.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef LLVM_IR_DEBUGINFO_H
17#define LLVM_IR_DEBUGINFO_H
18
31#include
32
33namespace llvm {
34
41
42
43
45
47
49
50
54
58
59
61
62
63
65
66
67
68
69
70
73
74
75
76
77
78
79
80
81
82
83
85
86
87
88
89
93
94
96
97
98
99
100
101
102
103
104
106public:
107
109
111
112
114
116
118
119
121
122
124
125private:
127 void processScope(DIScope *Scope);
128 void processType(DIType *DT);
132 bool addScope(DIScope *Scope);
134 bool addType(DIType *DT);
135
136public:
144
146
148
152
154
156
160 unsigned type_count() const { return TYs.size(); }
161 unsigned scope_count() const { return Scopes.size(); }
162
163private:
170};
171
172
174
175
176
177
180
181
182
183
185
188 "Can't get assignment instructions for non-assign DVR!");
190}
191
192
193
196 if (auto *ID = Inst->getMetadata(LLVMContext::MD_DIAssignID))
198 return {};
199}
200
201
203
204
206
207
209
210
211
212
213
214
215
216
217
218
223 std::optionalDIExpression::FragmentInfo &Result);
224
225
226
229
230
231
232
233
234
235
239
244 return std::tie(LHS.Var, LHS.DL) < std::tie(RHS.Var, RHS.DL);
245 }
247 return std::tie(LHS.Var, LHS.DL) == std::tie(RHS.Var, RHS.DL);
248 }
249};
250
251}
252
272
273namespace at {
274
275
276
277
280
281
282
285 const DataLayout &DL, bool DebugPrints = false);
286
287
288
302
309
310}
311
312
313
314
315
316
317
319
320
322
323public:
326};
327
328
330
331}
332
333#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines DenseMapInfo traits for DenseMap.
This header defines various interfaces for pass management in LLVM.
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallPtrSet class.
This file defines the SmallSet class.
This file defines the SmallVector class.
an instruction to allocate memory on the stack
Convert @llvm.dbg.declare intrinsics into sets of @llvm.dbg.assign intrinsics by treating stores to t...
Definition DebugInfo.h:318
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
A pair of DIGlobalVariable and DIExpression.
An imported module (C++ using directive or similar).
Base class for scope-like contexts.
Subprogram description. Uses SubclassData1.
A parsed version of the target data layout string in and methods for querying it.
This represents the llvm.dbg.declare instruction.
Base class for non-instruction debug metadata records that have positions within IR.
This represents the llvm.dbg.value instruction.
This is the common base class for debug info intrinsics for variables.
Record of a variable value-assignment, aka a non instruction representation of the dbg....
LLVM_ABI DIAssignID * getAssignID() const
Utility to find all debug info in a module.
Definition DebugInfo.h:105
LLVM_ABI void processInstruction(const Module &M, const Instruction &I)
Process a single instruction and collect debug info anchors.
unsigned subprogram_count() const
Definition DebugInfo.h:159
LLVM_ABI void processModule(const Module &M)
Process entire module and collect debug info anchors.
unsigned type_count() const
Definition DebugInfo.h:160
LLVM_ABI void processSubprogram(DISubprogram *SP)
Process subprogram.
SmallVectorImpl< DICompileUnit * >::const_iterator compile_unit_iterator
Definition DebugInfo.h:137
LLVM_ABI void processLocation(const Module &M, const DILocation *Loc)
Process debug info location.
LLVM_ABI void reset()
Clear all lists.
SmallVectorImpl< DIScope * >::const_iterator scope_iterator
Definition DebugInfo.h:143
unsigned global_variable_count() const
Definition DebugInfo.h:158
iterator_range< global_variable_expression_iterator > global_variables() const
Definition DebugInfo.h:149
iterator_range< subprogram_iterator > subprograms() const
Definition DebugInfo.h:147
SmallVectorImpl< DIType * >::const_iterator type_iterator
Definition DebugInfo.h:142
SmallVectorImpl< DISubprogram * >::const_iterator subprogram_iterator
Definition DebugInfo.h:139
LLVM_ABI void processVariable(const DILocalVariable *DVI)
Process a DILocalVariable.
iterator_range< type_iterator > types() const
Definition DebugInfo.h:153
iterator_range< scope_iterator > scopes() const
Definition DebugInfo.h:155
unsigned compile_unit_count() const
Definition DebugInfo.h:157
iterator_range< compile_unit_iterator > compile_units() const
Definition DebugInfo.h:145
LLVM_ABI void processDbgRecord(const Module &M, const DbgRecord &DR)
Process a DbgRecord.
unsigned scope_count() const
Definition DebugInfo.h:161
SmallVectorImpl< DIGlobalVariableExpression * >::const_iterator global_variable_expression_iterator
Definition DebugInfo.h:140
BasicBlockListType::iterator iterator
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
This is the common base class for memset/memcpy/memmove.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
typename SuperClass::const_iterator const_iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An instruction for storing to memory.
TinyPtrVector - This class is specialized for cases where there are normally 0 or 1 element in a vect...
LLVM Value Representation.
An efficient, type-erasing, non-owning reference to a callable.
A range adaptor for a pair of iterators.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Assignment Tracking (at).
Definition DebugInfo.h:173
LLVM_ABI void deleteAll(Function *F)
Remove all Assignment Tracking related intrinsics and metadata from F.
LLVM_ABI AssignmentInstRange getAssignmentInsts(DIAssignID *ID)
Return a range of instructions (typically just one) that have ID as an attachment.
iterator_range< SmallVectorImpl< Instruction * >::iterator > AssignmentInstRange
A range of instructions.
Definition DebugInfo.h:178
LLVM_ABI 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.
LLVM_ABI void remapAssignID(DenseMap< DIAssignID *, DIAssignID * > &Map, Instruction &I)
Replace DIAssignID uses and attachments with IDs from Map.
SmallVector< DbgVariableRecord * > getDVRAssignmentMarkers(const Instruction *Inst)
Return a range of dbg_assign records for which Inst performs the assignment they encode.
Definition DebugInfo.h:195
LLVM_ABI void deleteAssignmentMarkers(const Instruction *Inst)
Delete the llvm.dbg.assign intrinsics linked to Inst.
LLVM_ABI std::optional< AssignmentInfo > getAssignmentInfo(const DataLayout &DL, const MemIntrinsic *I)
DenseMap< const AllocaInst *, SmallSetVector< VarRecord, 2 > > StorageToVarsMap
Map of backing storage to a set of variables that are stored to it.
Definition DebugInfo.h:278
LLVM_ABI void RAUW(DIAssignID *Old, DIAssignID *New)
Replace all uses (and attachments) of Old with New.
LLVM_ABI bool calculateFragmentIntersect(const DataLayout &DL, const Value *Dest, uint64_t SliceOffsetInBits, uint64_t SliceSizeInBits, const DbgVariableRecord *DVRAssign, std::optional< DIExpression::FragmentInfo > &Result)
Calculate the fragment of the variable in DAI covered from (Dest + SliceOffsetInBits) to to (Dest + S...
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void findDbgValues(Value *V, SmallVectorImpl< DbgVariableRecord * > &DbgVariableRecords)
Finds the dbg.values describing a value.
LLVM_ABI bool stripDebugInfo(Function &F)
@ Import
Import information from summary.
LLVM_ABI bool stripNonLineTableDebugInfo(Module &M)
Downgrade the debug info in a module to contain only line table information.
LLVM_ABI TinyPtrVector< DbgVariableRecord * > findDVRValues(Value *V)
As above, for DVRValues.
LLVM_ABI unsigned getDebugMetadataVersionFromModule(const Module &M)
Return Debug Info Metadata Version by checking module flags.
LLVM_ABI bool StripDebugInfo(Module &M)
Strip debug info in the module if it exists.
LLVM_ABI bool isAssignmentTrackingEnabled(const Module &M)
Return true if assignment tracking is enabled for module M.
LLVM_ABI DebugLoc getDebugValueLoc(DbgVariableRecord *DVR)
Produce a DebugLoc to use for each dbg.declare that is promoted to a dbg.value.
LLVM_ABI TinyPtrVector< DbgVariableRecord * > findDVRDeclareValues(Value *V)
As above, for DVRDeclareValues.
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
LLVM_ABI TinyPtrVector< DbgVariableRecord * > findDVRDeclares(Value *V)
Finds dbg.declare records declaring local variables as living in the memory that 'V' points to.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
LLVM_ABI void updateLoopMetadataDebugLocations(Instruction &I, function_ref< Metadata *(Metadata *)> Updater)
Update the debug locations contained within the MD_loop metadata attached to the instruction I,...
LLVM_ABI void findDbgUsers(Value *V, SmallVectorImpl< DbgVariableRecord * > &DbgVariableRecords)
Finds the debug info records describing a value.
LLVM_ABI DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
static bool isEqual(const at::VarRecord &A, const at::VarRecord &B)
Definition DebugInfo.h:268
static at::VarRecord getEmptyKey()
Definition DebugInfo.h:254
static unsigned getHashValue(const at::VarRecord &Var)
Definition DebugInfo.h:264
static at::VarRecord getTombstoneKey()
Definition DebugInfo.h:259
An information struct used to provide DenseMap with the various necessary components for a given valu...
A CRTP mix-in to automatically provide informational APIs needed for passes.
AssignmentInfo(const DataLayout &DL, AllocaInst const *Base, uint64_t OffsetInBits, uint64_t SizeInBits)
Definition DebugInfo.h:295
uint64_t OffsetInBits
Offset into Base.
Definition DebugInfo.h:291
uint64_t SizeInBits
Number of bits stored.
Definition DebugInfo.h:292
AllocaInst const * Base
Base storage.
Definition DebugInfo.h:290
bool StoreToWholeAlloca
SizeInBits equals the size of the base storage.
Definition DebugInfo.h:293
Helper struct for trackAssignments, below.
Definition DebugInfo.h:236
VarRecord(DbgVariableRecord *DVR)
Definition DebugInfo.h:240
friend bool operator==(const VarRecord &LHS, const VarRecord &RHS)
Definition DebugInfo.h:246
friend bool operator<(const VarRecord &LHS, const VarRecord &RHS)
Definition DebugInfo.h:243
DILocation * DL
Definition DebugInfo.h:238
VarRecord(DILocalVariable *Var, DILocation *DL)
Definition DebugInfo.h:242
DILocalVariable * Var
Definition DebugInfo.h:237