From 20ff3108fcd2c3bd734dc79efc22ebaa090abd41 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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51835 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ModuleBuilder.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/CodeGen/ModuleBuilder.cpp') diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp index 1184307b86..b37b8d3f01 100644 --- a/lib/CodeGen/ModuleBuilder.cpp +++ b/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-18-g5258