@@ -502,10 +502,8 @@ class ExtractElementInst final
502
502
// create*()
503
503
504
504
public:
505
- static Value *create (Value *Vec, Value *Idx, Instruction *InsertBefore,
506
- Context &Ctx, const Twine &Name = " " );
507
- static Value *create (Value *Vec, Value *Idx, BasicBlock *InsertAtEnd,
508
- Context &Ctx, const Twine &Name = " " );
505
+ static Value *create (Value *Vec, Value *Idx, InsertPosition Pos, Context &Ctx,
506
+ const Twine &Name = " " );
509
507
static bool classof (const Value *From) {
510
508
return From->getSubclassID () == ClassID::ExtractElement;
511
509
}
@@ -529,17 +527,10 @@ class ShuffleVectorInst final
529
527
friend class Context ; // For accessing the constructor in create*()
530
528
531
529
public:
532
- static Value *create (Value *V1, Value *V2, Value *Mask,
533
- Instruction *InsertBefore, Context &Ctx,
534
- const Twine &Name = " " );
535
- static Value *create (Value *V1, Value *V2, Value *Mask,
536
- BasicBlock *InsertAtEnd, Context &Ctx,
537
- const Twine &Name = " " );
538
- static Value *create (Value *V1, Value *V2, ArrayRef<int > Mask,
539
- Instruction *InsertBefore, Context &Ctx,
540
- const Twine &Name = " " );
530
+ static Value *create (Value *V1, Value *V2, Value *Mask, InsertPosition Pos,
531
+ Context &Ctx, const Twine &Name = " " );
541
532
static Value *create (Value *V1, Value *V2, ArrayRef<int > Mask,
542
- BasicBlock *InsertAtEnd , Context &Ctx,
533
+ InsertPosition Pos , Context &Ctx,
543
534
const Twine &Name = " " );
544
535
static bool classof (const Value *From) {
545
536
return From->getSubclassID () == ClassID::ShuffleVector;
@@ -974,7 +965,7 @@ class InsertValueInst
974
965
975
966
public:
976
967
static Value *create (Value *Agg, Value *Val, ArrayRef<unsigned > Idxs,
977
- BBIterator WhereIt, BasicBlock *WhereBB , Context &Ctx,
968
+ InsertPosition Pos , Context &Ctx,
978
969
const Twine &Name = " " );
979
970
980
971
static bool classof (const Value *From) {
@@ -1032,15 +1023,10 @@ class BranchInst : public SingleLLVMInstructionImpl<llvm::BranchInst> {
1032
1023
friend Context; // for BranchInst()
1033
1024
1034
1025
public:
1035
- static BranchInst *create (BasicBlock *IfTrue, Instruction *InsertBefore,
1036
- Context &Ctx);
1037
- static BranchInst *create (BasicBlock *IfTrue, BasicBlock *InsertAtEnd,
1038
- Context &Ctx);
1039
- static BranchInst *create (BasicBlock *IfTrue, BasicBlock *IfFalse,
1040
- Value *Cond, Instruction *InsertBefore,
1026
+ static BranchInst *create (BasicBlock *IfTrue, InsertPosition Pos,
1041
1027
Context &Ctx);
1042
1028
static BranchInst *create (BasicBlock *IfTrue, BasicBlock *IfFalse,
1043
- Value *Cond, BasicBlock *InsertAtEnd , Context &Ctx);
1029
+ Value *Cond, InsertPosition Pos , Context &Ctx);
1044
1030
// / For isa/dyn_cast.
1045
1031
static bool classof (const Value *From);
1046
1032
bool isUnconditional () const {
@@ -1122,9 +1108,8 @@ class ExtractValueInst : public UnaryInstruction {
1122
1108
friend Context; // for ExtractValueInst()
1123
1109
1124
1110
public:
1125
- static Value *create (Value *Agg, ArrayRef<unsigned > Idxs, BBIterator WhereIt,
1126
- BasicBlock *WhereBB, Context &Ctx,
1127
- const Twine &Name = " " );
1111
+ static Value *create (Value *Agg, ArrayRef<unsigned > Idxs, InsertPosition Pos,
1112
+ Context &Ctx, const Twine &Name = " " );
1128
1113
1129
1114
static bool classof (const Value *From) {
1130
1115
return From->getSubclassID () == ClassID::ExtractValue;
@@ -1177,9 +1162,8 @@ class VAArgInst : public UnaryInstruction {
1177
1162
friend Context; // For constructor;
1178
1163
1179
1164
public:
1180
- static VAArgInst *create (Value *List, Type *Ty, BBIterator WhereIt,
1181
- BasicBlock *WhereBB, Context &Ctx,
1182
- const Twine &Name = " " );
1165
+ static VAArgInst *create (Value *List, Type *Ty, InsertPosition Pos,
1166
+ Context &Ctx, const Twine &Name = " " );
1183
1167
Value *getPointerOperand ();
1184
1168
const Value *getPointerOperand () const {
1185
1169
return const_cast <VAArgInst *>(this )->getPointerOperand ();
@@ -1198,8 +1182,8 @@ class FreezeInst : public UnaryInstruction {
1198
1182
friend Context; // For constructor;
1199
1183
1200
1184
public:
1201
- static FreezeInst *create (Value *V, BBIterator WhereIt, BasicBlock *WhereBB ,
1202
- Context &Ctx, const Twine &Name = " " );
1185
+ static FreezeInst *create (Value *V, InsertPosition Pos, Context &Ctx ,
1186
+ const Twine &Name = " " );
1203
1187
static bool classof (const Value *From) {
1204
1188
return From->getSubclassID () == ClassID::Freeze;
1205
1189
}
@@ -1218,17 +1202,13 @@ class LoadInst final : public UnaryInstruction {
1218
1202
void setVolatile (bool V);
1219
1203
1220
1204
static LoadInst *create (Type *Ty, Value *Ptr, MaybeAlign Align,
1221
- Instruction *InsertBefore , Context &Ctx,
1205
+ InsertPosition Pos, bool IsVolatile , Context &Ctx,
1222
1206
const Twine &Name = " " );
1223
1207
static LoadInst *create (Type *Ty, Value *Ptr, MaybeAlign Align,
1224
- Instruction *InsertBefore, bool IsVolatile,
1225
- Context &Ctx, const Twine &Name = " " );
1226
- static LoadInst *create (Type *Ty, Value *Ptr, MaybeAlign Align,
1227
- BasicBlock *InsertAtEnd, Context &Ctx,
1228
- const Twine &Name = " " );
1229
- static LoadInst *create (Type *Ty, Value *Ptr, MaybeAlign Align,
1230
- BasicBlock *InsertAtEnd, bool IsVolatile,
1231
- Context &Ctx, const Twine &Name = " " );
1208
+ InsertPosition Pos, Context &Ctx,
1209
+ const Twine &Name = " " ) {
1210
+ return create (Ty, Ptr, Align, Pos, /* IsVolatile=*/ false , Ctx, Name);
1211
+ }
1232
1212
1233
1213
// / For isa/dyn_cast.
1234
1214
static bool classof (const Value *From);
@@ -1251,15 +1231,12 @@ class StoreInst final : public SingleLLVMInstructionImpl<llvm::StoreInst> {
1251
1231
void setVolatile (bool V);
1252
1232
1253
1233
static StoreInst *create (Value *V, Value *Ptr, MaybeAlign Align,
1254
- Instruction *InsertBefore, Context &Ctx);
1255
- static StoreInst *create (Value *V, Value *Ptr, MaybeAlign Align,
1256
- Instruction *InsertBefore, bool IsVolatile,
1257
- Context &Ctx);
1234
+ InsertPosition Pos, bool IsVolatile, Context &Ctx);
1258
1235
static StoreInst *create (Value *V, Value *Ptr, MaybeAlign Align,
1259
- BasicBlock *InsertAtEnd , Context &Ctx);
1260
- static StoreInst * create (Value * V, Value * Ptr, MaybeAlign Align,
1261
- BasicBlock *InsertAtEnd, bool IsVolatile,
1262
- Context &Ctx);
1236
+ InsertPosition Pos , Context &Ctx) {
1237
+ return create (V, Ptr, Align, Pos, /* IsVolatile= */ false , Ctx);
1238
+ }
1239
+
1263
1240
// / For isa/dyn_cast.
1264
1241
static bool classof (const Value *From);
1265
1242
Value *getValueOperand () const ;
0 commit comments