[cfe-commits] r39487 - in /cfe/cfe/trunk/AST: ASTContext.cpp Decl.cpp
clattner at cs.uiuc.edu
clattner at cs.uiuc.edu
Wed Jul 11 09:44:54 PDT 2007
Author: clattner
Date: Wed Jul 11 11:44:54 2007
New Revision: 39487
URL: http://llvm.org/viewvc/llvm-project?rev=39487&view=rev
Log:
silence a bunch of warnings, fix some funky indentation.
Modified:
cfe/cfe/trunk/AST/ASTContext.cpp
cfe/cfe/trunk/AST/Decl.cpp
Modified: cfe/cfe/trunk/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/ASTContext.cpp?rev=39487&r1=39486&r2=39487&view=diff
==============================================================================
--- cfe/cfe/trunk/AST/ASTContext.cpp (original)
+++ cfe/cfe/trunk/AST/ASTContext.cpp Wed Jul 11 11:44:54 2007
@@ -85,10 +85,11 @@
fprintf(stderr, " %d union types\n", NumTagUnion);
fprintf(stderr, " %d class types\n", NumTagClass);
fprintf(stderr, " %d enum types\n", NumTagEnum);
- fprintf(stderr, "Total bytes = %d\n", NumBuiltin*sizeof(BuiltinType)+
+ fprintf(stderr, "Total bytes = %d\n", int(NumBuiltin*sizeof(BuiltinType)+
NumPointer*sizeof(PointerType)+NumArray*sizeof(ArrayType)+
- NumFunctionP*sizeof(FunctionTypeProto)+NumFunctionNP*sizeof(FunctionTypeNoProto)+
- NumTypeName*sizeof(TypedefType)+NumTagged*sizeof(TagType));
+ NumFunctionP*sizeof(FunctionTypeProto)+
+ NumFunctionNP*sizeof(FunctionTypeNoProto)+
+ NumTypeName*sizeof(TypedefType)+NumTagged*sizeof(TagType)));
}
Modified: cfe/cfe/trunk/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Decl.cpp?rev=39487&r1=39486&r2=39487&view=diff
==============================================================================
--- cfe/cfe/trunk/AST/Decl.cpp (original)
+++ cfe/cfe/trunk/AST/Decl.cpp Wed Jul 11 11:44:54 2007
@@ -34,67 +34,75 @@
}
void Decl::PrintStats() {
- fprintf(stderr, "*** Decl Stats:\n");
- fprintf(stderr, " %d decls total.\n",
- nFuncs+nBlockVars+nFileVars+nParmVars+nFieldDecls+nSUE+nEnumDecls+nEnumConst+nTypedef);
- fprintf(stderr, " %d function decls, %d each (%d bytes)\n",
- nFuncs, sizeof(FunctionDecl), nFuncs*sizeof(FunctionDecl));
- fprintf(stderr, " %d block variable decls, %d each (%d bytes)\n",
- nBlockVars, sizeof(BlockVarDecl), nBlockVars*sizeof(BlockVarDecl));
- fprintf(stderr, " %d file variable decls, %d each (%d bytes)\n",
- nFileVars, sizeof(FileVarDecl), nFileVars*sizeof(FileVarDecl));
- fprintf(stderr, " %d parameter variable decls, %d each (%d bytes)\n",
- nParmVars, sizeof(ParmVarDecl), nParmVars*sizeof(ParmVarDecl));
- fprintf(stderr, " %d field decls, %d each (%d bytes)\n",
- nFieldDecls, sizeof(FieldDecl), nFieldDecls*sizeof(FieldDecl));
- fprintf(stderr, " %d struct/union/enum decls, %d each (%d bytes)\n",
- nSUE, sizeof(RecordDecl), nSUE*sizeof(RecordDecl));
- fprintf(stderr, " %d enum decls, %d each (%d bytes)\n",
- nEnumDecls, sizeof(EnumDecl), nEnumDecls*sizeof(EnumDecl));
- fprintf(stderr, " %d enum constant decls, %d each (%d bytes)\n",
- nEnumConst, sizeof(EnumConstantDecl), nEnumConst*sizeof(EnumConstantDecl));
- fprintf(stderr, " %d typedef decls, %d each (%d bytes)\n",
- nTypedef, sizeof(TypedefDecl), nTypedef*sizeof(TypedefDecl));
- fprintf(stderr, "Total bytes = %d\n",
- nFuncs*sizeof(FunctionDecl)+nBlockVars*sizeof(BlockVarDecl)+
- nFileVars*sizeof(FileVarDecl)+nParmVars*sizeof(ParmVarDecl)+
- nFieldDecls*sizeof(FieldDecl)+nSUE*sizeof(RecordDecl)+
- nEnumDecls*sizeof(EnumDecl)+nEnumConst*sizeof(EnumConstantDecl)+
- nTypedef*sizeof(TypedefDecl));
+ fprintf(stderr, "*** Decl Stats:\n");
+ fprintf(stderr, " %d decls total.\n",
+ int(nFuncs+nBlockVars+nFileVars+nParmVars+nFieldDecls+nSUE+
+ nEnumDecls+nEnumConst+nTypedef));
+ fprintf(stderr, " %d function decls, %d each (%d bytes)\n",
+ nFuncs, (int)sizeof(FunctionDecl), int(nFuncs*sizeof(FunctionDecl)));
+ fprintf(stderr, " %d block variable decls, %d each (%d bytes)\n",
+ nBlockVars, (int)sizeof(BlockVarDecl),
+ int(nBlockVars*sizeof(BlockVarDecl)));
+ fprintf(stderr, " %d file variable decls, %d each (%d bytes)\n",
+ nFileVars, (int)sizeof(FileVarDecl),
+ int(nFileVars*sizeof(FileVarDecl)));
+ fprintf(stderr, " %d parameter variable decls, %d each (%d bytes)\n",
+ nParmVars, (int)sizeof(ParmVarDecl),
+ int(nParmVars*sizeof(ParmVarDecl)));
+ fprintf(stderr, " %d field decls, %d each (%d bytes)\n",
+ nFieldDecls, (int)sizeof(FieldDecl),
+ int(nFieldDecls*sizeof(FieldDecl)));
+ fprintf(stderr, " %d struct/union/enum decls, %d each (%d bytes)\n",
+ nSUE, (int)sizeof(RecordDecl),
+ int(nSUE*sizeof(RecordDecl)));
+ fprintf(stderr, " %d enum decls, %d each (%d bytes)\n",
+ nEnumDecls, (int)sizeof(EnumDecl),
+ int(nEnumDecls*sizeof(EnumDecl)));
+ fprintf(stderr, " %d enum constant decls, %d each (%d bytes)\n",
+ nEnumConst, (int)sizeof(EnumConstantDecl),
+ int(nEnumConst*sizeof(EnumConstantDecl)));
+ fprintf(stderr, " %d typedef decls, %d each (%d bytes)\n",
+ nTypedef, (int)sizeof(TypedefDecl),int(nTypedef*sizeof(TypedefDecl)));
+ fprintf(stderr, "Total bytes = %d\n",
+ int(nFuncs*sizeof(FunctionDecl)+nBlockVars*sizeof(BlockVarDecl)+
+ nFileVars*sizeof(FileVarDecl)+nParmVars*sizeof(ParmVarDecl)+
+ nFieldDecls*sizeof(FieldDecl)+nSUE*sizeof(RecordDecl)+
+ nEnumDecls*sizeof(EnumDecl)+nEnumConst*sizeof(EnumConstantDecl)+
+ nTypedef*sizeof(TypedefDecl)));
}
void Decl::addDeclKind(const Kind k) {
- switch (k) {
- case Typedef:
- nTypedef++;
- break;
- case Function:
- nFuncs++;
- break;
- case BlockVariable:
- nBlockVars++;
- break;
- case FileVariable:
- nFileVars++;
- break;
- case ParmVariable:
- nParmVars++;
- break;
- case EnumConstant:
- nEnumConst++;
- break;
- case Field:
- nFieldDecls++;
- break;
- case Struct:
- case Union:
- case Class:
- nSUE++;
- break;
- case Enum:
- nEnumDecls++;
- break;
- }
+ switch (k) {
+ case Typedef:
+ nTypedef++;
+ break;
+ case Function:
+ nFuncs++;
+ break;
+ case BlockVariable:
+ nBlockVars++;
+ break;
+ case FileVariable:
+ nFileVars++;
+ break;
+ case ParmVariable:
+ nParmVars++;
+ break;
+ case EnumConstant:
+ nEnumConst++;
+ break;
+ case Field:
+ nFieldDecls++;
+ break;
+ case Struct:
+ case Union:
+ case Class:
+ nSUE++;
+ break;
+ case Enum:
+ nEnumDecls++;
+ break;
+ }
}
// Out-of-line virtual method providing a home for Decl.
More information about the cfe-commits
mailing list