LLVM: lib/CodeGen/SelectionDAG/SDNodeDbgValue.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_SDNODEDBGVALUE_H
14#define LLVM_LIB_CODEGEN_SELECTIONDAG_SDNODEDBGVALUE_H
15
20#include
21
22namespace llvm {
23
29
30
31
32class SDDbgOperand {
33public:
41
42
47
48
51 return u.s.ResNo;
52 }
53
54
59
60
63 return u.FrameIx;
64 }
65
66
71
76 return SDDbgOperand(FrameIdx, FRAMEIX);
77 }
79 return SDDbgOperand(VReg.id(), VREG);
80 }
82 return SDDbgOperand(Const);
83 }
84
87 if (kind != Other.kind)
88 return false;
89 switch (kind) {
98 }
99 return false;
100 }
101
102private:
103 Kind kind;
104 union {
105 struct {
112 } u;
113
114
116 u.s.Node = N;
117 u.s.ResNo = R;
118 }
119
120 SDDbgOperand(const Value *C) : kind(CONST) { u.Const = C; }
121
122 SDDbgOperand(unsigned VRegOrFrameIdx, Kind Kind) : kind(Kind) {
124 "Invalid SDDbgValue constructor");
125 if (kind == VREG)
126 u.VReg = VRegOrFrameIdx;
127 else
128 u.FrameIx = VRegOrFrameIdx;
129 }
130};
131
132
133
135public:
136
137private:
138
139
140
141 size_t NumLocationOps;
143
144
145 size_t NumAdditionalDependencies;
146 SDNode **AdditionalDependencies;
150 unsigned Order;
151 bool IsIndirect;
152 bool IsVariadic;
153 bool Invalid = false;
154 bool Emitted = false;
155
156public:
159 bool IsIndirect, DebugLoc DL, unsigned O, bool IsVariadic)
160 : NumLocationOps(L.size()),
162 NumAdditionalDependencies(Dependencies.size()),
163 AdditionalDependencies(Alloc.Allocate<SDNode *>(Dependencies.size())),
164 Var(Var), Expr(Expr), DL(DL), Order(O), IsIndirect(IsIndirect),
165 IsVariadic(IsVariadic) {
166 assert(IsVariadic || L.size() == 1);
167 assert(!(IsVariadic && IsIndirect));
169 llvm::copy(Dependencies, AdditionalDependencies);
170 }
171
172
173
174
175
179
180
182
183
185
189
193
194
201 return Dependencies;
202 }
203
206 NumAdditionalDependencies);
207 }
208
209
211
213
214
216
217
218
219 unsigned getOrder() const { return Order; }
220
221
222
223
226
227
228
231
232
233
235
238};
239
240
241
245 unsigned Order;
246
247public:
249 : Label(Label), DL(std::move(dl)), Order(O) {}
250
251
253
254
256
257
258
259 unsigned getOrder() const { return Order; }
260};
261
262}
263
264#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the BumpPtrAllocator interface.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Base class for variables.
Wrapper class representing virtual and physical registers.
MDNode * getLabel() const
Returns the MDNode pointer for the label.
Definition SDNodeDbgValue.h:252
SDDbgLabel(MDNode *Label, DebugLoc dl, unsigned O)
Definition SDNodeDbgValue.h:248
unsigned getOrder() const
Returns the SDNodeOrder.
Definition SDNodeDbgValue.h:259
const DebugLoc & getDebugLoc() const
Returns the DebugLoc.
Definition SDNodeDbgValue.h:255
Holds the information for a single machine location through SDISel; either an SDNode,...
Definition SDNodeDbgValue.h:32
static SDDbgOperand fromNode(SDNode *Node, unsigned ResNo)
Definition SDNodeDbgValue.h:72
bool operator!=(const SDDbgOperand &Other) const
Definition SDNodeDbgValue.h:85
static SDDbgOperand fromFrameIdx(unsigned FrameIdx)
Definition SDNodeDbgValue.h:75
Register getVReg() const
Returns the Virtual Register for a VReg.
Definition SDNodeDbgValue.h:67
unsigned VReg
Valid for registers.
Definition SDNodeDbgValue.h:111
unsigned getResNo() const
Returns the ResNo for a register ref.
Definition SDNodeDbgValue.h:49
unsigned ResNo
Valid for expressions.
Definition SDNodeDbgValue.h:107
struct llvm::SDDbgOperand::@102256054047252322001367132133154236226360121031::@167330344224375143036156327334061363243101214203 s
static SDDbgOperand fromVReg(Register VReg)
Definition SDNodeDbgValue.h:78
unsigned FrameIx
Valid for stack objects.
Definition SDNodeDbgValue.h:110
unsigned getFrameIx() const
Returns the FrameIx for a stack object.
Definition SDNodeDbgValue.h:61
static SDDbgOperand fromConst(const Value *Const)
Definition SDNodeDbgValue.h:81
SDNode * getSDNode() const
Returns the SDNode* for a register ref.
Definition SDNodeDbgValue.h:43
const Value * Const
Valid for constants.
Definition SDNodeDbgValue.h:109
Kind
Definition SDNodeDbgValue.h:34
@ VREG
Value is a virtual register.
Definition SDNodeDbgValue.h:38
@ FRAMEIX
Value is contents of a stack location.
Definition SDNodeDbgValue.h:37
@ SDNODE
Value is the result of an expression.
Definition SDNodeDbgValue.h:35
@ CONST
Value is a constant.
Definition SDNodeDbgValue.h:36
const Value * getConst() const
Returns the Value* for a constant.
Definition SDNodeDbgValue.h:55
bool operator==(const SDDbgOperand &Other) const
Definition SDNodeDbgValue.h:86
SDNode * Node
Valid for expressions.
Definition SDNodeDbgValue.h:106
Kind getKind() const
Definition SDNodeDbgValue.h:40
SDDbgValue & operator=(const SDDbgValue &Other)=delete
bool isEmitted() const
Definition SDNodeDbgValue.h:230
LLVM_DUMP_METHOD void print(raw_ostream &OS) const
const DebugLoc & getDebugLoc() const
Returns the DebugLoc.
Definition SDNodeDbgValue.h:215
SDDbgValue(const SDDbgValue &Other)=delete
SmallVector< SDDbgOperand > copyLocationOps() const
Definition SDNodeDbgValue.h:190
DIVariable * getVariable() const
Returns the DIVariable pointer for the variable.
Definition SDNodeDbgValue.h:181
void setIsInvalidated()
setIsInvalidated / isInvalidated - Setter / getter of the "Invalidated" property.
Definition SDNodeDbgValue.h:224
unsigned getOrder() const
Returns the SDNodeOrder.
Definition SDNodeDbgValue.h:219
LLVM_DUMP_METHOD void dump() const
SDDbgValue(BumpPtrAllocator &Alloc, DIVariable *Var, DIExpression *Expr, ArrayRef< SDDbgOperand > L, ArrayRef< SDNode * > Dependencies, bool IsIndirect, DebugLoc DL, unsigned O, bool IsVariadic)
Definition SDNodeDbgValue.h:157
bool isInvalidated() const
Definition SDNodeDbgValue.h:225
ArrayRef< SDDbgOperand > getLocationOps() const
Definition SDNodeDbgValue.h:186
void clearIsEmitted()
clearIsEmitted - Reset Emitted flag, for certain special cases where SDDbgValue is emitted twice.
Definition SDNodeDbgValue.h:234
SmallVector< SDNode * > getSDNodes() const
Definition SDNodeDbgValue.h:195
DIExpression * getExpression() const
Returns the DIExpression pointer for the expression.
Definition SDNodeDbgValue.h:184
ArrayRef< SDNode * > getAdditionalDependencies() const
Definition SDNodeDbgValue.h:204
bool isIndirect() const
Returns whether this is an indirect value.
Definition SDNodeDbgValue.h:210
void setIsEmitted()
setIsEmitted / isEmitted - Getter/Setter for flag indicating that this SDDbgValue has been emitted to...
Definition SDNodeDbgValue.h:229
bool isVariadic() const
Definition SDNodeDbgValue.h:212
Represents one node in the SelectionDAG.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
ArrayRef(const T &OneElt) -> ArrayRef< T >
OutputIt copy(R &&Range, OutputIt Out)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Implement std::hash so that hash_code can be used in STL containers.
TODO: Might pack better if we changed this to a Struct of Arrays, since MachineOperand is width 32,...