[cfe-commits] r54604 - /cfe/trunk/lib/AST/DeclBase.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Sat Aug 9 18:47:31 PDT 2008
Author: akirtzidis
Date: Sat Aug 9 20:47:31 2008
New Revision: 54604
URL: http://llvm.org/viewvc/llvm-project?rev=54604&view=rev
Log:
Add some C++ Decl statistics.
Modified:
cfe/trunk/lib/AST/DeclBase.cpp
Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=54604&r1=54603&r2=54604&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Sat Aug 9 20:47:31 2008
@@ -26,11 +26,13 @@
static unsigned nVars = 0;
static unsigned nParmVars = 0;
static unsigned nSUC = 0;
+static unsigned nCXXSUC = 0;
static unsigned nEnumConst = 0;
static unsigned nEnumDecls = 0;
static unsigned nNamespaces = 0;
static unsigned nTypedef = 0;
static unsigned nFieldDecls = 0;
+static unsigned nCXXFieldDecls = 0;
static unsigned nInterfaceDecls = 0;
static unsigned nClassDecls = 0;
static unsigned nMethodDecls = 0;
@@ -85,7 +87,7 @@
void Decl::PrintStats() {
fprintf(stderr, "*** Decl Stats:\n");
fprintf(stderr, " %d decls total.\n",
- int(nFuncs+nVars+nParmVars+nFieldDecls+nSUC+
+ int(nFuncs+nVars+nParmVars+nFieldDecls+nSUC+nCXXFieldDecls+nCXXSUC+
nEnumDecls+nEnumConst+nTypedef+nInterfaceDecls+nClassDecls+
nMethodDecls+nProtocolDecls+nCategoryDecls+nIvarDecls+
nNamespaces));
@@ -106,6 +108,12 @@
fprintf(stderr, " %d struct/union/class decls, %d each (%d bytes)\n",
nSUC, (int)sizeof(RecordDecl),
int(nSUC*sizeof(RecordDecl)));
+ fprintf(stderr, " %d C++ field decls, %d each (%d bytes)\n",
+ nCXXFieldDecls, (int)sizeof(CXXFieldDecl),
+ int(nCXXFieldDecls*sizeof(CXXFieldDecl)));
+ fprintf(stderr, " %d C++ struct/union/class decls, %d each (%d bytes)\n",
+ nCXXSUC, (int)sizeof(CXXRecordDecl),
+ int(nCXXSUC*sizeof(CXXRecordDecl)));
fprintf(stderr, " %d enum decls, %d each (%d bytes)\n",
nEnumDecls, (int)sizeof(EnumDecl),
int(nEnumDecls*sizeof(EnumDecl)));
@@ -161,6 +169,7 @@
int(nFuncs*sizeof(FunctionDecl)+
nVars*sizeof(VarDecl)+nParmVars*sizeof(ParmVarDecl)+
nFieldDecls*sizeof(FieldDecl)+nSUC*sizeof(RecordDecl)+
+ nCXXFieldDecls*sizeof(CXXFieldDecl)+nCXXSUC*sizeof(CXXRecordDecl)+
nEnumDecls*sizeof(EnumDecl)+nEnumConst*sizeof(EnumConstantDecl)+
nTypedef*sizeof(TypedefDecl)+
nInterfaceDecls*sizeof(ObjCInterfaceDecl)+
@@ -209,9 +218,9 @@
case ImplicitParam:
case TranslationUnit: break;
+ case CXXField: nCXXFieldDecls++; break;
+ case CXXStruct: case CXXUnion: case CXXClass: nCXXSUC++; break;
// FIXME: Statistics for C++ decls.
- case CXXField:
- case CXXStruct: case CXXUnion: case CXXClass:
case CXXMethod:
case CXXClassVar:
break;
More information about the cfe-commits
mailing list