diff options
| author | Steve Naroff <snaroff@apple.com> | 2009-04-23 15:15:40 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2009-04-23 15:15:40 +0000 |
| commit | 3c301dc57322696da7818a9c4e042a259092eb43 (patch) | |
| tree | 7f3b7976af3a1944e8b794e4d4c2d99d4eddd1a2 | |
| parent | 2ddea05bcaf1531cd795d2c35051ce31732139f5 (diff) | |
| download | bcm5719-llvm-3c301dc57322696da7818a9c4e042a259092eb43.tar.gz bcm5719-llvm-3c301dc57322696da7818a9c4e042a259092eb43.zip | |
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.
llvm-svn: 69891
| -rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 3 | ||||
| -rw-r--r-- | clang/test/PCH/objc_methods.m | 11 | ||||
| -rw-r--r-- | clang/test/SemaObjC/check-dup-objc-decls-1.m | 4 |
4 files changed, 11 insertions, 9 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 0e2d06eaf38..0502a876a3a 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -2742,7 +2742,7 @@ PCHReader::ReadDeclarationName(const RecordData &Record, unsigned &Idx) { 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: diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index c65b1402be3..7b23b04859e 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -99,8 +99,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc, 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)); } diff --git a/clang/test/PCH/objc_methods.m b/clang/test/PCH/objc_methods.m index 77901c38d40..818c6145ede 100644 --- a/clang/test/PCH/objc_methods.m +++ b/clang/test/PCH/objc_methods.m @@ -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 } diff --git a/clang/test/SemaObjC/check-dup-objc-decls-1.m b/clang/test/SemaObjC/check-dup-objc-decls-1.m index dc9c8f44261..1dfaf090508 100644 --- a/clang/test/SemaObjC/check-dup-objc-decls-1.m +++ b/clang/test/SemaObjC/check-dup-objc-decls-1.m @@ -18,9 +18,9 @@ typedef int OBJECT; // expected-note {{previous definition is here}} @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}} -@interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}} +@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}} { |

