aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/ModuleBuilder.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-06-01 14:13:53 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-06-01 14:13:53 +0000
commit1200aca76301047e54dfec591c5ed8e5351bbc6a (patch)
tree00237cad852136c8980b89153010ba2e02ea9f61 /clang/lib/CodeGen/ModuleBuilder.cpp
parent0397cd2ec4356d77f044977c3e12600399e6f109 (diff)
downloadllvm-1200aca76301047e54dfec591c5ed8e5351bbc6a.zip
llvm-1200aca76301047e54dfec591c5ed8e5351bbc6a.tar.gz
llvm-1200aca76301047e54dfec591c5ed8e5351bbc6a.tar.bz2
Support for code generation of Objective-C top-level language constructs.
Implemented by David Chisnall! llvm-svn: 51835
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
-rw-r--r--clang/lib/CodeGen/ModuleBuilder.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp
index 1184307..b37b8d3 100644
--- a/clang/lib/CodeGen/ModuleBuilder.cpp
+++ b/clang/lib/CodeGen/ModuleBuilder.cpp
@@ -67,6 +67,24 @@ namespace {
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
Builder->EmitFunction(FD);
+ } else if (isa<ObjCClassDecl>(D)){
+ //Forward declaration. Only used for type checking.
+ } else if (ObjCProtocolDecl *PD = dyn_cast<ObjCProtocolDecl>(D)){
+ // Generate Protocol object.
+ Builder->EmitObjCProtocolImplementation(PD);
+ } else if (isa<ObjCCategoryDecl>(D)){
+ //Only used for typechecking.
+ } else if (ObjCCategoryImplDecl *OCD = dyn_cast<ObjCCategoryImplDecl>(D)){
+ // Generate methods, attach to category structure
+ Builder->EmitObjCCategoryImpl(OCD);
+ } else if (ObjCImplementationDecl * OID =
+ dyn_cast<ObjCImplementationDecl>(D)){
+ // Generate methods, attach to class structure
+ Builder->EmitObjCClassImplementation(OID);
+ } else if (isa<ObjCInterfaceDecl>(D)){
+ // Ignore - generated when the implementation decl is CodeGen'd
+ } else if (ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)){
+ Builder->EmitObjCMethod(OMD);
} else if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
if (VD->isFileVarDecl())
Builder->EmitGlobalVarDeclarator(VD);