brg
authorBrian Gaeke <gaeke@uiuc.edu>
Sun, 22 Dec 2002 18:53:23 +0000 (18:53 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Sun, 22 Dec 2002 18:53:23 +0000 (18:53 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5112 91177308-0d34-0410-b5e6-96231b3b80d8

tools/jello/GlobalVars.cpp

index 77f274295d2d393066709430cc5cacb302bfe844..17495953da2c6dec4b2c1c2b84e282c9539702d2 100644 (file)
@@ -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::emitGlobals() {
 ///
 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: