llvm.org GIT mirror llvm / fd1b7e8
Remove `inline` keyword from inline `classof` methods The style guide states that the explicit `inline` should not be used with inline methods. classof is very common inline method with a fair amount on inconsistency: $ git grep classof ./include | grep inline | wc -l 230 $ git grep classof ./include | grep -v inline | wc -l 257 I chose to target this method rather the larger change since this method is easily cargo-culted (I did it at least once). I considered doing the larger change and removing all occurrences but that would be a much larger change. Differential Revision: https://reviews.llvm.org/D33906 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306731 91177308-0d34-0410-b5e6-96231b3b80d8 Sam Clegg 2 years ago
38 changed file(s) with 293 addition(s) and 295 deletion(s). Raw diff Collapse all Expand all
138138
139139 // Methods for support type inquiry through isa, cast, and
140140 // dyn_cast
141 static inline bool classof(const Value *V) {
141 static bool classof(const Value *V) {
142142 unsigned ID = V->getValueID();
143143 return ID == MemoryUseVal || ID == MemoryPhiVal || ID == MemoryDefVal;
144144 }
240240 /// \brief Get the access that produces the memory state used by this Use.
241241 MemoryAccess *getDefiningAccess() const { return getOperand(0); }
242242
243 static inline bool classof(const Value *MA) {
243 static bool classof(const Value *MA) {
244244 return MA->getValueID() == MemoryUseVal || MA->getValueID() == MemoryDefVal;
245245 }
246246
296296 // allocate space for exactly one operand
297297 void *operator new(size_t s) { return User::operator new(s, 1); }
298298
299 static inline bool classof(const Value *MA) {
299 static bool classof(const Value *MA) {
300300 return MA->getValueID() == MemoryUseVal;
301301 }
302302
352352 // allocate space for exactly one operand
353353 void *operator new(size_t s) { return User::operator new(s, 1); }
354354
355 static inline bool classof(const Value *MA) {
355 static bool classof(const Value *MA) {
356356 return MA->getValueID() == MemoryDefVal;
357357 }
358358
525525 return getIncomingValue(Idx);
526526 }
527527
528 static inline bool classof(const Value *V) {
528 static bool classof(const Value *V) {
529529 return V->getValueID() == MemoryPhiVal;
530530 }
531531
261261 const SCEVConstant *getRHS() const { return RHS; }
262262
263263 /// Methods for support type inquiry through isa, cast, and dyn_cast:
264 static inline bool classof(const SCEVPredicate *P) {
264 static bool classof(const SCEVPredicate *P) {
265265 return P->getKind() == P_Equal;
266266 }
267267 };
359359 bool isAlwaysTrue() const override;
360360
361361 /// Methods for support type inquiry through isa, cast, and dyn_cast:
362 static inline bool classof(const SCEVPredicate *P) {
362 static bool classof(const SCEVPredicate *P) {
363363 return P->getKind() == P_Wrap;
364364 }
365365 };
405405 unsigned getComplexity() const override { return Preds.size(); }
406406
407407 /// Methods for support type inquiry through isa, cast, and dyn_cast:
408 static inline bool classof(const SCEVPredicate *P) {
408 static bool classof(const SCEVPredicate *P) {
409409 return P->getKind() == P_Union;
410410 }
411411 };
4545 Type *getType() const { return V->getType(); }
4646
4747 /// Methods for support type inquiry through isa, cast, and dyn_cast:
48 static inline bool classof(const SCEV *S) {
48 static bool classof(const SCEV *S) {
4949 return S->getSCEVType() == scConstant;
5050 }
5151 };
6464 Type *getType() const { return Ty; }
6565
6666 /// Methods for support type inquiry through isa, cast, and dyn_cast:
67 static inline bool classof(const SCEV *S) {
67 static bool classof(const SCEV *S) {
6868 return S->getSCEVType() == scTruncate ||
6969 S->getSCEVType() == scZeroExtend ||
7070 S->getSCEVType() == scSignExtend;
8181
8282 public:
8383 /// Methods for support type inquiry through isa, cast, and dyn_cast:
84 static inline bool classof(const SCEV *S) {
84 static bool classof(const SCEV *S) {
8585 return S->getSCEVType() == scTruncate;
8686 }
8787 };
9696
9797 public:
9898 /// Methods for support type inquiry through isa, cast, and dyn_cast:
99 static inline bool classof(const SCEV *S) {
99 static bool classof(const SCEV *S) {
100100 return S->getSCEVType() == scZeroExtend;
101101 }
102102 };
111111
112112 public:
113113 /// Methods for support type inquiry through isa, cast, and dyn_cast:
114 static inline bool classof(const SCEV *S) {
114 static bool classof(const SCEV *S) {
115115 return S->getSCEVType() == scSignExtend;
116116 }
117117 };
166166 }
167167
168168 /// Methods for support type inquiry through isa, cast, and dyn_cast:
169 static inline bool classof(const SCEV *S) {
169 static bool classof(const SCEV *S) {
170170 return S->getSCEVType() == scAddExpr ||
171171 S->getSCEVType() == scMulExpr ||
172172 S->getSCEVType() == scSMaxExpr ||
184184
185185 public:
186186 /// Methods for support type inquiry through isa, cast, and dyn_cast:
187 static inline bool classof(const SCEV *S) {
187 static bool classof(const SCEV *S) {
188188 return S->getSCEVType() == scAddExpr ||
189189 S->getSCEVType() == scMulExpr ||
190190 S->getSCEVType() == scSMaxExpr ||
216216 }
217217
218218 /// Methods for support type inquiry through isa, cast, and dyn_cast:
219 static inline bool classof(const SCEV *S) {
219 static bool classof(const SCEV *S) {
220220 return S->getSCEVType() == scAddExpr;
221221 }
222222 };
233233
234234 public:
235235 /// Methods for support type inquiry through isa, cast, and dyn_cast:
236 static inline bool classof(const SCEV *S) {
236 static bool classof(const SCEV *S) {
237237 return S->getSCEVType() == scMulExpr;
238238 }
239239 };
262262 }
263263
264264 /// Methods for support type inquiry through isa, cast, and dyn_cast:
265 static inline bool classof(const SCEV *S) {
265 static bool classof(const SCEV *S) {
266266 return S->getSCEVType() == scUDivExpr;
267267 }
268268 };
344344 }
345345
346346 /// Methods for support type inquiry through isa, cast, and dyn_cast:
347 static inline bool classof(const SCEV *S) {
347 static bool classof(const SCEV *S) {
348348 return S->getSCEVType() == scAddRecExpr;
349349 }
350350 };
362362
363363 public:
364364 /// Methods for support type inquiry through isa, cast, and dyn_cast:
365 static inline bool classof(const SCEV *S) {
365 static bool classof(const SCEV *S) {
366366 return S->getSCEVType() == scSMaxExpr;
367367 }
368368 };
381381
382382 public:
383383 /// Methods for support type inquiry through isa, cast, and dyn_cast:
384 static inline bool classof(const SCEV *S) {
384 static bool classof(const SCEV *S) {
385385 return S->getSCEVType() == scUMaxExpr;
386386 }
387387 };
427427 Type *getType() const { return getValPtr()->getType(); }
428428
429429 /// Methods for support type inquiry through isa, cast, and dyn_cast:
430 static inline bool classof(const SCEV *S) {
430 static bool classof(const SCEV *S) {
431431 return S->getSCEVType() == scUnknown;
432432 }
433433 };
9393 explicit FixedStackPseudoSourceValue(int FI)
9494 : PseudoSourceValue(FixedStack), FI(FI) {}
9595
96 static inline bool classof(const PseudoSourceValue *V) {
96 static bool classof(const PseudoSourceValue *V) {
9797 return V->kind() == FixedStack;
9898 }
9999
125125 public:
126126 GlobalValuePseudoSourceValue(const GlobalValue *GV);
127127
128 static inline bool classof(const PseudoSourceValue *V) {
128 static bool classof(const PseudoSourceValue *V) {
129129 return V->kind() == GlobalValueCallEntry;
130130 }
131131
139139 public:
140140 ExternalSymbolPseudoSourceValue(const char *ES);
141141
142 static inline bool classof(const PseudoSourceValue *V) {
142 static bool classof(const PseudoSourceValue *V) {
143143 return V->kind() == ExternalSymbolCallEntry;
144144 }
145145
17421742
17431743 bool isConstant() const;
17441744
1745 static inline bool classof(const SDNode *N) {
1745 static bool classof(const SDNode *N) {
17461746 return N->getOpcode() == ISD::BUILD_VECTOR;
17471747 }
17481748 };
119119 bool hasAttribute(Attribute::AttrKind Kind) const;
120120
121121 /// Method for support type inquiry through isa, cast, and dyn_cast.
122 static inline bool classof(const Value *V) {
122 static bool classof(const Value *V) {
123123 return V->getValueID() == ArgumentVal;
124124 }
125125 };
325325 ValueSymbolTable *getValueSymbolTable();
326326
327327 /// \brief Methods for support type inquiry through isa, cast, and dyn_cast.
328 static inline bool classof(const Value *V) {
328 static bool classof(const Value *V) {
329329 return V->getValueID() == Value::BasicBlockVal;
330330 }
331331
115115 void destroyConstant();
116116
117117 //// Methods for support type inquiry through isa, cast, and dyn_cast:
118 static inline bool classof(const Value *V) {
118 static bool classof(const Value *V) {
119119 return V->getValueID() >= ConstantFirstVal &&
120120 V->getValueID() <= ConstantLastVal;
121121 }
841841 BasicBlock *getBasicBlock() const { return (BasicBlock*)Op<1>().get(); }
842842
843843 /// Methods for support type inquiry through isa, cast, and dyn_cast:
844 static inline bool classof(const Value *V) {
844 static bool classof(const Value *V) {
845845 return V->getValueID() == BlockAddressVal;
846846 }
847847 };
12161216 Instruction *getAsInstruction();
12171217
12181218 /// Methods for support type inquiry through isa, cast, and dyn_cast:
1219 static inline bool classof(const Value *V) {
1219 static bool classof(const Value *V) {
12201220 return V->getValueID() == ConstantExprVal;
12211221 }
12221222
8888 bool isPowerOf2ByteWidth() const;
8989
9090 /// Methods for support type inquiry through isa, cast, and dyn_cast.
91 static inline bool classof(const Type *T) {
91 static bool classof(const Type *T) {
9292 return T->getTypeID() == IntegerTyID;
9393 }
9494 };
138138 unsigned getNumParams() const { return NumContainedTys - 1; }
139139
140140 /// Methods for support type inquiry through isa, cast, and dyn_cast.
141 static inline bool classof(const Type *T) {
141 static bool classof(const Type *T) {
142142 return T->getTypeID() == FunctionTyID;
143143 }
144144 };
170170 bool indexValid(unsigned Idx) const;
171171
172172 /// Methods for support type inquiry through isa, cast, and dyn_cast.
173 static inline bool classof(const Type *T) {
173 static bool classof(const Type *T) {
174174 return T->getTypeID() == ArrayTyID ||
175175 T->getTypeID() == StructTyID ||
176176 T->getTypeID() == VectorTyID;
316316 }
317317
318318 /// Methods for support type inquiry through isa, cast, and dyn_cast.
319 static inline bool classof(const Type *T) {
319 static bool classof(const Type *T) {
320320 return T->getTypeID() == StructTyID;
321321 }
322322 };
359359 Type *getElementType() const { return ContainedType; }
360360
361361 /// Methods for support type inquiry through isa, cast, and dyn_cast.
362 static inline bool classof(const Type *T) {
362 static bool classof(const Type *T) {
363363 return T->getTypeID() == ArrayTyID || T->getTypeID() == VectorTyID;
364364 }
365365 };
379379 static bool isValidElementType(Type *ElemTy);
380380
381381 /// Methods for support type inquiry through isa, cast, and dyn_cast.
382 static inline bool classof(const Type *T) {
382 static bool classof(const Type *T) {
383383 return T->getTypeID() == ArrayTyID;
384384 }
385385 };
453453 }
454454
455455 /// Methods for support type inquiry through isa, cast, and dyn_cast.
456 static inline bool classof(const Type *T) {
456 static bool classof(const Type *T) {
457457 return T->getTypeID() == VectorTyID;
458458 }
459459 };
494494 inline unsigned getAddressSpace() const { return getSubclassData(); }
495495
496496 /// Implement support type inquiry through isa, cast, and dyn_cast.
497 static inline bool classof(const Type *T) {
497 static bool classof(const Type *T) {
498498 return T->getTypeID() == PointerTyID;
499499 }
500500 };
670670 void viewCFGOnly() const;
671671
672672 /// Methods for support type inquiry through isa, cast, and dyn_cast:
673 static inline bool classof(const Value *V) {
673 static bool classof(const Value *V) {
674674 return V->getValueID() == Value::FunctionVal;
675675 }
676676
8787 }
8888
8989 // Methods for support type inquiry through isa, cast, and dyn_cast:
90 static inline bool classof(const Value *V) {
90 static bool classof(const Value *V) {
9191 return V->getValueID() == Value::GlobalAliasVal;
9292 }
9393 };
6969 }
7070
7171 // Methods for support type inquiry through isa, cast, and dyn_cast:
72 static inline bool classof(const Value *V) {
72 static bool classof(const Value *V) {
7373 return V->getValueID() == Value::GlobalIFuncVal;
7474 }
7575 };
7474 }
7575
7676 // Methods for support type inquiry through isa, cast, and dyn_cast:
77 static inline bool classof(const Value *V) {
77 static bool classof(const Value *V) {
7878 return V->getValueID() == Value::GlobalAliasVal ||
7979 V->getValueID() == Value::GlobalIFuncVal;
8080 }
154154
155155 public:
156156 // Methods for support type inquiry through isa, cast, and dyn_cast:
157 static inline bool classof(const Value *V) {
157 static bool classof(const Value *V) {
158158 return V->getValueID() == Value::FunctionVal ||
159159 V->getValueID() == Value::GlobalVariableVal;
160160 }
240240 }
241241
242242 // Methods for support type inquiry through isa, cast, and dyn_cast:
243 static inline bool classof(const Value *V) {
243 static bool classof(const Value *V) {
244244 return V->getValueID() == Value::GlobalVariableVal;
245245 }
246246 };
182182 }
183183
184184 // Methods for support type inquiry through isa, cast, and dyn_cast:
185 static inline bool classof(const Value *V) {
185 static bool classof(const Value *V) {
186186 return V->getValueID() == Value::InlineAsmVal;
187187 }
188188
7272 void setSuccessor(unsigned idx, BasicBlock *B);
7373
7474 // Methods for support type inquiry through isa, cast, and dyn_cast:
75 static inline bool classof(const Instruction *I) {
75 static bool classof(const Instruction *I) {
7676 return I->isTerminator();
7777 }
78 static inline bool classof(const Value *V) {
78 static bool classof(const Value *V) {
7979 return isa(V) && classof(cast(V));
8080 }
8181
297297 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
298298
299299 // Methods for support type inquiry through isa, cast, and dyn_cast:
300 static inline bool classof(const Instruction *I) {
300 static bool classof(const Instruction *I) {
301301 return I->getOpcode() == Instruction::Alloca ||
302302 I->getOpcode() == Instruction::Load ||
303303 I->getOpcode() == Instruction::VAArg ||
304304 I->getOpcode() == Instruction::ExtractValue ||
305305 (I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd);
306306 }
307 static inline bool classof(const Value *V) {
307 static bool classof(const Value *V) {
308308 return isa(V) && classof(cast(V));
309309 }
310310 };
531531 bool swapOperands();
532532
533533 // Methods for support type inquiry through isa, cast, and dyn_cast:
534 static inline bool classof(const Instruction *I) {
534 static bool classof(const Instruction *I) {
535535 return I->isBinaryOp();
536536 }
537 static inline bool classof(const Value *V) {
537 static bool classof(const Value *V) {
538538 return isa(V) && classof(cast(V));
539539 }
540540 };
832832 static bool castIsValid(Instruction::CastOps op, Value *S, Type *DstTy);
833833
834834 /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
835 static inline bool classof(const Instruction *I) {
835 static bool classof(const Instruction *I) {
836836 return I->isCast();
837837 }
838 static inline bool classof(const Value *V) {
838 static bool classof(const Value *V) {
839839 return isa(V) && classof(cast(V));
840840 }
841841 };
10611061 static bool isImpliedFalseByMatchingCmp(Predicate Pred1, Predicate Pred2);
10621062
10631063 /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
1064 static inline bool classof(const Instruction *I) {
1064 static bool classof(const Instruction *I) {
10651065 return I->getOpcode() == Instruction::ICmp ||
10661066 I->getOpcode() == Instruction::FCmp;
10671067 }
1068 static inline bool classof(const Value *V) {
1068 static bool classof(const Value *V) {
10691069 return isa(V) && classof(cast(V));
10701070 }
10711071
11511151 }
11521152
11531153 // Methods for support type inquiry through isa, cast, and dyn_cast:
1154 static inline bool classof(const Instruction *I) { return I->isFuncletPad(); }
1155 static inline bool classof(const Value *V) {
1154 static bool classof(const Instruction *I) { return I->isFuncletPad(); }
1155 static bool classof(const Value *V) {
11561156 return isa(V) && classof(cast(V));
11571157 }
11581158 };
555555
556556
557557 /// Methods for support type inquiry through isa, cast, and dyn_cast:
558 static inline bool classof(const Value *V) {
558 static bool classof(const Value *V) {
559559 return V->getValueID() >= Value::InstructionVal;
560560 }
561561
144144 }
145145
146146 // Methods for support type inquiry through isa, cast, and dyn_cast:
147 static inline bool classof(const Instruction *I) {
147 static bool classof(const Instruction *I) {
148148 return (I->getOpcode() == Instruction::Alloca);
149149 }
150 static inline bool classof(const Value *V) {
150 static bool classof(const Value *V) {
151151 return isa(V) && classof(cast(V));
152152 }
153153
283283 }
284284
285285 // Methods for support type inquiry through isa, cast, and dyn_cast:
286 static inline bool classof(const Instruction *I) {
286 static bool classof(const Instruction *I) {
287287 return I->getOpcode() == Instruction::Load;
288288 }
289 static inline bool classof(const Value *V) {
289 static bool classof(const Value *V) {
290290 return isa(V) && classof(cast(V));
291291 }
292292
407407 }
408408
409409 // Methods for support type inquiry through isa, cast, and dyn_cast:
410 static inline bool classof(const Instruction *I) {
410 static bool classof(const Instruction *I) {
411411 return I->getOpcode() == Instruction::Store;
412412 }
413 static inline bool classof(const Value *V) {
413 static bool classof(const Value *V) {
414414 return isa(V) && classof(cast(V));
415415 }
416416
482482 }
483483
484484 // Methods for support type inquiry through isa, cast, and dyn_cast:
485 static inline bool classof(const Instruction *I) {
485 static bool classof(const Instruction *I) {
486486 return I->getOpcode() == Instruction::Fence;
487487 }
488 static inline bool classof(const Value *V) {
488 static bool classof(const Value *V) {
489489 return isa(V) && classof(cast(V));
490490 }
491491
638638 }
639639
640640 // Methods for support type inquiry through isa, cast, and dyn_cast:
641 static inline bool classof(const Instruction *I) {
641 static bool classof(const Instruction *I) {
642642 return I->getOpcode() == Instruction::AtomicCmpXchg;
643643 }
644 static inline bool classof(const Value *V) {
644 static bool classof(const Value *V) {
645645 return isa(V) && classof(cast(V));
646646 }
647647
787787 }
788788
789789 // Methods for support type inquiry through isa, cast, and dyn_cast:
790 static inline bool classof(const Instruction *I) {
790 static bool classof(const Instruction *I) {
791791 return I->getOpcode() == Instruction::AtomicRMW;
792792 }
793 static inline bool classof(const Value *V) {
793 static bool classof(const Value *V) {
794794 return isa(V) && classof(cast(V));
795795 }
796796
10471047 bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const;
10481048
10491049 // Methods for support type inquiry through isa, cast, and dyn_cast:
1050 static inline bool classof(const Instruction *I) {
1050 static bool classof(const Instruction *I) {
10511051 return (I->getOpcode() == Instruction::GetElementPtr);
10521052 }
1053 static inline bool classof(const Value *V) {
1053 static bool classof(const Value *V) {
10541054 return isa(V) && classof(cast(V));
10551055 }
10561056 };
12251225 }
12261226
12271227 // Methods for support type inquiry through isa, cast, and dyn_cast:
1228 static inline bool classof(const Instruction *I) {
1228 static bool classof(const Instruction *I) {
12291229 return I->getOpcode() == Instruction::ICmp;
12301230 }
1231 static inline bool classof(const Value *V) {
1231 static bool classof(const Value *V) {
12321232 return isa(V) && classof(cast(V));
12331233 }
12341234 };
13331333 }
13341334
13351335 /// Methods for support type inquiry through isa, cast, and dyn_cast:
1336 static inline bool classof(const Instruction *I) {
1336 static bool classof(const Instruction *I) {
13371337 return I->getOpcode() == Instruction::FCmp;
13381338 }
1339 static inline bool classof(const Value *V) {
1339 static bool classof(const Value *V) {
13401340 return isa(V) && classof(cast(V));
13411341 }
13421342 };
18721872 }
18731873
18741874 // Methods for support type inquiry through isa, cast, and dyn_cast:
1875 static inline bool classof(const Instruction *I) {
1875 static bool classof(const Instruction *I) {
18761876 return I->getOpcode() == Instruction::Call;
18771877 }
1878 static inline bool classof(const Value *V) {
1878 static bool classof(const Value *V) {
18791879 return isa(V) && classof(cast(V));
18801880 }
18811881
20102010 }
20112011
20122012 // Methods for support type inquiry through isa, cast, and dyn_cast:
2013 static inline bool classof(const Instruction *I) {
2013 static bool classof(const Instruction *I) {
20142014 return I->getOpcode() == Instruction::Select;
20152015 }
2016 static inline bool classof(const Value *V) {
2016 static bool classof(const Value *V) {
20172017 return isa(V) && classof(cast(V));
20182018 }
20192019 };
20562056 static unsigned getPointerOperandIndex() { return 0U; }
20572057
20582058 // Methods for support type inquiry through isa, cast, and dyn_cast:
2059 static inline bool classof(const Instruction *I) {
2059 static bool classof(const Instruction *I) {
20602060 return I->getOpcode() == VAArg;
20612061 }
2062 static inline bool classof(const Value *V) {
2062 static bool classof(const Value *V) {
20632063 return isa(V) && classof(cast(V));
20642064 }
20652065 };
21132113 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
21142114
21152115 // Methods for support type inquiry through isa, cast, and dyn_cast:
2116 static inline bool classof(const Instruction *I) {
2116 static bool classof(const Instruction *I) {
21172117 return I->getOpcode() == Instruction::ExtractElement;
21182118 }
2119 static inline bool classof(const Value *V) {
2119 static bool classof(const Value *V) {
21202120 return isa(V) && classof(cast(V));
21212121 }
21222122 };
21762176 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
21772177
21782178 // Methods for support type inquiry through isa, cast, and dyn_cast:
2179 static inline bool classof(const Instruction *I) {
2179 static bool classof(const Instruction *I) {
21802180 return I->getOpcode() == Instruction::InsertElement;
21812181 }
2182 static inline bool classof(const Value *V) {
2182 static bool classof(const Value *V) {
21832183 return isa(V) && classof(cast(V));
21842184 }
21852185 };
22752275 }
22762276
22772277 // Methods for support type inquiry through isa, cast, and dyn_cast:
2278 static inline bool classof(const Instruction *I) {
2278 static bool classof(const Instruction *I) {
22792279 return I->getOpcode() == Instruction::ShuffleVector;
22802280 }
2281 static inline bool classof(const Value *V) {
2281 static bool classof(const Value *V) {
22822282 return isa(V) && classof(cast(V));
22832283 }
22842284 };
23752375 }
23762376
23772377 // Methods for support type inquiry through isa, cast, and dyn_cast:
2378 static inline bool classof(const Instruction *I) {
2378 static bool classof(const Instruction *I) {
23792379 return I->getOpcode() == Instruction::ExtractValue;
23802380 }
2381 static inline bool classof(const Value *V) {
2381 static bool classof(const Value *V) {
23822382 return isa(V) && classof(cast(V));
23832383 }
23842384 };
25062506 }
25072507
25082508 // Methods for support type inquiry through isa, cast, and dyn_cast:
2509 static inline bool classof(const Instruction *I) {
2509 static bool classof(const Instruction *I) {
25102510 return I->getOpcode() == Instruction::InsertValue;
25112511 }
2512 static inline bool classof(const Value *V) {
2512 static bool classof(const Value *V) {
25132513 return isa(V) && classof(cast(V));
25142514 }
25152515 };
27462746 bool hasConstantOrUndefValue() const;
27472747
27482748 /// Methods for support type inquiry through isa, cast, and dyn_cast:
2749 static inline bool classof(const Instruction *I) {
2749 static bool classof(const Instruction *I) {
27502750 return I->getOpcode() == Instruction::PHI;
27512751 }
2752 static inline bool classof(const Value *V) {
2752 static bool classof(const Value *V) {
27532753 return isa(V) && classof(cast(V));
27542754 }
27552755
28552855 void reserveClauses(unsigned Size) { growOperands(Size); }
28562856
28572857 // Methods for support type inquiry through isa, cast, and dyn_cast:
2858 static inline bool classof(const Instruction *I) {
2858 static bool classof(const Instruction *I) {
28592859 return I->getOpcode() == Instruction::LandingPad;
28602860 }
2861 static inline bool classof(const Value *V) {
2861 static bool classof(const Value *V) {
28622862 return isa(V) && classof(cast(V));
28632863 }
28642864 };
29292929 unsigned getNumSuccessors() const { return 0; }
29302930
29312931 // Methods for support type inquiry through isa, cast, and dyn_cast:
2932 static inline bool classof(const Instruction *I) {
2932 static bool classof(const Instruction *I) {
29332933 return (I->getOpcode() == Instruction::Ret);
29342934 }
2935 static inline bool classof(const Value *V) {
2935 static bool classof(const Value *V) {
29362936 return isa(V) && classof(cast(V));
29372937 }
29382938
30453045 void swapSuccessors();
30463046
30473047 // Methods for support type inquiry through isa, cast, and dyn_cast:
3048 static inline bool classof(const Instruction *I) {
3048 static bool classof(const Instruction *I) {
30493049 return (I->getOpcode() == Instruction::Br);
30503050 }
3051 static inline bool classof(const Value *V) {
3051 static bool classof(const Value *V) {
30523052 return isa(V) && classof(cast(V));
30533053 }
30543054 };
34023402 }
34033403
34043404 // Methods for support type inquiry through isa, cast, and dyn_cast:
3405 static inline bool classof(const Instruction *I) {
3405 static bool classof(const Instruction *I) {
34063406 return I->getOpcode() == Instruction::Switch;
34073407 }
3408 static inline bool classof(const Value *V) {
3408 static bool classof(const Value *V) {
34093409 return isa(V) && classof(cast(V));
34103410 }
34113411 };
35003500 }
35013501
35023502 // Methods for support type inquiry through isa, cast, and dyn_cast:
3503 static inline bool classof(const Instruction *I) {
3503 static bool classof(const Instruction *I) {
35043504 return I->getOpcode() == Instruction::IndirectBr;
35053505 }
3506 static inline bool classof(const Value *V) {
3506 static bool classof(const Value *V) {
35073507 return isa(V) && classof(cast(V));
35083508 }
35093509 };
39763976 unsigned getNumSuccessors() const { return 2; }
39773977
39783978 // Methods for support type inquiry through isa, cast, and dyn_cast:
3979 static inline bool classof(const Instruction *I) {
3979 static bool classof(const Instruction *I) {
39803980 return (I->getOpcode() == Instruction::Invoke);
39813981 }
3982 static inline bool classof(const Value *V) {
3982 static bool classof(const Value *V) {
39833983 return isa(V) && classof(cast(V));
39843984 }
39853985
40714071 unsigned getNumSuccessors() const { return 0; }
40724072
40734073 // Methods for support type inquiry through isa, cast, and dyn_cast:
4074 static inline bool classof(const Instruction *I) {
4074 static bool classof(const Instruction *I) {
40754075 return I->getOpcode() == Instruction::Resume;
40764076 }
4077 static inline bool classof(const Value *V) {
4077 static bool classof(const Value *V) {
40784078 return isa(V) && classof(cast(V));
40794079 }
40804080
42594259 }
42604260
42614261 // Methods for support type inquiry through isa, cast, and dyn_cast:
4262 static inline bool classof(const Instruction *I) {
4262 static bool classof(const Instruction *I) {
42634263 return I->getOpcode() == Instruction::CatchSwitch;
42644264 }
4265 static inline bool classof(const Value *V) {
4265 static bool classof(const Value *V) {
42664266 return isa(V) && classof(cast(V));
42674267 }
42684268 };
43054305 }
43064306
43074307 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4308 static inline bool classof(const Instruction *I) {
4308 static bool classof(const Instruction *I) {
43094309 return I->getOpcode() == Instruction::CleanupPad;
43104310 }
4311 static inline bool classof(const Value *V) {
4311 static bool classof(const Value *V) {
43124312 return isa(V) && classof(cast(V));
43134313 }
43144314 };
43554355 }
43564356
43574357 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4358 static inline bool classof(const Instruction *I) {
4358 static bool classof(const Instruction *I) {
43594359 return I->getOpcode() == Instruction::CatchPad;
43604360 }
4361 static inline bool classof(const Value *V) {
4361 static bool classof(const Value *V) {
43624362 return isa(V) && classof(cast(V));
43634363 }
43644364 };
44194419 }
44204420
44214421 // Methods for support type inquiry through isa, cast, and dyn_cast:
4422 static inline bool classof(const Instruction *I) {
4422 static bool classof(const Instruction *I) {
44234423 return (I->getOpcode() == Instruction::CatchRet);
44244424 }
4425 static inline bool classof(const Value *V) {
4425 static bool classof(const Value *V) {
44264426 return isa(V) && classof(cast(V));
44274427 }
44284428
45154515 }
45164516
45174517 // Methods for support type inquiry through isa, cast, and dyn_cast:
4518 static inline bool classof(const Instruction *I) {
4518 static bool classof(const Instruction *I) {
45194519 return (I->getOpcode() == Instruction::CleanupRet);
45204520 }
4521 static inline bool classof(const Value *V) {
4521 static bool classof(const Value *V) {
45224522 return isa(V) && classof(cast(V));
45234523 }
45244524
45764576 unsigned getNumSuccessors() const { return 0; }
45774577
45784578 // Methods for support type inquiry through isa, cast, and dyn_cast:
4579 static inline bool classof(const Instruction *I) {
4579 static bool classof(const Instruction *I) {
45804580 return I->getOpcode() == Instruction::Unreachable;
45814581 }
4582 static inline bool classof(const Value *V) {
4582 static bool classof(const Value *V) {
45834583 return isa(V) && classof(cast(V));
45844584 }
45854585
46264626 );
46274627
46284628 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4629 static inline bool classof(const Instruction *I) {
4629 static bool classof(const Instruction *I) {
46304630 return I->getOpcode() == Trunc;
46314631 }
4632 static inline bool classof(const Value *V) {
4632 static bool classof(const Value *V) {
46334633 return isa(V) && classof(cast(V));
46344634 }
46354635 };
46654665 );
46664666
46674667 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4668 static inline bool classof(const Instruction *I) {
4668 static bool classof(const Instruction *I) {
46694669 return I->getOpcode() == ZExt;
46704670 }
4671 static inline bool classof(const Value *V) {
4671 static bool classof(const Value *V) {
46724672 return isa(V) && classof(cast(V));
46734673 }
46744674 };
47044704 );
47054705
47064706 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4707 static inline bool classof(const Instruction *I) {
4707 static bool classof(const Instruction *I) {
47084708 return I->getOpcode() == SExt;
47094709 }
4710 static inline bool classof(const Value *V) {
4710 static bool classof(const Value *V) {
47114711 return isa(V) && classof(cast(V));
47124712 }
47134713 };
47434743 );
47444744
47454745 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4746 static inline bool classof(const Instruction *I) {
4746 static bool classof(const Instruction *I) {
47474747 return I->getOpcode() == FPTrunc;
47484748 }
4749 static inline bool classof(const Value *V) {
4749 static bool classof(const Value *V) {
47504750 return isa(V) && classof(cast(V));
47514751 }
47524752 };
47824782 );
47834783
47844784 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4785 static inline bool classof(const Instruction *I) {
4785 static bool classof(const Instruction *I) {
47864786 return I->getOpcode() == FPExt;
47874787 }
4788 static inline bool classof(const Value *V) {
4788 static bool classof(const Value *V) {
47894789 return isa(V) && classof(cast(V));
47904790 }
47914791 };
48214821 );
48224822
48234823 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4824 static inline bool classof(const Instruction *I) {
4824 static bool classof(const Instruction *I) {
48254825 return I->getOpcode() == UIToFP;
48264826 }
4827 static inline bool classof(const Value *V) {
4827 static bool classof(const Value *V) {
48284828 return isa(V) && classof(cast(V));
48294829 }
48304830 };
48604860 );
48614861
48624862 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4863 static inline bool classof(const Instruction *I) {
4863 static bool classof(const Instruction *I) {
48644864 return I->getOpcode() == SIToFP;
48654865 }
4866 static inline bool classof(const Value *V) {
4866 static bool classof(const Value *V) {
48674867 return isa(V) && classof(cast(V));
48684868 }
48694869 };
48994899 );
49004900
49014901 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4902 static inline bool classof(const Instruction *I) {
4902 static bool classof(const Instruction *I) {
49034903 return I->getOpcode() == FPToUI;
49044904 }
4905 static inline bool classof(const Value *V) {
4905 static bool classof(const Value *V) {
49064906 return isa(V) && classof(cast(V));
49074907 }
49084908 };
49384938 );
49394939
49404940 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4941 static inline bool classof(const Instruction *I) {
4941 static bool classof(const Instruction *I) {
49424942 return I->getOpcode() == FPToSI;
49434943 }
4944 static inline bool classof(const Value *V) {
4944 static bool classof(const Value *V) {
49454945 return isa(V) && classof(cast(V));
49464946 }
49474947 };
49814981 }
49824982
49834983 // Methods for support type inquiry through isa, cast, and dyn_cast:
4984 static inline bool classof(const Instruction *I) {
4984 static bool classof(const Instruction *I) {
49854985 return I->getOpcode() == IntToPtr;
49864986 }
4987 static inline bool classof(const Value *V) {
4987 static bool classof(const Value *V) {
49884988 return isa(V) && classof(cast(V));
49894989 }
49904990 };
50325032 }
50335033
50345034 // Methods for support type inquiry through isa, cast, and dyn_cast:
5035 static inline bool classof(const Instruction *I) {
5035 static bool classof(const Instruction *I) {
50365036 return I->getOpcode() == PtrToInt;
50375037 }
5038 static inline bool classof(const Value *V) {
5038 static bool classof(const Value *V) {
50395039 return isa(V) && classof(cast(V));
50405040 }
50415041 };
50715071 );
50725072
50735073 // Methods for support type inquiry through isa, cast, and dyn_cast:
5074 static inline bool classof(const Instruction *I) {
5074 static bool classof(const Instruction *I) {
50755075 return I->getOpcode() == BitCast;
50765076 }
5077 static inline bool classof(const Value *V) {
5077 static bool classof(const Value *V) {
50785078 return isa(V) && classof(cast(V));
50795079 }
50805080 };
51115111 );
51125112
51135113 // Methods for support type inquiry through isa, cast, and dyn_cast:
5114 static inline bool classof(const Instruction *I) {
5114 static bool classof(const Instruction *I) {
51155115 return I->getOpcode() == AddrSpaceCast;
51165116 }
5117 static inline bool classof(const Value *V) {
5117 static bool classof(const Value *V) {
51185118 return isa(V) && classof(cast(V));
51195119 }
51205120
5252 }
5353
5454 // Methods for support type inquiry through isa, cast, and dyn_cast:
55 static inline bool classof(const CallInst *I) {
55 static bool classof(const CallInst *I) {
5656 if (const Function *CF = I->getCalledFunction())
5757 return CF->isIntrinsic();
5858 return false;
5959 }
60 static inline bool classof(const Value *V) {
60 static bool classof(const Value *V) {
6161 return isa(V) && classof(cast(V));
6262 }
6363 };
7171 Value *getVariableLocation(bool AllowNullOp = true) const;
7272
7373 // Methods for support type inquiry through isa, cast, and dyn_cast:
74 static inline bool classof(const IntrinsicInst *I) {
74 static bool classof(const IntrinsicInst *I) {
7575 switch (I->getIntrinsicID()) {
7676 case Intrinsic::dbg_declare:
7777 case Intrinsic::dbg_value:
7979 default: return false;
8080 }
8181 }
82 static inline bool classof(const Value *V) {
82 static bool classof(const Value *V) {
8383 return isa(V) && classof(cast(V));
8484 }
8585 };
106106 }
107107
108108 // Methods for support type inquiry through isa, cast, and dyn_cast:
109 static inline bool classof(const IntrinsicInst *I) {
109 static bool classof(const IntrinsicInst *I) {
110110 return I->getIntrinsicID() == Intrinsic::dbg_declare;
111111 }
112 static inline bool classof(const Value *V) {
112 static bool classof(const Value *V) {
113113 return isa(V) && classof(cast(V));
114114 }
115115 };
143143 }
144144
145145 // Methods for support type inquiry through isa, cast, and dyn_cast:
146 static inline bool classof(const IntrinsicInst *I) {
146 static bool classof(const IntrinsicInst *I) {
147147 return I->getIntrinsicID() == Intrinsic::dbg_value;
148148 }
149 static inline bool classof(const Value *V) {
149 static bool classof(const Value *V) {
150150 return isa(V) && classof(cast(V));
151151 }
152152 };
175175 ExceptionBehavior getExceptionBehavior() const;
176176
177177 // Methods for support type inquiry through isa, cast, and dyn_cast:
178 static inline bool classof(const IntrinsicInst *I) {
178 static bool classof(const IntrinsicInst *I) {
179179 switch (I->getIntrinsicID()) {
180180 case Intrinsic::experimental_constrained_fadd:
181181 case Intrinsic::experimental_constrained_fsub:
198198 default: return false;
199199 }
200200 }
201 static inline bool classof(const Value *V) {
201 static bool classof(const Value *V) {
202202 return isa(V) && classof(cast(V));
203203 }
204204 };
287287 setArgOperand(ARG_ELEMENTSIZE, V);
288288 }
289289
290 static inline bool classof(const IntrinsicInst *I) {
290 static bool classof(const IntrinsicInst *I) {
291291 return I->getIntrinsicID() == Intrinsic::memcpy_element_unordered_atomic;
292292 }
293 static inline bool classof(const Value *V) {
293 static bool classof(const Value *V) {
294294 return isa(V) && classof(cast(V));
295295 }
296296 };
357357 }
358358
359359 // Methods for support type inquiry through isa, cast, and dyn_cast:
360 static inline bool classof(const IntrinsicInst *I) {
360 static bool classof(const IntrinsicInst *I) {
361361 switch (I->getIntrinsicID()) {
362362 case Intrinsic::memcpy:
363363 case Intrinsic::memmove:
366366 default: return false;
367367 }
368368 }
369 static inline bool classof(const Value *V) {
369 static bool classof(const Value *V) {
370370 return isa(V) && classof(cast(V));
371371 }
372372 };
386386 }
387387
388388 // Methods for support type inquiry through isa, cast, and dyn_cast:
389 static inline bool classof(const IntrinsicInst *I) {
389 static bool classof(const IntrinsicInst *I) {
390390 return I->getIntrinsicID() == Intrinsic::memset;
391391 }
392 static inline bool classof(const Value *V) {
392 static bool classof(const Value *V) {
393393 return isa(V) && classof(cast(V));
394394 }
395395 };
418418 }
419419
420420 // Methods for support type inquiry through isa, cast, and dyn_cast:
421 static inline bool classof(const IntrinsicInst *I) {
421 static bool classof(const IntrinsicInst *I) {
422422 return I->getIntrinsicID() == Intrinsic::memcpy ||
423423 I->getIntrinsicID() == Intrinsic::memmove;
424424 }
425 static inline bool classof(const Value *V) {
425 static bool classof(const Value *V) {
426426 return isa(V) && classof(cast(V));
427427 }
428428 };
431431 class MemCpyInst : public MemTransferInst {
432432 public:
433433 // Methods for support type inquiry through isa, cast, and dyn_cast:
434 static inline bool classof(const IntrinsicInst *I) {
434 static bool classof(const IntrinsicInst *I) {
435435 return I->getIntrinsicID() == Intrinsic::memcpy;
436436 }
437 static inline bool classof(const Value *V) {
437 static bool classof(const Value *V) {
438438 return isa(V) && classof(cast(V));
439439 }
440440 };
443443 class MemMoveInst : public MemTransferInst {
444444 public:
445445 // Methods for support type inquiry through isa, cast, and dyn_cast:
446 static inline bool classof(const IntrinsicInst *I) {
446 static bool classof(const IntrinsicInst *I) {
447447 return I->getIntrinsicID() == Intrinsic::memmove;
448448 }
449 static inline bool classof(const Value *V) {
449 static bool classof(const Value *V) {
450450 return isa(V) && classof(cast(V));
451451 }
452452 };
454454 /// This represents the llvm.va_start intrinsic.
455455 class VAStartInst : public IntrinsicInst {
456456 public:
457 static inline bool classof(const IntrinsicInst *I) {
457 static bool classof(const IntrinsicInst *I) {
458458 return I->getIntrinsicID() == Intrinsic::vastart;
459459 }
460 static inline bool classof(const Value *V) {
460 static bool classof(const Value *V) {
461461 return isa(V) && classof(cast(V));
462462 }
463463
467467 /// This represents the llvm.va_end intrinsic.
468468 class VAEndInst : public IntrinsicInst {
469469 public:
470 static inline bool classof(const IntrinsicInst *I) {
470 static bool classof(const IntrinsicInst *I) {
471471 return I->getIntrinsicID() == Intrinsic::vaend;
472472 }
473 static inline bool classof(const Value *V) {
473 static bool classof(const Value *V) {
474474 return isa(V) && classof(cast(V));
475475 }
476476
480480 /// This represents the llvm.va_copy intrinsic.
481481 class VACopyInst : public IntrinsicInst {
482482 public:
483 static inline bool classof(const IntrinsicInst *I) {
483 static bool classof(const IntrinsicInst *I) {
484484 return I->getIntrinsicID() == Intrinsic::vacopy;
485485 }
486 static inline bool classof(const Value *V) {
486 static bool classof(const Value *V) {
487487 return isa(V) && classof(cast(V));
488488 }
489489
494494 /// This represents the llvm.instrprof_increment intrinsic.
495495 class InstrProfIncrementInst : public IntrinsicInst {
496496 public:
497 static inline bool classof(const IntrinsicInst *I) {
497 static bool classof(const IntrinsicInst *I) {
498498 return I->getIntrinsicID() == Intrinsic::instrprof_increment;
499499 }
500 static inline bool classof(const Value *V) {
500 static bool classof(const Value *V) {
501501 return isa(V) && classof(cast(V));
502502 }
503503
523523
524524 class InstrProfIncrementInstStep : public InstrProfIncrementInst {
525525 public:
526 static inline bool classof(const IntrinsicInst *I) {
526 static bool classof(const IntrinsicInst *I) {
527527 return I->getIntrinsicID() == Intrinsic::instrprof_increment_step;
528528 }
529 static inline bool classof(const Value *V) {
529 static bool classof(const Value *V) {
530530 return isa(V) && classof(cast(V));
531531 }
532532 };
534534 /// This represents the llvm.instrprof_value_profile intrinsic.
535535 class InstrProfValueProfileInst : public IntrinsicInst {
536536 public:
537 static inline bool classof(const IntrinsicInst *I) {
537 static bool classof(const IntrinsicInst *I) {
538538 return I->getIntrinsicID() == Intrinsic::instrprof_value_profile;
539539 }
540 static inline bool classof(const Value *V) {
540 static bool classof(const Value *V) {
541541 return isa(V) && classof(cast(V));
542542 }
543543
5353 return Instruction::UserOp1;
5454 }
5555
56 static inline bool classof(const Instruction *) { return true; }
57 static inline bool classof(const ConstantExpr *) { return true; }
58 static inline bool classof(const Value *V) {
56 static bool classof(const Instruction *) { return true; }
57 static bool classof(const ConstantExpr *) { return true; }
58 static bool classof(const Value *V) {
5959 return isa(V) || isa(V);
6060 }
6161 };
9696 return (SubclassOptionalData & NoSignedWrap) != 0;
9797 }
9898
99 static inline bool classof(const Instruction *I) {
99 static bool classof(const Instruction *I) {
100100 return I->getOpcode() == Instruction::Add ||
101101 I->getOpcode() == Instruction::Sub ||
102102 I->getOpcode() == Instruction::Mul ||
103103 I->getOpcode() == Instruction::Shl;
104104 }
105 static inline bool classof(const ConstantExpr *CE) {
105 static bool classof(const ConstantExpr *CE) {
106106 return CE->getOpcode() == Instruction::Add ||
107107 CE->getOpcode() == Instruction::Sub ||
108108 CE->getOpcode() == Instruction::Mul ||
109109 CE->getOpcode() == Instruction::Shl;
110110 }
111 static inline bool classof(const Value *V) {
111 static bool classof(const Value *V) {
112112 return (isa(V) && classof(cast(V))) ||
113113 (isa(V) && classof(cast(V)));
114114 }
143143 OpC == Instruction::LShr;
144144 }
145145
146 static inline bool classof(const ConstantExpr *CE) {
146 static bool classof(const ConstantExpr *CE) {
147147 return isPossiblyExactOpcode(CE->getOpcode());
148148 }
149 static inline bool classof(const Instruction *I) {
149 static bool classof(const Instruction *I) {
150150 return isPossiblyExactOpcode(I->getOpcode());
151151 }
152 static inline bool classof(const Value *V) {
152 static bool classof(const Value *V) {
153153 return (isa(V) && classof(cast(V))) ||
154154 (isa(V) && classof(cast(V)));
155155 }
323323 /// precision.
324324 float getFPAccuracy() const;
325325
326 static inline bool classof(const Instruction *I) {
326 static bool classof(const Instruction *I) {
327327 return I->getType()->isFPOrFPVectorTy() ||
328328 I->getOpcode() == Instruction::FCmp;
329329 }
330330
331 static inline bool classof(const ConstantExpr *CE) {
331 static bool classof(const ConstantExpr *CE) {
332332 return CE->getType()->isFPOrFPVectorTy() ||
333333 CE->getOpcode() == Instruction::FCmp;
334334 }
335335
336 static inline bool classof(const Value *V) {
336 static bool classof(const Value *V) {
337337 return (isa(V) && classof(cast(V))) ||
338338 (isa(V) && classof(cast(V)));
339339 }
343343 template
344344 class ConcreteOperator : public SuperClass {
345345 public:
346 static inline bool classof(const Instruction *I) {
346 static bool classof(const Instruction *I) {
347347 return I->getOpcode() == Opc;
348348 }
349 static inline bool classof(const ConstantExpr *CE) {
349 static bool classof(const ConstantExpr *CE) {
350350 return CE->getOpcode() == Opc;
351351 }
352 static inline bool classof(const Value *V) {
352 static bool classof(const Value *V) {
353353 return (isa(V) && classof(cast(V))) ||
354354 (isa(V) && classof(cast(V)));
355355 }
328328 /// Currently, the only projections available are gc.result and gc.relocate.
329329 class GCProjectionInst : public IntrinsicInst {
330330 public:
331 static inline bool classof(const IntrinsicInst *I) {
331 static bool classof(const IntrinsicInst *I) {
332332 return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate ||
333333 I->getIntrinsicID() == Intrinsic::experimental_gc_result;
334334 }
335335
336 static inline bool classof(const Value *V) {
336 static bool classof(const Value *V) {
337337 return isa(V) && classof(cast(V));
338338 }
339339
372372 /// Represents calls to the gc.relocate intrinsic.
373373 class GCRelocateInst : public GCProjectionInst {
374374 public:
375 static inline bool classof(const IntrinsicInst *I) {
375 static bool classof(const IntrinsicInst *I) {
376376 return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate;
377377 }
378378
379 static inline bool classof(const Value *V) {
379 static bool classof(const Value *V) {
380380 return isa(V) && classof(cast(V));
381381 }
382382
407407 /// Represents calls to the gc.result intrinsic.
408408 class GCResultInst : public GCProjectionInst {
409409 public:
410 static inline bool classof(const IntrinsicInst *I) {
410 static bool classof(const IntrinsicInst *I) {
411411 return I->getIntrinsicID() == Intrinsic::experimental_gc_result;
412412 }
413413
414 static inline bool classof(const Value *V) {
414 static bool classof(const Value *V) {
415415 return isa(V) && classof(cast(V));
416416 }
417417 };
287287 void replaceUsesOfWith(Value *From, Value *To);
288288
289289 // Methods for support type inquiry through isa, cast, and dyn_cast:
290 static inline bool classof(const Value *V) {
290 static bool classof(const Value *V) {
291291 return isa(V) || isa(V);
292292 }
293293 };
252252 }
253253
254254 // Cast methods.
255 static inline bool classof(Binary const *v) {
255 static bool classof(Binary const *v) {
256256 return v->isArchive();
257257 }
258258
10251025 bool isRelocatableObject() const override;
10261026 bool is64() const { return PE32PlusHeader; }
10271027
1028 static inline bool classof(const Binary *v) { return v->isCOFF(); }
1028 static bool classof(const Binary *v) { return v->isCOFF(); }
10291029 };
10301030
10311031 // The iterator for the import directory table.
3232 COFFImportFile(MemoryBufferRef Source)
3333 : SymbolicFile(ID_COFFImportFile, Source) {}
3434
35 static inline bool classof(Binary const *V) { return V->isCOFFImportFile(); }
35 static bool classof(Binary const *V) { return V->isCOFFImportFile(); }
3636
3737 void moveSymbolNext(DataRefImpl &Symb) const override { ++Symb.p; }
3838
6969
7070 elf_symbol_iterator_range symbols() const;
7171
72 static inline bool classof(const Binary *v) { return v->isELF(); }
72 static bool classof(const Binary *v) { return v->isELF(); }
7373
7474 SubtargetFeatures getFeatures() const override;
7575
388388 const ELFFile *getELFFile() const { return &EF; }
389389
390390 bool isDyldType() const { return isDyldELFObject; }
391 static inline bool classof(const Binary *v) {
391 static bool classof(const Binary *v) {
392392 return v->getType() == getELFType(ELFT::TargetEndianness == support::little,
393393 ELFT::Is64Bits);
394394 }
4545
4646 StringRef getTargetTriple() const;
4747
48 static inline bool classof(const Binary *v) {
48 static bool classof(const Binary *v) {
4949 return v->isIR();
5050 }
5151
153153 uint32_t getNumberOfObjects() const { return NumberOfObjects; }
154154
155155 // Cast methods.
156 static inline bool classof(Binary const *V) {
156 static bool classof(Binary const *V) {
157157 return V->isMachOUniversalBinary();
158158 }
159159
312312 return createObjectFile(Object, llvm::file_magic::unknown);
313313 }
314314
315 static inline bool classof(const Binary *v) {
315 static bool classof(const Binary *v) {
316316 return v->isObject();
317317 }
318318
172172 static Expected>
173173 createSymbolicFile(StringRef ObjectPath);
174174
175 static inline bool classof(const Binary *v) {
175 static bool classof(const Binary *v) {
176176 return v->isSymbolic();
177177 }
178178 };
187187 NullNode(std::unique_ptr &D)
188188 : Node(NK_Null, D, StringRef(), StringRef()) {}
189189
190 static inline bool classof(const Node *N) { return N->getType() == NK_Null; }
190 static bool classof(const Node *N) { return N->getType() == NK_Null; }
191191 };
192192
193193 /// \brief A scalar node is an opaque datum that can be presented as a
219219 /// This happens with escaped characters and multi-line literals.
220220 StringRef getValue(SmallVectorImpl &Storage) const;
221221
222 static inline bool classof(const Node *N) {
222 static bool classof(const Node *N) {
223223 return N->getType() == NK_Scalar;
224224 }
225225
253253 /// \brief Gets the value of this node as a StringRef.
254254 StringRef getValue() const { return Value; }
255255
256 static inline bool classof(const Node *N) {
256 static bool classof(const Node *N) {
257257 return N->getType() == NK_BlockScalar;
258258 }
259259
295295 Val->skip();
296296 }
297297
298 static inline bool classof(const Node *N) {
298 static bool classof(const Node *N) {
299299 return N->getType() == NK_KeyValue;
300300 }
301301
418418
419419 void skip() override { yaml::skip(*this); }
420420
421 static inline bool classof(const Node *N) {
421 static bool classof(const Node *N) {
422422 return N->getType() == NK_Mapping;
423423 }
424424
475475
476476 void skip() override { yaml::skip(*this); }
477477
478 static inline bool classof(const Node *N) {
478 static bool classof(const Node *N) {
479479 return N->getType() == NK_Sequence;
480480 }
481481
501501 StringRef getName() const { return Name; }
502502 Node *getTarget();
503503
504 static inline bool classof(const Node *N) { return N->getType() == NK_Alias; }
504 static bool classof(const Node *N) { return N->getType() == NK_Alias; }
505505
506506 private:
507507 StringRef Name;
11471147 HNode(Node *n) : _node(n) { }
11481148 virtual ~HNode() = default;
11491149
1150 static inline bool classof(const HNode *) { return true; }
1150 static bool classof(const HNode *) { return true; }
11511151
11521152 Node *_node;
11531153 };
11581158 public:
11591159 EmptyHNode(Node *n) : HNode(n) { }
11601160
1161 static inline bool classof(const HNode *n) {
1162 return NullNode::classof(n->_node);
1163 }
1164
1165 static inline bool classof(const EmptyHNode *) { return true; }
1161 static bool classof(const HNode *n) { return NullNode::classof(n->_node); }
1162
1163 static bool classof(const EmptyHNode *) { return true; }
11661164 };
11671165
11681166 class ScalarHNode : public HNode {
11731171
11741172 StringRef value() const { return _value; }
11751173
1176 static inline bool classof(const HNode *n) {
1174 static bool classof(const HNode *n) {
11771175 return ScalarNode::classof(n->_node) ||
11781176 BlockScalarNode::classof(n->_node);
11791177 }
11801178
1181 static inline bool classof(const ScalarHNode *) { return true; }
1179 static bool classof(const ScalarHNode *) { return true; }
11821180
11831181 protected:
11841182 StringRef _value;
11901188 public:
11911189 MapHNode(Node *n) : HNode(n) { }
11921190
1193 static inline bool classof(const HNode *n) {
1191 static bool classof(const HNode *n) {
11941192 return MappingNode::classof(n->_node);
11951193 }
11961194
1197 static inline bool classof(const MapHNode *) { return true; }
1195 static bool classof(const MapHNode *) { return true; }
11981196
11991197 using NameToNode = StringMap>;
12001198
12081206 public:
12091207 SequenceHNode(Node *n) : HNode(n) { }
12101208
1211 static inline bool classof(const HNode *n) {
1209 static bool classof(const HNode *n) {
12121210 return SequenceNode::classof(n->_node);
12131211 }
12141212
1215 static inline bool classof(const SequenceHNode *) { return true; }
1213 static bool classof(const SequenceHNode *) { return true; }
12161214
12171215 std::vector> Entries;
12181216 };
113113 class PredicateWithCondition : public PredicateBase {
114114 public:
115115 Value *Condition;
116 static inline bool classof(const PredicateBase *PB) {
116 static bool classof(const PredicateBase *PB) {
117117 return PB->Type == PT_Assume || PB->Type == PT_Branch ||
118118 PB->Type == PT_Switch;
119119 }
133133 : PredicateWithCondition(PT_Assume, Op, Condition),
134134 AssumeInst(AssumeInst) {}
135135 PredicateAssume() = delete;
136 static inline bool classof(const PredicateBase *PB) {
136 static bool classof(const PredicateBase *PB) {
137137 return PB->Type == PT_Assume;
138138 }
139139 };
146146 BasicBlock *From;
147147 BasicBlock *To;
148148 PredicateWithEdge() = delete;
149 static inline bool classof(const PredicateBase *PB) {
149 static bool classof(const PredicateBase *PB) {
150150 return PB->Type == PT_Branch || PB->Type == PT_Switch;
151151 }
152152
166166 : PredicateWithEdge(PT_Branch, Op, BranchBB, SplitBB, Condition),
167167 TrueEdge(TakenEdge) {}
168168 PredicateBranch() = delete;
169 static inline bool classof(const PredicateBase *PB) {
169 static bool classof(const PredicateBase *PB) {
170170 return PB->Type == PT_Branch;
171171 }
172172 };
182182 SI->getCondition()),
183183 CaseValue(CaseValue), Switch(SI) {}
184184 PredicateSwitch() = delete;
185 static inline bool classof(const PredicateBase *PB) {
185 static bool classof(const PredicateBase *PB) {
186186 return PB->Type == PT_Switch;
187187 }
188188 };
7777 void updateSymbolAddress(const SymbolRef &SymRef, uint64_t Addr);
7878
7979 // Methods for type inquiry through isa, cast and dyn_cast
80 static inline bool classof(const Binary *v) {
80 static bool classof(const Binary *v) {
8181 return (isa>(v) &&
8282 classof(cast>(v)));
8383 }
84 static inline bool classof(const ELFObjectFile *v) {
84 static bool classof(const ELFObjectFile *v) {
8585 return v->isDyldType();
8686 }
8787 };
5757 }
5858
5959 // Methods to support type inquiry through isa, cast, and dyn_cast:
60 static inline bool classof(const IntrinsicInst *I) {
60 static bool classof(const IntrinsicInst *I) {
6161 return I->getIntrinsicID() == Intrinsic::coro_subfn_addr;
6262 }
63 static inline bool classof(const Value *V) {
63 static bool classof(const Value *V) {
6464 return isa(V) && classof(cast(V));
6565 }
6666 };
6969 class LLVM_LIBRARY_VISIBILITY CoroAllocInst : public IntrinsicInst {
7070 public:
7171 // Methods to support type inquiry through isa, cast, and dyn_cast:
72 static inline bool classof(const IntrinsicInst *I) {
72 static bool classof(const IntrinsicInst *I) {
7373 return I->getIntrinsicID() == Intrinsic::coro_alloc;
7474 }
75 static inline bool classof(const Value *V) {
75 static bool classof(const Value *V) {
7676 return isa(V) && classof(cast(V));
7777 }
7878 };
174174 }
175175
176176 // Methods to support type inquiry through isa, cast, and dyn_cast:
177 static inline bool classof(const IntrinsicInst *I) {
177 static bool classof(const IntrinsicInst *I) {
178178 return I->getIntrinsicID() == Intrinsic::coro_id;
179179 }
180 static inline bool classof(const Value *V) {
180 static bool classof(const Value *V) {
181181 return isa(V) && classof(cast(V));
182182 }
183183 };
186186 class LLVM_LIBRARY_VISIBILITY CoroFrameInst : public IntrinsicInst {
187187 public:
188188 // Methods to support type inquiry through isa, cast, and dyn_cast:
189 static inline bool classof(const IntrinsicInst *I) {
189 static bool classof(const IntrinsicInst *I) {
190190 return I->getIntrinsicID() == Intrinsic::coro_frame;
191191 }
192 static inline bool classof(const Value *V) {
192 static bool classof(const Value *V) {
193193 return isa(V) && classof(cast(V));
194194 }
195195 };
202202 Value *getFrame() const { return getArgOperand(FrameArg); }
203203
204204 // Methods to support type inquiry through isa, cast, and dyn_cast:
205 static inline bool classof(const IntrinsicInst *I) {
205 static bool classof(const IntrinsicInst *I) {
206206 return I->getIntrinsicID() == Intrinsic::coro_free;
207207 }
208 static inline bool classof(const Value *V) {
208 static bool classof(const Value *V) {
209209 return isa(V) && classof(cast(V));
210210 }
211211 };
220220 Value *getMem() const { return getArgOperand(MemArg); }
221221
222222 // Methods for support type inquiry through isa, cast, and dyn_cast:
223 static inline bool classof(const IntrinsicInst *I) {
223 static bool classof(const IntrinsicInst *I) {
224224 return I->getIntrinsicID() == Intrinsic::coro_begin;
225225 }
226 static inline bool classof(const Value *V) {
226 static bool classof(const Value *V) {
227227 return isa(V) && classof(cast(V));
228228 }
229229 };
232232 class LLVM_LIBRARY_VISIBILITY CoroSaveInst : public IntrinsicInst {
233233 public:
234234 // Methods to support type inquiry through isa, cast, and dyn_cast:
235 static inline bool classof(const IntrinsicInst *I) {
235 static bool classof(const IntrinsicInst *I) {
236236 return I->getIntrinsicID() == Intrinsic::coro_save;
237237 }
238 static inline bool classof(const Value *V) {
238 static bool classof(const Value *V) {
239239 return isa(V) && classof(cast(V));
240240 }
241241 };
253253 }
254254
255255 // Methods to support type inquiry through isa, cast, and dyn_cast:
256 static inline bool classof(const IntrinsicInst *I) {
256 static bool classof(const IntrinsicInst *I) {
257257 return I->getIntrinsicID() == Intrinsic::coro_promise;
258258 }
259 static inline bool classof(const Value *V) {
259 static bool classof(const Value *V) {
260260 return isa(V) && classof(cast(V));
261261 }
262262 };
278278 }
279279
280280 // Methods to support type inquiry through isa, cast, and dyn_cast:
281 static inline bool classof(const IntrinsicInst *I) {
281 static bool classof(const IntrinsicInst *I) {
282282 return I->getIntrinsicID() == Intrinsic::coro_suspend;
283283 }
284 static inline bool classof(const Value *V) {
284 static bool classof(const Value *V) {
285285 return isa(V) && classof(cast(V));
286286 }
287287 };
290290 class LLVM_LIBRARY_VISIBILITY CoroSizeInst : public IntrinsicInst {
291291 public:
292292 // Methods to support type inquiry through isa, cast, and dyn_cast:
293 static inline bool classof(const IntrinsicInst *I) {
293 static bool classof(const IntrinsicInst *I) {
294294 return I->getIntrinsicID() == Intrinsic::coro_size;
295295 }
296 static inline bool classof(const Value *V) {
296 static bool classof(const Value *V) {
297297 return isa(V) && classof(cast(V));
298298 }
299299 };
309309 }
310310
311311 // Methods to support type inquiry through isa, cast, and dyn_cast:
312 static inline bool classof(const IntrinsicInst *I) {
312 static bool classof(const IntrinsicInst *I) {
313313 return I->getIntrinsicID() == Intrinsic::coro_end;
314314 }
315 static inline bool classof(const Value *V) {
315 static bool classof(const Value *V) {
316316 return isa(V) && classof(cast(V));
317317 }
318318 };
207207 Children.resize(NC);
208208 }
209209
210 static inline bool classof(const Matcher *N) {
210 static bool classof(const Matcher *N) {
211211 return N->getKind() == Scope;
212212 }
213213
232232 const std::string &getWhatFor() const { return WhatFor; }
233233 unsigned getResultNo() const { return ResultNo; }
234234
235 static inline bool classof(const Matcher *N) {
235 static bool classof(const Matcher *N) {
236236 return N->getKind() == RecordNode;
237237 }
238238
264264 const std::string &getWhatFor() const { return WhatFor; }
265265 unsigned getResultNo() const { return ResultNo; }
266266
267 static inline bool classof(const Matcher *N) {
267 static bool classof(const Matcher *N) {
268268 return N->getKind() == RecordChild;
269269 }
270270
280280 public:
281281 RecordMemRefMatcher() : Matcher(RecordMemRef) {}
282282
283 static inline bool classof(const Matcher *N) {
283 static bool classof(const Matcher *N) {
284284 return N->getKind() == RecordMemRef;
285285 }
286286
296296 public:
297297 CaptureGlueInputMatcher() : Matcher(CaptureGlueInput) {}
298298
299 static inline bool classof(const Matcher *N) {
299 static bool classof(const Matcher *N) {
300300 return N->getKind() == CaptureGlueInput;
301301 }
302302
314314
315315 unsigned getChildNo() const { return ChildNo; }
316316
317 static inline bool classof(const Matcher *N) {
317 static bool classof(const Matcher *N) {
318318 return N->getKind() == MoveChild;
319319 }
320320
331331 public:
332332 MoveParentMatcher() : Matcher(MoveParent) {}
333333
334 static inline bool classof(const Matcher *N) {
334 static bool classof(const Matcher *N) {
335335 return N->getKind() == MoveParent;
336336 }
337337
351351
352352 unsigned getMatchNumber() const { return MatchNumber; }
353353
354 static inline bool classof(const Matcher *N) {
354 static bool classof(const Matcher *N) {
355355 return N->getKind() == CheckSame;
356356 }
357357
375375 unsigned getChildNo() const { return ChildNo; }
376376 unsigned getMatchNumber() const { return MatchNumber; }
377377
378 static inline bool classof(const Matcher *N) {
378 static bool classof(const Matcher *N) {
379379 return N->getKind() == CheckChildSame;
380380 }
381381
398398
399399 StringRef getPredicate() const { return Predicate; }
400400
401 static inline bool classof(const Matcher *N) {
401 static bool classof(const Matcher *N) {
402402 return N->getKind() == CheckPatternPredicate;
403403 }
404404
418418
419419 TreePredicateFn getPredicate() const;
420420
421 static inline bool classof(const Matcher *N) {
421 static bool classof(const Matcher *N) {
422422 return N->getKind() == CheckPredicate;
423423 }
424424
440440
441441 const SDNodeInfo &getOpcode() const { return Opcode; }
442442
443 static inline bool classof(const Matcher *N) {
443 static bool classof(const Matcher *N) {
444444 return N->getKind() == CheckOpcode;
445445 }
446446
461461 : Matcher(SwitchOpcode), Cases(cases.begin(), cases.end()) {}
462462 ~SwitchOpcodeMatcher() override;
463463
464 static inline bool classof(const Matcher *N) {
464 static bool classof(const Matcher *N) {
465465 return N->getKind() == SwitchOpcode;
466466 }
467467
488488 MVT::SimpleValueType getType() const { return Type; }
489489 unsigned getResNo() const { return ResNo; }
490490
491 static inline bool classof(const Matcher *N) {
491 static bool classof(const Matcher *N) {
492492 return N->getKind() == CheckType;
493493 }
494494
511511 : Matcher(SwitchType), Cases(cases.begin(), cases.end()) {}
512512 ~SwitchTypeMatcher() override;
513513
514 static inline bool classof(const Matcher *N) {
514 static bool classof(const Matcher *N) {
515515 return N->getKind() == SwitchType;
516516 }
517517
539539 unsigned getChildNo() const { return ChildNo; }
540540 MVT::SimpleValueType getType() const { return Type; }
541541
542 static inline bool classof(const Matcher *N) {
542 static bool classof(const Matcher *N) {
543543 return N->getKind() == CheckChildType;
544544 }
545545
563563
564564 int64_t getValue() const { return Value; }
565565
566 static inline bool classof(const Matcher *N) {
566 static bool classof(const Matcher *N) {
567567 return N->getKind() == CheckInteger;
568568 }
569569
587587 unsigned getChildNo() const { return ChildNo; }
588588 int64_t getValue() const { return Value; }
589589
590 static inline bool classof(const Matcher *N) {
590 static bool classof(const Matcher *N) {
591591 return N->getKind() == CheckChildInteger;
592592 }
593593
610610
611611 StringRef getCondCodeName() const { return CondCodeName; }
612612
613 static inline bool classof(const Matcher *N) {
613 static bool classof(const Matcher *N) {
614614 return N->getKind() == CheckCondCode;
615615 }
616616
631631
632632 StringRef getTypeName() const { return TypeName; }
633633
634 static inline bool classof(const Matcher *N) {
634 static bool classof(const Matcher *N) {
635635 return N->getKind() == CheckValueType;
636636 }
637637
672672 const std::string getName() const { return Name; }
673673 unsigned getFirstResult() const { return FirstResult; }
674674
675 static inline bool classof(const Matcher *N) {
675 static bool classof(const Matcher *N) {
676676 return N->getKind() == CheckComplexPat;
677677 }
678678
694694
695695 int64_t getValue() const { return Value; }
696696
697 static inline bool classof(const Matcher *N) {
697 static bool classof(const Matcher *N) {
698698 return N->getKind() == CheckAndImm;
699699 }
700700
715715
716716 int64_t getValue() const { return Value; }
717717
718 static inline bool classof(const Matcher *N) {
718 static bool classof(const Matcher *N) {
719719 return N->getKind() == CheckOrImm;
720720 }
721721
733733 CheckFoldableChainNodeMatcher()
734734 : Matcher(CheckFoldableChainNode) {}
735735
736 static inline bool classof(const Matcher *N) {
736 static bool classof(const Matcher *N) {
737737 return N->getKind() == CheckFoldableChainNode;
738738 }
739739
753753 int64_t getValue() const { return Val; }
754754 MVT::SimpleValueType getVT() const { return VT; }
755755
756 static inline bool classof(const Matcher *N) {
756 static bool classof(const Matcher *N) {
757757 return N->getKind() == EmitInteger;
758758 }
759759
777777 const std::string &getValue() const { return Val; }
778778 MVT::SimpleValueType getVT() const { return VT; }
779779
780 static inline bool classof(const Matcher *N) {
780 static bool classof(const Matcher *N) {
781781 return N->getKind() == EmitStringInteger;
782782 }
783783
802802 const CodeGenRegister *getReg() const { return Reg; }
803803 MVT::SimpleValueType getVT() const { return VT; }
804804
805 static inline bool classof(const Matcher *N) {
805 static bool classof(const Matcher *N) {
806806 return N->getKind() == EmitRegister;
807807 }
808808
825825
826826 unsigned getSlot() const { return Slot; }
827827
828 static inline bool classof(const Matcher *N) {
828 static bool classof(const Matcher *N) {
829829 return N->getKind() == EmitConvertToTarget;
830830 }
831831
853853 return ChainNodes[i];
854854 }
855855
856 static inline bool classof(const Matcher *N) {
856 static bool classof(const Matcher *N) {
857857 return N->getKind() == EmitMergeInputChains;
858858 }
859859
877877 unsigned getSrcSlot() const { return SrcSlot; }
878878 Record *getDestPhysReg() const { return DestPhysReg; }
879879
880 static inline bool classof(const Matcher *N) {
880 static bool classof(const Matcher *N) {
881881 return N->getKind() == EmitCopyToReg;
882882 }
883883
903903 unsigned getSlot() const { return Slot; }
904904 Record *getNodeXForm() const { return NodeXForm; }
905905
906 static inline bool classof(const Matcher *N) {
906 static bool classof(const Matcher *N) {
907907 return N->getKind() == EmitNodeXForm;
908908 }
909909
963963 bool hasMemRefs() const { return HasMemRefs; }
964964 int getNumFixedArityOperands() const { return NumFixedArityOperands; }
965965
966 static inline bool classof(const Matcher *N) {
966 static bool classof(const Matcher *N) {
967967 return N->getKind() == EmitNode || N->getKind() == MorphNodeTo;
968968 }
969969
990990
991991 unsigned getFirstResultSlot() const { return FirstResultSlot; }
992992
993 static inline bool classof(const Matcher *N) {
993 static bool classof(const Matcher *N) {
994994 return N->getKind() == EmitNode;
995995 }
996996
10141014
10151015 const PatternToMatch &getPattern() const { return Pattern; }
10161016
1017 static inline bool classof(const Matcher *N) {
1017 static bool classof(const Matcher *N) {
10181018 return N->getKind() == MorphNodeTo;
10191019 }
10201020 };
10351035 unsigned getResult(unsigned R) const { return Results[R]; }
10361036 const PatternToMatch &getPattern() const { return Pattern; }
10371037
1038 static inline bool classof(const Matcher *N) {
1038 static bool classof(const Matcher *N) {
10391039 return N->getKind() == CompleteMatch;
10401040 }
10411041