aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-11-23 18:04:25 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-11-23 18:04:25 +0000
commit04765ac135e0c4e6b78651c2a287d80a32b2b8b9 (patch)
tree559d1ebf412a2cd1584360af6556094e2c9e9963
parent998c133a3b1cd0c34c52907f3ec2798e0dde7e0e (diff)
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89680 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/Type.cpp1
-rw-r--r--lib/Sema/Sema.cpp2
-rw-r--r--test/Analysis/MissingDealloc.m3
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 7a8d3af2a0..5a2434da3c 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -725,6 +725,7 @@ const char *BuiltinType::getName(const LangOptions &LO) const {
case UndeducedAuto: return "auto";
case ObjCId: return "id";
case ObjCClass: return "Class";
+ case ObjCSel: return "SEL";
}
}
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 62c2e25f52..11729e0dac 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -300,7 +300,7 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
// 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(),
diff --git a/test/Analysis/MissingDealloc.m b/test/Analysis/MissingDealloc.m
index 502973a173..5b8b334901 100644
--- a/test/Analysis/MissingDealloc.m
+++ b/test/Analysis/MissingDealloc.m
@@ -39,8 +39,7 @@ typedef struct objc_selector *SEL;
@end
-// FIXME!! This warning should not come out and is temporarily added so test 'passes'.
-@implementation TestSELs // expected-warning {{Objective-C class 'TestSELs' lacks a 'dealloc' instance method}}
+@implementation TestSELs
- (id)init {
if( (self = [super init]) ) {
a = @selector(a);