@@ -289,8 +289,8 @@ ASTContext::setExternalSource(llvm::OwningPtr<ExternalASTSource> &Source) {
289
289
}
290
290
291
291
void ASTContext::PrintStats () const {
292
- fprintf (stderr, " *** AST Context Stats:\n " ) ;
293
- fprintf (stderr, " %d types total.\n " , ( int )Types. size ()) ;
292
+ llvm::errs () << " \n *** AST Context Stats:\n " ;
293
+ llvm::errs () << " " << Types. size () << " types total.\n " ;
294
294
295
295
unsigned counts[] = {
296
296
#define TYPE (Name, Parent ) 0 ,
@@ -308,40 +308,42 @@ void ASTContext::PrintStats() const {
308
308
unsigned TotalBytes = 0 ;
309
309
#define TYPE (Name, Parent ) \
310
310
if (counts[Idx]) \
311
- fprintf (stderr, " %d %s types\n " , (int )counts[Idx], #Name); \
311
+ llvm::errs () << " " << counts[Idx] << " " << #Name \
312
+ << " types\n " ; \
312
313
TotalBytes += counts[Idx] * sizeof (Name##Type); \
313
314
++Idx;
314
315
#define ABSTRACT_TYPE (Name, Parent )
315
316
#include " clang/AST/TypeNodes.def"
316
317
317
- fprintf (stderr, " Total bytes = %d \n " , int ( TotalBytes)) ;
318
-
318
+ llvm::errs () << " Total bytes = " << TotalBytes << " \n " ;
319
+
319
320
// Implicit special member functions.
320
- fprintf (stderr, " %u/%u implicit default constructors created \n " ,
321
- NumImplicitDefaultConstructorsDeclared,
322
- NumImplicitDefaultConstructors) ;
323
- fprintf (stderr, " %u/%u implicit copy constructors created \n " ,
324
- NumImplicitCopyConstructorsDeclared,
325
- NumImplicitCopyConstructors) ;
321
+ llvm::errs () << NumImplicitDefaultConstructorsDeclared << " / "
322
+ << NumImplicitDefaultConstructors
323
+ << " implicit default constructors created \n " ;
324
+ llvm::errs () << NumImplicitCopyConstructorsDeclared << " / "
325
+ << NumImplicitCopyConstructors
326
+ << " implicit copy constructors created \n " ;
326
327
if (getLangOptions ().CPlusPlus )
327
- fprintf (stderr, " %u/%u implicit move constructors created \n " ,
328
- NumImplicitMoveConstructorsDeclared,
329
- NumImplicitMoveConstructors) ;
330
- fprintf (stderr, " %u/%u implicit copy assignment operators created \n " ,
331
- NumImplicitCopyAssignmentOperatorsDeclared,
332
- NumImplicitCopyAssignmentOperators) ;
328
+ llvm::errs () << NumImplicitMoveConstructorsDeclared << " / "
329
+ << NumImplicitMoveConstructors
330
+ << " implicit move constructors created \n " ;
331
+ llvm::errs () << NumImplicitCopyAssignmentOperatorsDeclared << " / "
332
+ << NumImplicitCopyAssignmentOperators
333
+ << " implicit copy assignment operators created \n " ;
333
334
if (getLangOptions ().CPlusPlus )
334
- fprintf (stderr, " %u/%u implicit move assignment operators created\n " ,
335
- NumImplicitMoveAssignmentOperatorsDeclared,
336
- NumImplicitMoveAssignmentOperators);
337
- fprintf (stderr, " %u/%u implicit destructors created\n " ,
338
- NumImplicitDestructorsDeclared, NumImplicitDestructors);
339
-
335
+ llvm::errs () << NumImplicitMoveAssignmentOperatorsDeclared << " /"
336
+ << NumImplicitMoveAssignmentOperators
337
+ << " implicit move assignment operators created\n " ;
338
+ llvm::errs () << NumImplicitDestructorsDeclared << " /"
339
+ << NumImplicitDestructors
340
+ << " implicit destructors created\n " ;
341
+
340
342
if (ExternalSource.get ()) {
341
- fprintf (stderr, " \n " ) ;
343
+ llvm::errs () << " \n " ;
342
344
ExternalSource->PrintStats ();
343
345
}
344
-
346
+
345
347
BumpAlloc.PrintStats ();
346
348
}
347
349
@@ -6478,4 +6480,3 @@ size_t ASTContext::getSideTableAllocatedMemory() const {
6478
6480
bytes += InstantiatedFromUnnamedFieldDecl.getMemorySize ();
6479
6481
return bytes;
6480
6482
}
6481
-
0 commit comments