[cfe-commits] r44583 - /cfe/trunk/Driver/RewriteTest.cpp

Fariborz Jahanian fjahanian at apple.com
Tue Dec 4 14:33:00 PST 2007


Author: fjahanian
Date: Tue Dec  4 16:32:58 2007
New Revision: 44583

URL: http://llvm.org/viewvc/llvm-project?rev=44583&view=rev
Log:
Type-cast initializers for "struct objc_super" parameter to avoid warning.

Modified:
    cfe/trunk/Driver/RewriteTest.cpp

Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=44583&r1=44582&r2=44583&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Tue Dec  4 16:32:58 2007
@@ -1320,7 +1320,9 @@
       
       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 @@
                                            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> }





More information about the cfe-commits mailing list