]> granicus.if.org Git - clang/commitdiff
Implement printing for ObjCClassDecl's, patch by Jean-Daniel Dupas!
authorChris Lattner <sabre@nondot.org>
Sat, 21 Jun 2008 21:40:20 +0000 (21:40 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 21 Jun 2008 21:40:20 +0000 (21:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52598 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/ASTConsumers.cpp

index 92add4195e22e136dcc886b19395980534e9a33b..1383a5ed5d2811fe52982fd2c0cf558cff8e11ee 100644 (file)
@@ -97,8 +97,15 @@ void DeclPrinter:: PrintDecl(Decl *D) {
   } else if (ObjCCompatibleAliasDecl *OID = 
              dyn_cast<ObjCCompatibleAliasDecl>(D)) {
     PrintObjCCompatibleAliasDecl(OID);
-  } else if (isa<ObjCClassDecl>(D)) {
-    Out << "@class [printing todo]\n";
+  } else if (ObjCClassDecl *OFCD = dyn_cast<ObjCClassDecl>(D)) {
+    Out << "@class ";
+    ObjCInterfaceDecl **ForwardDecls = OFCD->getForwardDecls();
+    for (unsigned i = 0, e = OFCD->getNumForwardDecls(); i != e; ++i) {
+      const ObjCInterfaceDecl *D = ForwardDecls[i];
+      if (i) Out << ", ";
+      Out << D->getName();
+    }
+    Out << ";\n";
   } else if (TagDecl *TD = dyn_cast<TagDecl>(D)) {
     Out << "Read top-level tag decl: '" << TD->getName() << "'\n";
   } else if (ScopedDecl *SD = dyn_cast<ScopedDecl>(D)) {