@@ -1416,7 +1416,7 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV,
1416
1416
assert (RD && " RewriteObjCIvarRefExpr(): Can't find RecordDecl" );
1417
1417
QualType castT = Context->getPointerType (Context->getTagDeclType (RD));
1418
1418
CastExpr *castExpr = NoTypeInfoCStyleCastExpr (Context, castT,
1419
- CK_Unknown ,
1419
+ CK_BitCast ,
1420
1420
IV->getBase ());
1421
1421
// Don't forget the parens to enforce the proper binding.
1422
1422
ParenExpr *PE = new (Context) ParenExpr (IV->getBase ()->getLocStart (),
@@ -1461,7 +1461,7 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV,
1461
1461
assert (RD && " RewriteObjCIvarRefExpr(): Can't find RecordDecl" );
1462
1462
QualType castT = Context->getPointerType (Context->getTagDeclType (RD));
1463
1463
CastExpr *castExpr = NoTypeInfoCStyleCastExpr (Context, castT,
1464
- CK_Unknown ,
1464
+ CK_BitCast ,
1465
1465
IV->getBase ());
1466
1466
// Don't forget the parens to enforce the proper binding.
1467
1467
ParenExpr *PE = new (Context) ParenExpr (IV->getBase ()->getLocStart (),
@@ -1797,7 +1797,7 @@ Stmt *RewriteObjC::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1797
1797
std::string syncBuf;
1798
1798
syncBuf += " objc_sync_exit(" ;
1799
1799
Expr *syncExpr = NoTypeInfoCStyleCastExpr (Context, Context->getObjCIdType (),
1800
- CK_Unknown ,
1800
+ CK_BitCast ,
1801
1801
S->getSynchExpr ());
1802
1802
std::string syncExprBufS;
1803
1803
llvm::raw_string_ostream syncExprBuf (syncExprBufS);
@@ -2140,7 +2140,7 @@ CallExpr *RewriteObjC::SynthesizeCallToFunctionDecl(
2140
2140
// Now, we cast the reference to a pointer to the objc_msgSend type.
2141
2141
QualType pToFunc = Context->getPointerType (msgSendType);
2142
2142
ImplicitCastExpr *ICE =
2143
- ImplicitCastExpr::Create (*Context, pToFunc, CK_Unknown ,
2143
+ ImplicitCastExpr::Create (*Context, pToFunc, CK_FunctionToPointerDecay ,
2144
2144
DRE, 0 , VK_RValue);
2145
2145
2146
2146
const FunctionType *FT = msgSendType->getAs <FunctionType>();
@@ -2668,7 +2668,7 @@ Stmt *RewriteObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
2668
2668
SourceLocation ());
2669
2669
// cast to NSConstantString *
2670
2670
CastExpr *cast = NoTypeInfoCStyleCastExpr (Context, Exp->getType (),
2671
- CK_Unknown , Unop);
2671
+ CK_BitCast , Unop);
2672
2672
ReplaceStmt (Exp, cast);
2673
2673
// delete Exp; leak for now, see RewritePropertyOrImplicitSetter() usage for more info.
2674
2674
return cast;
@@ -2782,7 +2782,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2782
2782
// set the receiver to self, the first argument to all methods.
2783
2783
InitExprs.push_back (
2784
2784
NoTypeInfoCStyleCastExpr (Context, Context->getObjCIdType (),
2785
- CK_Unknown ,
2785
+ CK_BitCast ,
2786
2786
new (Context) DeclRefExpr (CurMethodDef->getSelfDecl (),
2787
2787
Context->getObjCIdType (),
2788
2788
SourceLocation ()))
@@ -2803,7 +2803,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2803
2803
// (Class)objc_getClass("CurrentClass")
2804
2804
CastExpr *ArgExpr = NoTypeInfoCStyleCastExpr (Context,
2805
2805
Context->getObjCClassType (),
2806
- CK_Unknown , Cls);
2806
+ CK_BitCast , Cls);
2807
2807
ClsExprs.clear ();
2808
2808
ClsExprs.push_back (ArgExpr);
2809
2809
Cls = SynthesizeCallToFunctionDecl (GetSuperClassFunctionDecl,
@@ -2815,7 +2815,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2815
2815
InitExprs.push_back ( // set 'super class', using class_getSuperclass().
2816
2816
NoTypeInfoCStyleCastExpr (Context,
2817
2817
Context->getObjCIdType (),
2818
- CK_Unknown , Cls));
2818
+ CK_BitCast , Cls));
2819
2819
// struct objc_super
2820
2820
QualType superType = getSuperStructType ();
2821
2821
Expr *SuperRep;
@@ -2839,7 +2839,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2839
2839
SourceLocation ());
2840
2840
SuperRep = NoTypeInfoCStyleCastExpr (Context,
2841
2841
Context->getPointerType (superType),
2842
- CK_Unknown , SuperRep);
2842
+ CK_BitCast , SuperRep);
2843
2843
} else {
2844
2844
// (struct objc_super) { <exprs from above> }
2845
2845
InitListExpr *ILE =
@@ -2888,7 +2888,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2888
2888
2889
2889
InitExprs.push_back (
2890
2890
NoTypeInfoCStyleCastExpr (Context, Context->getObjCIdType (),
2891
- CK_Unknown ,
2891
+ CK_BitCast ,
2892
2892
new (Context) DeclRefExpr (CurMethodDef->getSelfDecl (),
2893
2893
Context->getObjCIdType (),
2894
2894
SourceLocation ()))
@@ -2908,7 +2908,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2908
2908
// (Class)objc_getClass("CurrentClass")
2909
2909
CastExpr *ArgExpr = NoTypeInfoCStyleCastExpr (Context,
2910
2910
Context->getObjCClassType (),
2911
- CK_Unknown , Cls);
2911
+ CK_BitCast , Cls);
2912
2912
ClsExprs.clear ();
2913
2913
ClsExprs.push_back (ArgExpr);
2914
2914
Cls = SynthesizeCallToFunctionDecl (GetSuperClassFunctionDecl,
@@ -2920,7 +2920,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2920
2920
InitExprs.push_back (
2921
2921
// set 'super class', using class_getSuperclass().
2922
2922
NoTypeInfoCStyleCastExpr (Context, Context->getObjCIdType (),
2923
- CK_Unknown , Cls));
2923
+ CK_BitCast , Cls));
2924
2924
// struct objc_super
2925
2925
QualType superType = getSuperStructType ();
2926
2926
Expr *SuperRep;
@@ -2944,7 +2944,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2944
2944
SourceLocation ());
2945
2945
SuperRep = NoTypeInfoCStyleCastExpr (Context,
2946
2946
Context->getPointerType (superType),
2947
- CK_Unknown , SuperRep);
2947
+ CK_BitCast , SuperRep);
2948
2948
} else {
2949
2949
// (struct objc_super) { <exprs from above> }
2950
2950
InitListExpr *ILE =
@@ -2967,7 +2967,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2967
2967
while (CStyleCastExpr *CE = dyn_cast<CStyleCastExpr>(recExpr))
2968
2968
recExpr = CE->getSubExpr ();
2969
2969
recExpr = NoTypeInfoCStyleCastExpr (Context, Context->getObjCIdType (),
2970
- CK_Unknown , recExpr);
2970
+ CK_BitCast , recExpr);
2971
2971
MsgExprs.push_back (recExpr);
2972
2972
break ;
2973
2973
}
@@ -2997,7 +2997,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
2997
2997
: ICE->getType ();
2998
2998
// Make sure we convert "type (^)(...)" to "type (*)(...)".
2999
2999
(void )convertBlockPointerToFunctionPointer (type);
3000
- userExpr = NoTypeInfoCStyleCastExpr (Context, type, CK_Unknown ,
3000
+ userExpr = NoTypeInfoCStyleCastExpr (Context, type, CK_BitCast ,
3001
3001
userExpr);
3002
3002
}
3003
3003
// Make id<P...> cast into an 'id' cast.
@@ -3006,7 +3006,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
3006
3006
while ((CE = dyn_cast<CStyleCastExpr>(userExpr)))
3007
3007
userExpr = CE->getSubExpr ();
3008
3008
userExpr = NoTypeInfoCStyleCastExpr (Context, Context->getObjCIdType (),
3009
- CK_Unknown , userExpr);
3009
+ CK_BitCast , userExpr);
3010
3010
}
3011
3011
}
3012
3012
MsgExprs.push_back (userExpr);
@@ -3056,7 +3056,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
3056
3056
// xx.m:13: note: if this code is reached, the program will abort
3057
3057
cast = NoTypeInfoCStyleCastExpr (Context,
3058
3058
Context->getPointerType (Context->VoidTy ),
3059
- CK_Unknown , DRE);
3059
+ CK_BitCast , DRE);
3060
3060
3061
3061
// Now do the "normal" pointer to function cast.
3062
3062
QualType castType = Context->getFunctionType (returnType,
@@ -3066,7 +3066,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
3066
3066
false , false , 0 , 0 ,
3067
3067
FunctionType::ExtInfo ());
3068
3068
castType = Context->getPointerType (castType);
3069
- cast = NoTypeInfoCStyleCastExpr (Context, castType, CK_Unknown ,
3069
+ cast = NoTypeInfoCStyleCastExpr (Context, castType, CK_BitCast ,
3070
3070
cast);
3071
3071
3072
3072
// Don't forget the parens to enforce the proper binding.
@@ -3089,15 +3089,15 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
3089
3089
// Need to cast objc_msgSend_stret to "void *" (see above comment).
3090
3090
cast = NoTypeInfoCStyleCastExpr (Context,
3091
3091
Context->getPointerType (Context->VoidTy ),
3092
- CK_Unknown , STDRE);
3092
+ CK_BitCast , STDRE);
3093
3093
// Now do the "normal" pointer to function cast.
3094
3094
castType = Context->getFunctionType (returnType,
3095
3095
&ArgTypes[0 ], ArgTypes.size (),
3096
3096
Exp->getMethodDecl () ? Exp->getMethodDecl ()->isVariadic () : false , 0 ,
3097
3097
false , false , 0 , 0 ,
3098
3098
FunctionType::ExtInfo ());
3099
3099
castType = Context->getPointerType (castType);
3100
- cast = NoTypeInfoCStyleCastExpr (Context, castType, CK_Unknown ,
3100
+ cast = NoTypeInfoCStyleCastExpr (Context, castType, CK_BitCast ,
3101
3101
cast);
3102
3102
3103
3103
// Don't forget the parens to enforce the proper binding.
@@ -3179,7 +3179,7 @@ Stmt *RewriteObjC::RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp) {
3179
3179
Context->getPointerType (DRE->getType ()),
3180
3180
SourceLocation ());
3181
3181
CastExpr *castExpr = NoTypeInfoCStyleCastExpr (Context, DerefExpr->getType (),
3182
- CK_Unknown ,
3182
+ CK_BitCast ,
3183
3183
DerefExpr);
3184
3184
ReplaceStmt (Exp, castExpr);
3185
3185
ProtocolExprDecls.insert (Exp->getProtocol ());
@@ -4709,7 +4709,7 @@ Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) {
4709
4709
PtrToFuncCastType = Context->getPointerType (PtrToFuncCastType);
4710
4710
4711
4711
CastExpr *BlkCast = NoTypeInfoCStyleCastExpr (Context, PtrBlock,
4712
- CK_Unknown ,
4712
+ CK_BitCast ,
4713
4713
const_cast <Expr*>(BlockExp));
4714
4714
// Don't forget the parens to enforce the proper binding.
4715
4715
ParenExpr *PE = new (Context) ParenExpr (SourceLocation (), SourceLocation (),
@@ -4724,7 +4724,7 @@ Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) {
4724
4724
4725
4725
4726
4726
CastExpr *FunkCast = NoTypeInfoCStyleCastExpr (Context, PtrToFuncCastType,
4727
- CK_Unknown , ME);
4727
+ CK_BitCast , ME);
4728
4728
PE = new (Context) ParenExpr (SourceLocation (), SourceLocation (), FunkCast);
4729
4729
4730
4730
llvm::SmallVector<Expr*, 8 > BlkExprs;
@@ -5344,7 +5344,7 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
5344
5344
DeclRefExpr *Arg = new (Context) DeclRefExpr (FD, FD->getType (),
5345
5345
SourceLocation ());
5346
5346
CastExpr *castExpr = NoTypeInfoCStyleCastExpr (Context, Context->VoidPtrTy ,
5347
- CK_Unknown , Arg);
5347
+ CK_BitCast , Arg);
5348
5348
InitExprs.push_back (castExpr);
5349
5349
5350
5350
// Initialize the block descriptor.
@@ -5382,7 +5382,7 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
5382
5382
FD = SynthBlockInitFunctionDecl ((*I)->getName ());
5383
5383
Arg = new (Context) DeclRefExpr (FD, FD->getType (), SourceLocation ());
5384
5384
Exp = NoTypeInfoCStyleCastExpr (Context, Context->VoidPtrTy ,
5385
- CK_Unknown , Arg);
5385
+ CK_BitCast , Arg);
5386
5386
} else {
5387
5387
FD = SynthBlockInitFunctionDecl ((*I)->getName ());
5388
5388
Exp = new (Context) DeclRefExpr (FD, FD->getType (), SourceLocation ());
@@ -5415,7 +5415,7 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
5415
5415
Exp = new (Context) UnaryOperator (Exp, UO_AddrOf,
5416
5416
Context->getPointerType (Exp->getType ()),
5417
5417
SourceLocation ());
5418
- Exp = NoTypeInfoCStyleCastExpr (Context, castT, CK_Unknown , Exp);
5418
+ Exp = NoTypeInfoCStyleCastExpr (Context, castT, CK_BitCast , Exp);
5419
5419
InitExprs.push_back (Exp);
5420
5420
}
5421
5421
}
@@ -5433,7 +5433,7 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
5433
5433
NewRep = new (Context) UnaryOperator (NewRep, UO_AddrOf,
5434
5434
Context->getPointerType (NewRep->getType ()),
5435
5435
SourceLocation ());
5436
- NewRep = NoTypeInfoCStyleCastExpr (Context, FType, CK_Unknown ,
5436
+ NewRep = NoTypeInfoCStyleCastExpr (Context, FType, CK_BitCast ,
5437
5437
NewRep);
5438
5438
BlockDeclRefs.clear ();
5439
5439
BlockByRefDecls.clear ();
0 commit comments