diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-03-21 18:06:45 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-03-21 18:06:45 +0000 |
commit | b31cb7f1752ea011fd06ac9574ce24667d11cbdb (patch) | |
tree | 464b764f2785774079b1c05392bb5dca1590e20b /lib/CodeGen/CodeGenModule.cpp | |
parent | 5674388eb637999f9de3f6398ddfc6bcfaac75b8 (diff) |
Issue error if variables are defined inside an objc class,
category or protocol.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 93bf6dd8f0..b259a5dc2c 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1270,21 +1270,13 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { // Forward declarations, no (immediate) code generation. case Decl::ObjCClass: case Decl::ObjCForwardProtocol: + case Decl::ObjCCategory: + case Decl::ObjCInterface: break; case Decl::ObjCProtocol: - case Decl::ObjCCategory: - case Decl::ObjCInterface: { - ObjCContainerDecl *OCD = cast<ObjCContainerDecl>(D); - for (ObjCContainerDecl::tuvar_iterator i = OCD->tuvar_begin(), - e = OCD->tuvar_end(); i != e; ++i) { - VarDecl *VD = *i; - EmitGlobal(VD); - } - if (D->getKind() == Decl::ObjCProtocol) - Runtime->GenerateProtocol(cast<ObjCProtocolDecl>(D)); + Runtime->GenerateProtocol(cast<ObjCProtocolDecl>(D)); break; - } case Decl::ObjCCategoryImpl: // Categories have properties but don't support synthesize so we |