@@ -714,7 +714,7 @@ TEST(InstructionsTest, CloneCall) {
714
714
Type *Int32Ty = Type::getInt32Ty (C);
715
715
Type *ArgTys[] = {Int32Ty, Int32Ty, Int32Ty};
716
716
FunctionType *FnTy = FunctionType::get (Int32Ty, ArgTys, /* isVarArg=*/ false );
717
- Value *Callee = Constant::getNullValue (FnTy-> getPointerTo ( ));
717
+ Value *Callee = Constant::getNullValue (PointerType::getUnqual (C ));
718
718
Value *Args[] = {
719
719
ConstantInt::get (Int32Ty, 1 ),
720
720
ConstantInt::get (Int32Ty, 2 ),
@@ -748,7 +748,7 @@ TEST(InstructionsTest, AlterCallBundles) {
748
748
LLVMContext C;
749
749
Type *Int32Ty = Type::getInt32Ty (C);
750
750
FunctionType *FnTy = FunctionType::get (Int32Ty, Int32Ty, /* isVarArg=*/ false );
751
- Value *Callee = Constant::getNullValue (FnTy-> getPointerTo ( ));
751
+ Value *Callee = Constant::getNullValue (PointerType::getUnqual (C ));
752
752
Value *Args[] = {ConstantInt::get (Int32Ty, 42 )};
753
753
OperandBundleDef OldBundle (" before" , UndefValue::get (Int32Ty));
754
754
std::unique_ptr<CallInst> Call (
@@ -775,7 +775,7 @@ TEST(InstructionsTest, AlterInvokeBundles) {
775
775
LLVMContext C;
776
776
Type *Int32Ty = Type::getInt32Ty (C);
777
777
FunctionType *FnTy = FunctionType::get (Int32Ty, Int32Ty, /* isVarArg=*/ false );
778
- Value *Callee = Constant::getNullValue (FnTy-> getPointerTo ( ));
778
+ Value *Callee = Constant::getNullValue (PointerType::getUnqual (C ));
779
779
Value *Args[] = {ConstantInt::get (Int32Ty, 42 )};
780
780
std::unique_ptr<BasicBlock> NormalDest (BasicBlock::Create (C));
781
781
std::unique_ptr<BasicBlock> UnwindDest (BasicBlock::Create (C));
@@ -1501,50 +1501,51 @@ TEST(InstructionsTest, FPCallIsFPMathOperator) {
1501
1501
1502
1502
Type *ITy = Type::getInt32Ty (C);
1503
1503
FunctionType *IFnTy = FunctionType::get (ITy, {});
1504
- Value *ICallee = Constant::getNullValue (IFnTy->getPointerTo ());
1504
+ PointerType *PtrTy = PointerType::getUnqual (C);
1505
+ Value *ICallee = Constant::getNullValue (PtrTy);
1505
1506
std::unique_ptr<CallInst> ICall (CallInst::Create (IFnTy, ICallee, {}, " " ));
1506
1507
EXPECT_FALSE (isa<FPMathOperator>(ICall));
1507
1508
1508
1509
Type *VITy = FixedVectorType::get (ITy, 2 );
1509
1510
FunctionType *VIFnTy = FunctionType::get (VITy, {});
1510
- Value *VICallee = Constant::getNullValue (VIFnTy-> getPointerTo () );
1511
+ Value *VICallee = Constant::getNullValue (PtrTy );
1511
1512
std::unique_ptr<CallInst> VICall (CallInst::Create (VIFnTy, VICallee, {}, " " ));
1512
1513
EXPECT_FALSE (isa<FPMathOperator>(VICall));
1513
1514
1514
1515
Type *AITy = ArrayType::get (ITy, 2 );
1515
1516
FunctionType *AIFnTy = FunctionType::get (AITy, {});
1516
- Value *AICallee = Constant::getNullValue (AIFnTy-> getPointerTo () );
1517
+ Value *AICallee = Constant::getNullValue (PtrTy );
1517
1518
std::unique_ptr<CallInst> AICall (CallInst::Create (AIFnTy, AICallee, {}, " " ));
1518
1519
EXPECT_FALSE (isa<FPMathOperator>(AICall));
1519
1520
1520
1521
Type *FTy = Type::getFloatTy (C);
1521
1522
FunctionType *FFnTy = FunctionType::get (FTy, {});
1522
- Value *FCallee = Constant::getNullValue (FFnTy-> getPointerTo () );
1523
+ Value *FCallee = Constant::getNullValue (PtrTy );
1523
1524
std::unique_ptr<CallInst> FCall (CallInst::Create (FFnTy, FCallee, {}, " " ));
1524
1525
EXPECT_TRUE (isa<FPMathOperator>(FCall));
1525
1526
1526
1527
Type *VFTy = FixedVectorType::get (FTy, 2 );
1527
1528
FunctionType *VFFnTy = FunctionType::get (VFTy, {});
1528
- Value *VFCallee = Constant::getNullValue (VFFnTy-> getPointerTo () );
1529
+ Value *VFCallee = Constant::getNullValue (PtrTy );
1529
1530
std::unique_ptr<CallInst> VFCall (CallInst::Create (VFFnTy, VFCallee, {}, " " ));
1530
1531
EXPECT_TRUE (isa<FPMathOperator>(VFCall));
1531
1532
1532
1533
Type *AFTy = ArrayType::get (FTy, 2 );
1533
1534
FunctionType *AFFnTy = FunctionType::get (AFTy, {});
1534
- Value *AFCallee = Constant::getNullValue (AFFnTy-> getPointerTo () );
1535
+ Value *AFCallee = Constant::getNullValue (PtrTy );
1535
1536
std::unique_ptr<CallInst> AFCall (CallInst::Create (AFFnTy, AFCallee, {}, " " ));
1536
1537
EXPECT_TRUE (isa<FPMathOperator>(AFCall));
1537
1538
1538
1539
Type *AVFTy = ArrayType::get (VFTy, 2 );
1539
1540
FunctionType *AVFFnTy = FunctionType::get (AVFTy, {});
1540
- Value *AVFCallee = Constant::getNullValue (AVFFnTy-> getPointerTo () );
1541
+ Value *AVFCallee = Constant::getNullValue (PtrTy );
1541
1542
std::unique_ptr<CallInst> AVFCall (
1542
1543
CallInst::Create (AVFFnTy, AVFCallee, {}, " " ));
1543
1544
EXPECT_TRUE (isa<FPMathOperator>(AVFCall));
1544
1545
1545
1546
Type *AAVFTy = ArrayType::get (AVFTy, 2 );
1546
1547
FunctionType *AAVFFnTy = FunctionType::get (AAVFTy, {});
1547
- Value *AAVFCallee = Constant::getNullValue (AAVFFnTy-> getPointerTo () );
1548
+ Value *AAVFCallee = Constant::getNullValue (PtrTy );
1548
1549
std::unique_ptr<CallInst> AAVFCall (
1549
1550
CallInst::Create (AAVFFnTy, AAVFCallee, {}, " " ));
1550
1551
EXPECT_TRUE (isa<FPMathOperator>(AAVFCall));
0 commit comments