1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
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.

llvm-svn: 5112
This commit is contained in:
Brian Gaeke 2002-12-22 18:53:23 +00:00
parent 6b8e873886
commit 8f7c7a40c5

View 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: