silence a bunch of warnings, fix some funky indentation.

llvm-svn: 39487
This commit is contained in:
Chris Lattner 2007-05-24 00:40:54 +00:00
parent 6ba4ef5325
commit fc234de388
2 changed files with 70 additions and 61 deletions

View File

@ -85,10 +85,11 @@ void ASTContext::PrintStats() const {
fprintf(stderr, " %d union types\n", NumTagUnion); fprintf(stderr, " %d union types\n", NumTagUnion);
fprintf(stderr, " %d class types\n", NumTagClass); fprintf(stderr, " %d class types\n", NumTagClass);
fprintf(stderr, " %d enum types\n", NumTagEnum); 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)+ NumPointer*sizeof(PointerType)+NumArray*sizeof(ArrayType)+
NumFunctionP*sizeof(FunctionTypeProto)+NumFunctionNP*sizeof(FunctionTypeNoProto)+ NumFunctionP*sizeof(FunctionTypeProto)+
NumTypeName*sizeof(TypedefType)+NumTagged*sizeof(TagType)); NumFunctionNP*sizeof(FunctionTypeNoProto)+
NumTypeName*sizeof(TypedefType)+NumTagged*sizeof(TagType)));
} }

View File

@ -34,67 +34,75 @@ bool Decl::CollectingStats(bool enable) {
} }
void Decl::PrintStats() { void Decl::PrintStats() {
fprintf(stderr, "*** Decl Stats:\n"); fprintf(stderr, "*** Decl Stats:\n");
fprintf(stderr, " %d decls total.\n", fprintf(stderr, " %d decls total.\n",
nFuncs+nBlockVars+nFileVars+nParmVars+nFieldDecls+nSUE+nEnumDecls+nEnumConst+nTypedef); int(nFuncs+nBlockVars+nFileVars+nParmVars+nFieldDecls+nSUE+
fprintf(stderr, " %d function decls, %d each (%d bytes)\n", nEnumDecls+nEnumConst+nTypedef));
nFuncs, sizeof(FunctionDecl), nFuncs*sizeof(FunctionDecl)); fprintf(stderr, " %d function decls, %d each (%d bytes)\n",
fprintf(stderr, " %d block variable decls, %d each (%d bytes)\n", nFuncs, (int)sizeof(FunctionDecl), int(nFuncs*sizeof(FunctionDecl)));
nBlockVars, sizeof(BlockVarDecl), nBlockVars*sizeof(BlockVarDecl)); fprintf(stderr, " %d block variable decls, %d each (%d bytes)\n",
fprintf(stderr, " %d file variable decls, %d each (%d bytes)\n", nBlockVars, (int)sizeof(BlockVarDecl),
nFileVars, sizeof(FileVarDecl), nFileVars*sizeof(FileVarDecl)); int(nBlockVars*sizeof(BlockVarDecl)));
fprintf(stderr, " %d parameter variable decls, %d each (%d bytes)\n", fprintf(stderr, " %d file variable decls, %d each (%d bytes)\n",
nParmVars, sizeof(ParmVarDecl), nParmVars*sizeof(ParmVarDecl)); nFileVars, (int)sizeof(FileVarDecl),
fprintf(stderr, " %d field decls, %d each (%d bytes)\n", int(nFileVars*sizeof(FileVarDecl)));
nFieldDecls, sizeof(FieldDecl), nFieldDecls*sizeof(FieldDecl)); fprintf(stderr, " %d parameter variable decls, %d each (%d bytes)\n",
fprintf(stderr, " %d struct/union/enum decls, %d each (%d bytes)\n", nParmVars, (int)sizeof(ParmVarDecl),
nSUE, sizeof(RecordDecl), nSUE*sizeof(RecordDecl)); int(nParmVars*sizeof(ParmVarDecl)));
fprintf(stderr, " %d enum decls, %d each (%d bytes)\n", fprintf(stderr, " %d field decls, %d each (%d bytes)\n",
nEnumDecls, sizeof(EnumDecl), nEnumDecls*sizeof(EnumDecl)); nFieldDecls, (int)sizeof(FieldDecl),
fprintf(stderr, " %d enum constant decls, %d each (%d bytes)\n", int(nFieldDecls*sizeof(FieldDecl)));
nEnumConst, sizeof(EnumConstantDecl), nEnumConst*sizeof(EnumConstantDecl)); fprintf(stderr, " %d struct/union/enum decls, %d each (%d bytes)\n",
fprintf(stderr, " %d typedef decls, %d each (%d bytes)\n", nSUE, (int)sizeof(RecordDecl),
nTypedef, sizeof(TypedefDecl), nTypedef*sizeof(TypedefDecl)); int(nSUE*sizeof(RecordDecl)));
fprintf(stderr, "Total bytes = %d\n", fprintf(stderr, " %d enum decls, %d each (%d bytes)\n",
nFuncs*sizeof(FunctionDecl)+nBlockVars*sizeof(BlockVarDecl)+ nEnumDecls, (int)sizeof(EnumDecl),
nFileVars*sizeof(FileVarDecl)+nParmVars*sizeof(ParmVarDecl)+ int(nEnumDecls*sizeof(EnumDecl)));
nFieldDecls*sizeof(FieldDecl)+nSUE*sizeof(RecordDecl)+ fprintf(stderr, " %d enum constant decls, %d each (%d bytes)\n",
nEnumDecls*sizeof(EnumDecl)+nEnumConst*sizeof(EnumConstantDecl)+ nEnumConst, (int)sizeof(EnumConstantDecl),
nTypedef*sizeof(TypedefDecl)); 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) { void Decl::addDeclKind(const Kind k) {
switch (k) { switch (k) {
case Typedef: case Typedef:
nTypedef++; nTypedef++;
break; break;
case Function: case Function:
nFuncs++; nFuncs++;
break; break;
case BlockVariable: case BlockVariable:
nBlockVars++; nBlockVars++;
break; break;
case FileVariable: case FileVariable:
nFileVars++; nFileVars++;
break; break;
case ParmVariable: case ParmVariable:
nParmVars++; nParmVars++;
break; break;
case EnumConstant: case EnumConstant:
nEnumConst++; nEnumConst++;
break; break;
case Field: case Field:
nFieldDecls++; nFieldDecls++;
break; break;
case Struct: case Struct:
case Union: case Union:
case Class: case Class:
nSUE++; nSUE++;
break; break;
case Enum: case Enum:
nEnumDecls++; nEnumDecls++;
break; break;
} }
} }
// Out-of-line virtual method providing a home for Decl. // Out-of-line virtual method providing a home for Decl.