[llvm-commits] CVS: llvm/tools/jello/Emitter.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Dec 13 09:29:01 PST 2002


Changes in directory llvm/tools/jello:

Emitter.cpp updated: 1.5 -> 1.6

---
Log message:

Add statistic


---
Diffs of the changes:

Index: llvm/tools/jello/Emitter.cpp
diff -u llvm/tools/jello/Emitter.cpp:1.5 llvm/tools/jello/Emitter.cpp:1.6
--- llvm/tools/jello/Emitter.cpp:1.5	Fri Dec 13 07:15:36 2002
+++ llvm/tools/jello/Emitter.cpp	Fri Dec 13 09:28:42 2002
@@ -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 @@
   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) {





More information about the llvm-commits mailing list