From 629aed9327049b57d609cf8795bc2a54ce1afee8 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Sat, 21 Mar 2009 18:06:45 +0000 Subject: Issue error if variables are defined inside an objc class, category or protocol. llvm-svn: 67450 --- clang/lib/CodeGen/CodeGenModule.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 93bf6dd8f00..b259a5dc2cf 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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(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(D)); + Runtime->GenerateProtocol(cast(D)); break; - } case Decl::ObjCCategoryImpl: // Categories have properties but don't support synthesize so we -- cgit v1.2.3