Add statistic
authorChris Lattner <sabre@nondot.org>
Fri, 13 Dec 2002 15:28:42 +0000 (15:28 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Dec 2002 15:28:42 +0000 (15:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5026 91177308-0d34-0410-b5e6-96231b3b80d8

tools/jello/Emitter.cpp

index c7876fea9be3c69f05d65e66636633658f4cba11..253a229a3818e09f07a73250f5fc9f3ec9c94ceb 100644 (file)
@@ -12,6 +12,8 @@
 #include "Support/Statistic.h"
 
 namespace {
+  Statistic<> NumBytes("jello", "Number of bytes of machine code compiled");
+
   class Emitter : public MachineCodeEmitter {
     VM &TheVM;
 
@@ -62,9 +64,11 @@ void Emitter::finishFunction(MachineFunction &F) {
   BBRefs.clear();
   BBLocations.clear();
 
-  DEBUG(std::cerr << "Finished Code Generation of Function: "
-                  << F.getFunction()->getName() << ": " << CurByte-CurBlock
-                  << " bytes of text\n");
+  NumBytes += CurByte-CurBlock;
+
+  DEBUG(std::cerr << "Finished CodeGen of [" << std::hex << (unsigned)CurBlock
+                  << std::dec << "] Function: " << F.getFunction()->getName()
+                  << ": " << CurByte-CurBlock << " bytes of text\n");
 }
 
 void Emitter::startBasicBlock(MachineBasicBlock &BB) {