From 1200aca76301047e54dfec591c5ed8e5351bbc6a Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sun, 1 Jun 2008 14:13:53 +0000 Subject: Support for code generation of Objective-C top-level language constructs. Implemented by David Chisnall! llvm-svn: 51835 --- clang/lib/CodeGen/ModuleBuilder.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp') diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp index 1184307b865..b37b8d3f01b 100644 --- a/clang/lib/CodeGen/ModuleBuilder.cpp +++ b/clang/lib/CodeGen/ModuleBuilder.cpp @@ -67,6 +67,24 @@ namespace { if (FunctionDecl *FD = dyn_cast(D)) { Builder->EmitFunction(FD); + } else if (isa(D)){ + //Forward declaration. Only used for type checking. + } else if (ObjCProtocolDecl *PD = dyn_cast(D)){ + // Generate Protocol object. + Builder->EmitObjCProtocolImplementation(PD); + } else if (isa(D)){ + //Only used for typechecking. + } else if (ObjCCategoryImplDecl *OCD = dyn_cast(D)){ + // Generate methods, attach to category structure + Builder->EmitObjCCategoryImpl(OCD); + } else if (ObjCImplementationDecl * OID = + dyn_cast(D)){ + // Generate methods, attach to class structure + Builder->EmitObjCClassImplementation(OID); + } else if (isa(D)){ + // Ignore - generated when the implementation decl is CodeGen'd + } else if (ObjCMethodDecl *OMD = dyn_cast(D)){ + Builder->EmitObjCMethod(OMD); } else if (VarDecl *VD = dyn_cast(D)) { if (VD->isFileVarDecl()) Builder->EmitGlobalVarDeclarator(VD); -- cgit v1.2.3