This patch introduces a new class to keep track of class implementation info. It also adds more 
semantic checks for class and protocol declarations. Test cases are good indications of kind of 
checking being done in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42311 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index bde4b6b..c0a77a2 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -32,6 +32,7 @@
 static unsigned nForwardProtocolDecls = 0;
 static unsigned nCategoryDecls = 0;
 static unsigned nIvarDecls = 0;
+static unsigned nObjcImplementationDecls = 0;
 
 static bool StatSwitch = false;
 
@@ -132,6 +133,10 @@
 	  nCategoryDecls, (int)sizeof(ObjcCategoryDecl),
 	  int(nCategoryDecls*sizeof(ObjcCategoryDecl)));
 
+  fprintf(stderr, "    %d class implementation decls, %d each (%d bytes)\n", 
+	  nObjcImplementationDecls, (int)sizeof(ObjcImplementationDecl),
+	  int(nObjcImplementationDecls*sizeof(ObjcImplementationDecl)));
+
   fprintf(stderr, "Total bytes = %d\n", 
 	  int(nFuncs*sizeof(FunctionDecl)+nBlockVars*sizeof(BlockVarDecl)+
 	      nFileVars*sizeof(FileVarDecl)+nParmVars*sizeof(ParmVarDecl)+
@@ -193,6 +198,9 @@
     case ObjcIvar:
       nIvarDecls++;
       break;
+    case ObjcImplementation: 
+      nObjcImplementationDecls++;
+      break;
   }
 }