aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2007-12-04 22:32:58 +0000
committerFariborz Jahanian <fjahanian@apple.com>2007-12-04 22:32:58 +0000
commitceee3e834779ff6c5ed59a2a99b1bef44ba10cd5 (patch)
treecc94b590c0a458a610fca10fa01e7461c627b63b /Driver/RewriteTest.cpp
parente2c4cd899844a22b77d596b3928fc9ec9ea6fce4 (diff)
Type-cast initializers for "struct objc_super" parameter to avoid warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r--Driver/RewriteTest.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index 0e93d3176d..c197705f50 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -1320,7 +1320,9 @@ Stmt *RewriteTest::RewriteMessageExpr(ObjCMessageExpr *Exp) {
llvm::SmallVector<Expr*, 4> InitExprs;
- InitExprs.push_back(recExpr); // set the 'receiver'.
+ InitExprs.push_back(
+ new CastExpr(Context->getObjcIdType(),
+ recExpr, SourceLocation())); // set the 'receiver'.
llvm::SmallVector<Expr*, 8> ClsExprs;
QualType argType = Context->getPointerType(Context->CharTy);
@@ -1329,8 +1331,12 @@ Stmt *RewriteTest::RewriteMessageExpr(ObjCMessageExpr *Exp) {
false, argType, SourceLocation(),
SourceLocation()));
CallExpr *Cls = SynthesizeCallToFunctionDecl(GetClassFunctionDecl,
- &ClsExprs[0], ClsExprs.size());
- InitExprs.push_back(Cls); // set 'super class', using objc_getClass().
+ &ClsExprs[0],
+ ClsExprs.size());
+ // To turn off a warning, type-cast to 'Class'
+ InitExprs.push_back(
+ new CastExpr(Context->getObjcClassType(),
+ Cls, SourceLocation())); // set 'super class', using objc_getClass().
// struct objc_super
QualType superType = getSuperStructType();
// (struct objc_super) { <exprs from above> }