@@ -779,8 +779,8 @@ class MinMaxIntrinsic : public IntrinsicInst {
779
779
return isa<IntrinsicInst>(V) && classof (cast<IntrinsicInst>(V));
780
780
}
781
781
782
- Value *getLHS () const { return const_cast <Value *>( getArgOperand (0 ) ); }
783
- Value *getRHS () const { return const_cast <Value *>( getArgOperand (1 ) ); }
782
+ Value *getLHS () const { return getArgOperand (0 ); }
783
+ Value *getRHS () const { return getArgOperand (1 ); }
784
784
785
785
// / Returns the comparison predicate underlying the intrinsic.
786
786
static ICmpInst::Predicate getPredicate (Intrinsic::ID ID) {
@@ -868,8 +868,8 @@ class CmpIntrinsic : public IntrinsicInst {
868
868
return isa<IntrinsicInst>(V) && classof (cast<IntrinsicInst>(V));
869
869
}
870
870
871
- Value *getLHS () const { return const_cast <Value *>( getArgOperand (0 ) ); }
872
- Value *getRHS () const { return const_cast <Value *>( getArgOperand (1 ) ); }
871
+ Value *getLHS () const { return getArgOperand (0 ); }
872
+ Value *getRHS () const { return getArgOperand (1 ); }
873
873
874
874
static bool isSigned (Intrinsic::ID ID) { return ID == Intrinsic::scmp; }
875
875
bool isSigned () const { return isSigned (getIntrinsicID ()); }
@@ -914,8 +914,8 @@ class BinaryOpIntrinsic : public IntrinsicInst {
914
914
return isa<IntrinsicInst>(V) && classof (cast<IntrinsicInst>(V));
915
915
}
916
916
917
- Value *getLHS () const { return const_cast <Value *>( getArgOperand (0 ) ); }
918
- Value *getRHS () const { return const_cast <Value *>( getArgOperand (1 ) ); }
917
+ Value *getLHS () const { return getArgOperand (0 ); }
918
+ Value *getRHS () const { return getArgOperand (1 ); }
919
919
920
920
// / Returns the binary operation underlying the intrinsic.
921
921
LLVM_ABI Instruction::BinaryOps getBinaryOp () const ;
@@ -1118,7 +1118,7 @@ class MemIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
1118
1118
1119
1119
public:
1120
1120
ConstantInt *getVolatileCst () const {
1121
- return cast<ConstantInt>(const_cast <Value *>( getArgOperand (ARG_VOLATILE) ));
1121
+ return cast<ConstantInt>(getArgOperand (ARG_VOLATILE));
1122
1122
}
1123
1123
1124
1124
bool isVolatile () const { return !getVolatileCst ()->isZero (); }
@@ -1180,7 +1180,7 @@ class MemSetPatternInst : public MemSetBase<MemIntrinsic> {
1180
1180
1181
1181
public:
1182
1182
ConstantInt *getVolatileCst () const {
1183
- return cast<ConstantInt>(const_cast <Value *>( getArgOperand (ARG_VOLATILE) ));
1183
+ return cast<ConstantInt>(getArgOperand (ARG_VOLATILE));
1184
1184
}
1185
1185
1186
1186
bool isVolatile () const { return !getVolatileCst ()->isZero (); }
@@ -1288,7 +1288,7 @@ class AnyMemIntrinsic : public MemIntrinsicBase<AnyMemIntrinsic> {
1288
1288
1289
1289
Value *getRawElementSizeInBytes () const {
1290
1290
assert (isAtomic ());
1291
- return const_cast <Value *>( getArgOperand (ARG_ELEMENTSIZE) );
1291
+ return getArgOperand (ARG_ELEMENTSIZE);
1292
1292
}
1293
1293
1294
1294
uint32_t getElementSizeInBytes () const {
@@ -1388,7 +1388,7 @@ class VAStartInst : public IntrinsicInst {
1388
1388
return isa<IntrinsicInst>(V) && classof (cast<IntrinsicInst>(V));
1389
1389
}
1390
1390
1391
- Value *getArgList () const { return const_cast <Value *>( getArgOperand (0 ) ); }
1391
+ Value *getArgList () const { return getArgOperand (0 ); }
1392
1392
};
1393
1393
1394
1394
// / This represents the llvm.va_end intrinsic.
@@ -1401,7 +1401,7 @@ class VAEndInst : public IntrinsicInst {
1401
1401
return isa<IntrinsicInst>(V) && classof (cast<IntrinsicInst>(V));
1402
1402
}
1403
1403
1404
- Value *getArgList () const { return const_cast <Value *>( getArgOperand (0 ) ); }
1404
+ Value *getArgList () const { return getArgOperand (0 ); }
1405
1405
};
1406
1406
1407
1407
// / This represents the llvm.va_copy intrinsic.
@@ -1414,8 +1414,8 @@ class VACopyInst : public IntrinsicInst {
1414
1414
return isa<IntrinsicInst>(V) && classof (cast<IntrinsicInst>(V));
1415
1415
}
1416
1416
1417
- Value *getDest () const { return const_cast <Value *>( getArgOperand (0 ) ); }
1418
- Value *getSrc () const { return const_cast <Value *>( getArgOperand (1 ) ); }
1417
+ Value *getDest () const { return getArgOperand (0 ); }
1418
+ Value *getSrc () const { return getArgOperand (1 ); }
1419
1419
};
1420
1420
1421
1421
// / A base class for all instrprof intrinsics.
@@ -1457,16 +1457,12 @@ class InstrProfInstBase : public IntrinsicInst {
1457
1457
// The "name" operand of the profile instrumentation instruction - this is the
1458
1458
// operand that can be used to relate the instruction to the function it
1459
1459
// belonged to at instrumentation time.
1460
- Value *getNameValue () const {
1461
- return const_cast <Value *>(getArgOperand (0 ))->stripPointerCasts ();
1462
- }
1460
+ Value *getNameValue () const { return getArgOperand (0 )->stripPointerCasts (); }
1463
1461
1464
1462
void setNameValue (Value *V) { setArgOperand (0 , V); }
1465
1463
1466
1464
// The hash of the CFG for the instrumented function.
1467
- ConstantInt *getHash () const {
1468
- return cast<ConstantInt>(const_cast <Value *>(getArgOperand (1 )));
1469
- }
1465
+ ConstantInt *getHash () const { return cast<ConstantInt>(getArgOperand (1 )); }
1470
1466
};
1471
1467
1472
1468
// / A base class for all instrprof counter intrinsics.
@@ -1563,18 +1559,14 @@ class InstrProfValueProfileInst : public InstrProfCntrInstBase {
1563
1559
return isa<IntrinsicInst>(V) && classof (cast<IntrinsicInst>(V));
1564
1560
}
1565
1561
1566
- Value *getTargetValue () const {
1567
- return cast<Value>(const_cast <Value *>(getArgOperand (2 )));
1568
- }
1562
+ Value *getTargetValue () const { return cast<Value>(getArgOperand (2 )); }
1569
1563
1570
1564
ConstantInt *getValueKind () const {
1571
- return cast<ConstantInt>(const_cast <Value *>( getArgOperand (3 ) ));
1565
+ return cast<ConstantInt>(getArgOperand (3 ));
1572
1566
}
1573
1567
1574
1568
// Returns the value site index.
1575
- ConstantInt *getIndex () const {
1576
- return cast<ConstantInt>(const_cast <Value *>(getArgOperand (4 )));
1577
- }
1569
+ ConstantInt *getIndex () const { return cast<ConstantInt>(getArgOperand (4 )); }
1578
1570
};
1579
1571
1580
1572
// / A base class for instrprof mcdc intrinsics that require global bitmap bytes.
@@ -1590,7 +1582,7 @@ class InstrProfMCDCBitmapInstBase : public InstrProfInstBase {
1590
1582
// / \return The number of bits used for the MCDC bitmaps for the instrumented
1591
1583
// / function.
1592
1584
ConstantInt *getNumBitmapBits () const {
1593
- return cast<ConstantInt>(const_cast <Value *>( getArgOperand (2 ) ));
1585
+ return cast<ConstantInt>(getArgOperand (2 ));
1594
1586
}
1595
1587
1596
1588
// / \return The number of bytes used for the MCDC bitmaps for the instrumented
@@ -1624,14 +1616,12 @@ class InstrProfMCDCTVBitmapUpdate : public InstrProfMCDCBitmapInstBase {
1624
1616
// / \return The index of the TestVector Bitmap upon which this intrinsic
1625
1617
// / acts.
1626
1618
ConstantInt *getBitmapIndex () const {
1627
- return cast<ConstantInt>(const_cast <Value *>( getArgOperand (2 ) ));
1619
+ return cast<ConstantInt>(getArgOperand (2 ));
1628
1620
}
1629
1621
1630
1622
// / \return The address of the corresponding condition bitmap containing
1631
1623
// / the index of the TestVector to update within the TestVector Bitmap.
1632
- Value *getMCDCCondBitmapAddr () const {
1633
- return cast<Value>(const_cast <Value *>(getArgOperand (3 )));
1634
- }
1624
+ Value *getMCDCCondBitmapAddr () const { return cast<Value>(getArgOperand (3 )); }
1635
1625
};
1636
1626
1637
1627
class PseudoProbeInst : public IntrinsicInst {
@@ -1645,20 +1635,16 @@ class PseudoProbeInst : public IntrinsicInst {
1645
1635
}
1646
1636
1647
1637
ConstantInt *getFuncGuid () const {
1648
- return cast<ConstantInt>(const_cast <Value *>( getArgOperand (0 ) ));
1638
+ return cast<ConstantInt>(getArgOperand (0 ));
1649
1639
}
1650
1640
1651
- ConstantInt *getIndex () const {
1652
- return cast<ConstantInt>(const_cast <Value *>(getArgOperand (1 )));
1653
- }
1641
+ ConstantInt *getIndex () const { return cast<ConstantInt>(getArgOperand (1 )); }
1654
1642
1655
1643
ConstantInt *getAttributes () const {
1656
- return cast<ConstantInt>(const_cast <Value *>( getArgOperand (2 ) ));
1644
+ return cast<ConstantInt>(getArgOperand (2 ));
1657
1645
}
1658
1646
1659
- ConstantInt *getFactor () const {
1660
- return cast<ConstantInt>(const_cast <Value *>(getArgOperand (3 )));
1661
- }
1647
+ ConstantInt *getFactor () const { return cast<ConstantInt>(getArgOperand (3 )); }
1662
1648
};
1663
1649
1664
1650
class NoAliasScopeDeclInst : public IntrinsicInst {
0 commit comments