@@ -4899,8 +4899,7 @@ define void @foo(ptr %ptr, i8 %cmp, i8 %new) {
4899
4899
auto *NewI =
4900
4900
cast<sandboxir::AtomicCmpXchgInst>(sandboxir::AtomicCmpXchgInst::create (
4901
4901
Ptr, Cmp, New, Align, SuccOrdering, FailOrdering,
4902
- /* WhereIt=*/ Ret->getIterator (),
4903
- /* WhereBB=*/ Ret->getParent (), Ctx, SSID, " NewAtomicCmpXchg1" ));
4902
+ Ret->getIterator (), Ctx, SSID, " NewAtomicCmpXchg1" ));
4904
4903
// Check getOpcode().
4905
4904
EXPECT_EQ (NewI->getOpcode (), sandboxir::Instruction::Opcode::AtomicCmpXchg);
4906
4905
// Check getAlign().
@@ -4927,7 +4926,7 @@ define void @foo(ptr %ptr, i8 %cmp, i8 %new) {
4927
4926
auto *NewI =
4928
4927
cast<sandboxir::AtomicCmpXchgInst>(sandboxir::AtomicCmpXchgInst::create (
4929
4928
Ptr, Cmp, New, Align, SuccOrdering, FailOrdering,
4930
- /* InsertBefore= */ Ret, Ctx, SSID, " NewAtomicCmpXchg2" ));
4929
+ Ret-> getIterator () , Ctx, SSID, " NewAtomicCmpXchg2" ));
4931
4930
// Check getOpcode().
4932
4931
EXPECT_EQ (NewI->getOpcode (), sandboxir::Instruction::Opcode::AtomicCmpXchg);
4933
4932
// Check getAlign().
@@ -4953,8 +4952,8 @@ define void @foo(ptr %ptr, i8 %cmp, i8 %new) {
4953
4952
// Check create() InsertAtEnd.
4954
4953
auto *NewI =
4955
4954
cast<sandboxir::AtomicCmpXchgInst>(sandboxir::AtomicCmpXchgInst::create (
4956
- Ptr, Cmp, New, Align, SuccOrdering, FailOrdering,
4957
- /* InsertAtEnd= */ BB, Ctx, SSID, " NewAtomicCmpXchg3" ));
4955
+ Ptr, Cmp, New, Align, SuccOrdering, FailOrdering, BB, Ctx, SSID,
4956
+ " NewAtomicCmpXchg3" ));
4958
4957
// Check getOpcode().
4959
4958
EXPECT_EQ (NewI->getOpcode (), sandboxir::Instruction::Opcode::AtomicCmpXchg);
4960
4959
// Check getAlign().
@@ -5074,8 +5073,7 @@ define void @foo() {
5074
5073
{
5075
5074
// Check create() WhereIt, WhereBB.
5076
5075
auto *NewI = cast<sandboxir::AllocaInst>(sandboxir::AllocaInst::create (
5077
- Ty, AddrSpace, /* WhereIt=*/ Ret->getIterator (),
5078
- /* WhereBB=*/ Ret->getParent (), Ctx, ArraySize, " NewAlloca1" ));
5076
+ Ty, AddrSpace, Ret->getIterator (), Ctx, ArraySize, " NewAlloca1" ));
5079
5077
// Check getOpcode().
5080
5078
EXPECT_EQ (NewI->getOpcode (), sandboxir::Instruction::Opcode::Alloca);
5081
5079
// Check getType().
@@ -5090,7 +5088,7 @@ define void @foo() {
5090
5088
{
5091
5089
// Check create() InsertBefore.
5092
5090
auto *NewI = cast<sandboxir::AllocaInst>(sandboxir::AllocaInst::create (
5093
- Ty, AddrSpace, /* InsertBefore= */ Ret, Ctx, ArraySize, " NewAlloca2" ));
5091
+ Ty, AddrSpace, Ret-> getIterator () , Ctx, ArraySize, " NewAlloca2" ));
5094
5092
// Check getOpcode().
5095
5093
EXPECT_EQ (NewI->getOpcode (), sandboxir::Instruction::Opcode::Alloca);
5096
5094
// Check getType().
@@ -5105,7 +5103,7 @@ define void @foo() {
5105
5103
{
5106
5104
// Check create() InsertAtEnd.
5107
5105
auto *NewI = cast<sandboxir::AllocaInst>(sandboxir::AllocaInst::create (
5108
- Ty, AddrSpace, /* InsertAtEnd= */ BB, Ctx, ArraySize, " NewAlloca3" ));
5106
+ Ty, AddrSpace, BB, Ctx, ArraySize, " NewAlloca3" ));
5109
5107
// Check getOpcode().
5110
5108
EXPECT_EQ (NewI->getOpcode (), sandboxir::Instruction::Opcode::Alloca);
5111
5109
// Check getType().
@@ -5265,9 +5263,9 @@ define void @foo(i32 %arg, float %farg, double %darg, ptr %ptr) {
5265
5263
5266
5264
{
5267
5265
// Check create() WhereIt, WhereBB
5268
- auto *NewI = cast<sandboxir::CastInst>(sandboxir::CastInst::create (
5269
- Ti64, sandboxir::Instruction::Opcode::SExt, Arg, /* WhereIt= */ BB-> end () ,
5270
- /* WhereBB= */ BB , Ctx, " SExt" ));
5266
+ auto *NewI = cast<sandboxir::CastInst>(
5267
+ sandboxir::CastInst::create ( Ti64, sandboxir::Instruction::Opcode::SExt,
5268
+ Arg, BB-> end () , Ctx, " SExt" ));
5271
5269
// Check getOpcode().
5272
5270
EXPECT_EQ (NewI->getOpcode (), sandboxir::Instruction::Opcode::SExt);
5273
5271
// Check getSrcTy().
@@ -5283,7 +5281,7 @@ define void @foo(i32 %arg, float %farg, double %darg, ptr %ptr) {
5283
5281
// Check create() InsertBefore.
5284
5282
auto *NewI = cast<sandboxir::CastInst>(
5285
5283
sandboxir::CastInst::create (Ti64, sandboxir::Instruction::Opcode::ZExt,
5286
- Arg, /* InsertBefore= */ Ret, Ctx, " ZExt" ));
5284
+ Arg, Ret-> getIterator () , Ctx, " ZExt" ));
5287
5285
// Check getOpcode().
5288
5286
EXPECT_EQ (NewI->getOpcode (), sandboxir::Instruction::Opcode::ZExt);
5289
5287
// Check getSrcTy().
@@ -5295,9 +5293,8 @@ define void @foo(i32 %arg, float %farg, double %darg, ptr %ptr) {
5295
5293
}
5296
5294
{
5297
5295
// Check create() InsertAtEnd.
5298
- auto *NewI = cast<sandboxir::CastInst>(
5299
- sandboxir::CastInst::create (Ti64, sandboxir::Instruction::Opcode::ZExt,
5300
- Arg, /* InsertAtEnd=*/ BB, Ctx, " ZExt" ));
5296
+ auto *NewI = cast<sandboxir::CastInst>(sandboxir::CastInst::create (
5297
+ Ti64, sandboxir::Instruction::Opcode::ZExt, Arg, BB, Ctx, " ZExt" ));
5301
5298
// Check getOpcode().
5302
5299
EXPECT_EQ (NewI->getOpcode (), sandboxir::Instruction::Opcode::ZExt);
5303
5300
// Check getSrcTy().
@@ -5314,7 +5311,7 @@ define void @foo(i32 %arg, float %farg, double %darg, ptr %ptr) {
5314
5311
// Check that passing a non-cast opcode crashes.
5315
5312
EXPECT_DEATH (
5316
5313
sandboxir::CastInst::create (Ti64, sandboxir::Instruction::Opcode::Store,
5317
- Arg, /* InsertBefore= */ Ret, Ctx, " Bad" ),
5314
+ Arg, Ret-> getIterator () , Ctx, " Bad" ),
5318
5315
" .*Opcode.*" );
5319
5316
#endif // NDEBUG
5320
5317
}
@@ -5386,8 +5383,7 @@ void testCastInst(llvm::Module &M, llvm::Type *LLVMSrcTy,
5386
5383
{
5387
5384
// Check create() WhereIt, WhereBB
5388
5385
auto *NewI =
5389
- cast<SubclassT>(SubclassT::create (Arg, DstTy, /* WhereIt=*/ BB->end (),
5390
- /* WhereBB=*/ BB, Ctx, " NewCI" ));
5386
+ cast<SubclassT>(SubclassT::create (Arg, DstTy, BB->end (), Ctx, " NewCI" ));
5391
5387
// Check getOpcode().
5392
5388
EXPECT_EQ (NewI->getOpcode (), OpcodeT);
5393
5389
// Check getSrcTy().
@@ -5402,9 +5398,8 @@ void testCastInst(llvm::Module &M, llvm::Type *LLVMSrcTy,
5402
5398
}
5403
5399
{
5404
5400
// Check create() InsertBefore.
5405
- auto *NewI =
5406
- cast<SubclassT>(SubclassT::create (Arg, DstTy,
5407
- /* InsertBefore=*/ Ret, Ctx, " NewCI" ));
5401
+ auto *NewI = cast<SubclassT>(
5402
+ SubclassT::create (Arg, DstTy, Ret->getIterator (), Ctx, " NewCI" ));
5408
5403
// Check getOpcode().
5409
5404
EXPECT_EQ (NewI->getOpcode (), OpcodeT);
5410
5405
// Check getSrcTy().
@@ -5744,8 +5739,8 @@ define void @foo(i32 %arg) {
5744
5739
EXPECT_EQ (PHI->getIncomingBlock (1 ), RemainBB1);
5745
5740
EXPECT_EQ (PHI->getIncomingBlock (2 ), RemainBB2);
5746
5741
// Check create().
5747
- auto *NewPHI = cast<sandboxir::PHINode>(
5748
- sandboxir::PHINode::create ( PHI->getType (), 0 , Br, Ctx, " NewPHI" ));
5742
+ auto *NewPHI = cast<sandboxir::PHINode>(sandboxir::PHINode::create (
5743
+ PHI->getType (), 0 , Br-> getIterator () , Ctx, " NewPHI" ));
5749
5744
EXPECT_EQ (NewPHI->getType (), PHI->getType ());
5750
5745
EXPECT_EQ (NewPHI->getNextNode (), Br);
5751
5746
EXPECT_EQ (NewPHI->getName (), " NewPHI" );
0 commit comments