aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2009-08-17 16:35:33 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2009-08-17 16:35:33 +0000
commit0f436560640a1cff5b6d96f80f540770f139453f (patch)
treebec24b4ebf1e85beebac8049081b2148e209bd48 /lib/Sema/Sema.cpp
parentc01b46e2f115bed83f2f6f4a55809bf4003ee015 (diff)
Initial patch to support definitions of id and Class from headers in Objective-C code.
This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable. The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa. Approved by snaroff. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 53a5f6d80f..5425c4fb5a 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -159,6 +159,7 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
);
PushOnScopeChains(IdTypedef, TUScope);
Context.setObjCIdType(Context.getTypeDeclType(IdTypedef));
+ Context.ObjCIdRedefinitionType = Context.getObjCIdType();
}
// Create the built-in typedef for 'Class'.
if (Context.getObjCClassType().isNull()) {
@@ -169,6 +170,7 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
);
PushOnScopeChains(ClassTypedef, TUScope);
Context.setObjCClassType(Context.getTypeDeclType(ClassTypedef));
+ Context.ObjCClassRedefinitionType = Context.getObjCClassType();
}
}