@@ -2440,7 +2440,7 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
2440
2440
case CK_BlockPointerToObjCPointerCast:
2441
2441
case CK_AnyPointerToBlockPointerCast:
2442
2442
case CK_BitCast: {
2443
- Value *Src = Visit (const_cast <Expr*>(E) );
2443
+ Value *Src = Visit (E );
2444
2444
llvm::Type *SrcTy = Src->getType ();
2445
2445
llvm::Type *DstTy = ConvertType (DestTy);
2446
2446
@@ -2606,11 +2606,10 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
2606
2606
case CK_AtomicToNonAtomic:
2607
2607
case CK_NonAtomicToAtomic:
2608
2608
case CK_UserDefinedConversion:
2609
- return Visit (const_cast <Expr*>(E) );
2609
+ return Visit (E );
2610
2610
2611
2611
case CK_NoOp: {
2612
- return CE->changesVolatileQualification () ? EmitLoadOfLValue (CE)
2613
- : Visit (const_cast <Expr *>(E));
2612
+ return CE->changesVolatileQualification () ? EmitLoadOfLValue (CE) : Visit (E);
2614
2613
}
2615
2614
2616
2615
case CK_BaseToDerived: {
@@ -2712,10 +2711,10 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
2712
2711
case CK_LValueToRValue:
2713
2712
assert (CGF.getContext ().hasSameUnqualifiedType (E->getType (), DestTy));
2714
2713
assert (E->isGLValue () && " lvalue-to-rvalue applied to r-value!" );
2715
- return Visit (const_cast <Expr*>(E) );
2714
+ return Visit (E );
2716
2715
2717
2716
case CK_IntegralToPointer: {
2718
- Value *Src = Visit (const_cast <Expr*>(E) );
2717
+ Value *Src = Visit (E );
2719
2718
2720
2719
// First, convert to the correct width so that we control the kind of
2721
2720
// extension.
@@ -2768,7 +2767,7 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
2768
2767
case CK_HLSLAggregateSplatCast:
2769
2768
case CK_VectorSplat: {
2770
2769
llvm::Type *DstTy = ConvertType (DestTy);
2771
- Value *Elt = Visit (const_cast <Expr *>(E) );
2770
+ Value *Elt = Visit (E );
2772
2771
// Splat the element across to all elements
2773
2772
llvm::ElementCount NumElements =
2774
2773
cast<llvm::VectorType>(DstTy)->getElementCount ();
@@ -2906,7 +2905,7 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
2906
2905
case CK_HLSLVectorTruncation: {
2907
2906
assert ((DestTy->isVectorType () || DestTy->isBuiltinType ()) &&
2908
2907
" Destination type must be a vector or builtin type." );
2909
- Value *Vec = Visit (const_cast <Expr *>(E) );
2908
+ Value *Vec = Visit (E );
2910
2909
if (auto *VecTy = DestTy->getAs <VectorType>()) {
2911
2910
SmallVector<int > Mask;
2912
2911
unsigned NumElts = VecTy->getNumElements ();
0 commit comments