[cfe-commits] r69891 - in /cfe/trunk: lib/Frontend/PCHReader.cpp lib/Sema/SemaDeclObjC.cpp test/PCH/objc_methods.m test/SemaObjC/check-dup-objc-decls-1.m

Steve Naroff snaroff at apple.com
Thu Apr 23 08:15:49 PDT 2009


Author: snaroff
Date: Thu Apr 23 10:15:40 2009
New Revision: 69891

URL: http://llvm.org/viewvc/llvm-project?rev=69891&view=rev
Log:
Sema::ActOnStartClassInterface(): Use PushOnScopeChains().

This enables class recognition to work with PCH. I believe this means we can remove Sema::ObjCInterfaceDecls and it's usage within Sema::LookupName(). Will investigate.

Modified:
    cfe/trunk/lib/Frontend/PCHReader.cpp
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
    cfe/trunk/test/PCH/objc_methods.m
    cfe/trunk/test/SemaObjC/check-dup-objc-decls-1.m

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=69891&r1=69890&r2=69891&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Thu Apr 23 10:15:40 2009
@@ -2742,7 +2742,7 @@
   case DeclarationName::ObjCZeroArgSelector:
   case DeclarationName::ObjCOneArgSelector:
   case DeclarationName::ObjCMultiArgSelector:
-    assert(false && "Unable to de-serialize Objective-C selectors");
+    return DeclarationName(GetSelector(Record, Idx));
     break;
 
   case DeclarationName::CXXConstructorName:

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Apr 23 10:15:40 2009
@@ -99,8 +99,7 @@
       ProcessDeclAttributeList(IDecl, AttrList);
   
     ObjCInterfaceDecls[ClassName] = IDecl;
-    // FIXME: PushOnScopeChains
-    CurContext->addDecl(Context, IDecl);
+    PushOnScopeChains(IDecl, TUScope);
     // Remember that this needs to be removed when the scope is popped.
     TUScope->AddDecl(DeclPtrTy::make(IDecl));
   }

Modified: cfe/trunk/test/PCH/objc_methods.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/objc_methods.m?rev=69891&r1=69890&r2=69891&view=diff

==============================================================================
--- cfe/trunk/test/PCH/objc_methods.m (original)
+++ cfe/trunk/test/PCH/objc_methods.m Thu Apr 23 10:15:40 2009
@@ -1,11 +1,14 @@
 // Test this without pch.
-// FIXME: clang-cc -include %S/objc_methods.h -fsyntax-only -verify %s &&
+// RUN: clang-cc -include %S/objc_methods.h -fsyntax-only -verify %s &&
 
 // Test with pch.
-// FIXME: clang-cc -x=objective-c -emit-pch -o %t %S/objc_methods.h &&
-// FIXME: clang-cc -include-pch %t -fsyntax-only -verify %s 
+// RUN: clang-cc -x=objective-c -emit-pch -o %t %S/objc_methods.h &&
+// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s 
 
 void func() {
- TestPCH *xx = [TestPCH alloc];
+ TestPCH *xx;
+#if 0
+ xx = [TestPCH alloc];
  [xx instMethod];
+#endif
 }

Modified: cfe/trunk/test/SemaObjC/check-dup-objc-decls-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/check-dup-objc-decls-1.m?rev=69891&r1=69890&r2=69891&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/check-dup-objc-decls-1.m (original)
+++ cfe/trunk/test/SemaObjC/check-dup-objc-decls-1.m Thu Apr 23 10:15:40 2009
@@ -18,9 +18,9 @@
 @class OBJECT ;	// expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
 
 
-typedef int Gorf;  // expected-note 2 {{previous definition is here}}
+typedef int Gorf;  // expected-note {{previous definition is here}}
 
- at interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
+ at interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}} expected-note {{previous definition is here}}
 
 void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
 {





More information about the cfe-commits mailing list