[cfe-commits] r89680 - in /cfe/trunk: lib/AST/Type.cpp lib/Sema/Sema.cpp test/Analysis/MissingDealloc.m

Fariborz Jahanian fjahanian at apple.com
Mon Nov 23 10:04:25 PST 2009


Author: fjahanian
Date: Mon Nov 23 12:04:25 2009
New Revision: 89680

URL: http://llvm.org/viewvc/llvm-project?rev=89680&view=rev
Log:
Make 'SEL' pointer to a builtin type and not an
objective-c pointer type. This was a serious mishap and
luckily, Ted's test caught that (and patch fixes the test case).


Modified:
    cfe/trunk/lib/AST/Type.cpp
    cfe/trunk/lib/Sema/Sema.cpp
    cfe/trunk/test/Analysis/MissingDealloc.m

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=89680&r1=89679&r2=89680&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Mon Nov 23 12:04:25 2009
@@ -725,6 +725,7 @@
   case UndeducedAuto:     return "auto";
   case ObjCId:            return "id";
   case ObjCClass:         return "Class";
+  case ObjCSel:         return "SEL";
   }
 }
 

Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=89680&r1=89679&r2=89680&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Mon Nov 23 12:04:25 2009
@@ -300,7 +300,7 @@
   // Built-in ObjC types may already be set by PCHReader (hence isNull checks).
   if (Context.getObjCSelType().isNull()) {
     // Create the built-in typedef for 'SEL'.
-    QualType SelT = Context.getObjCObjectPointerType(Context.ObjCBuiltinSelTy);
+    QualType SelT = Context.getPointerType(Context.ObjCBuiltinSelTy);
     DeclaratorInfo *SelInfo = Context.getTrivialDeclaratorInfo(SelT);
     TypedefDecl *SelTypedef
       = TypedefDecl::Create(Context, CurContext, SourceLocation(),

Modified: cfe/trunk/test/Analysis/MissingDealloc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/MissingDealloc.m?rev=89680&r1=89679&r2=89680&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/MissingDealloc.m (original)
+++ cfe/trunk/test/Analysis/MissingDealloc.m Mon Nov 23 12:04:25 2009
@@ -39,8 +39,7 @@
 
 @end
 
-// FIXME!! This warning should not come out and is temporarily added so test 'passes'.
- at implementation TestSELs // expected-warning {{Objective-C class 'TestSELs' lacks a 'dealloc' instance method}}
+ at implementation TestSELs
 - (id)init {
   if( (self = [super init]) ) {
     a = @selector(a);





More information about the cfe-commits mailing list