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

Chris Lattner lattner at cs.uiuc.edu
Sun Dec 22 12:54:01 PST 2002


Changes in directory llvm/tools/jello:

GlobalVars.cpp updated: 1.3 -> 1.4

---
Log message:

brg

Add statistic for number of bytes of data area initialized.
We used this statistic in collecting data for the paper, but I forgot
to commit it.


---
Diffs of the changes:

Index: llvm/tools/jello/GlobalVars.cpp
diff -u llvm/tools/jello/GlobalVars.cpp:1.3 llvm/tools/jello/GlobalVars.cpp:1.4
--- llvm/tools/jello/GlobalVars.cpp:1.3	Fri Dec 13 07:15:36 2002
+++ llvm/tools/jello/GlobalVars.cpp	Sun Dec 22 12:53:23 2002
@@ -12,6 +12,8 @@
 #include "VM.h"
 #include <iostream>
 
+Statistic<> NumInitBytes("jello", "Number of bytes of data area initialized");
+
 /// EmitGlobals - Emit all of the global variables to memory, storing their
 /// addresses into GlobalAddress.  This must make sure to copy the contents of
 /// their initializers into the memory.
@@ -48,6 +50,7 @@
 ///
 void VM::emitConstantToMemory(Constant *Init, void *Addr) {
   const TargetData &TD = TM.getTargetData();
+  NumInitBytes += TD.getTypeSize (Init->getType ());
   if (ConstantIntegral *CI = dyn_cast<ConstantIntegral>(Init)) {
     switch (CI->getType()->getPrimitiveID()) {
     case Type::BoolTyID:





More information about the llvm-commits mailing list