//===----------------------------------------------------------------------===//
#include "VM.h"
+#include "Support/Statistic.h"
#include <signal.h>
#include <ucontext.h>
#include <iostream>
unsigned RefAddr = *(unsigned*)ucp->uc_mcontext.gregs[REG_ESP];
RefAddr -= 4; // Backtrack to the reference itself...
- std::cerr << "In SEGV handler! Addr=0x" << std::hex << RefAddr
- << " ESP=0x" << ucp->uc_mcontext.gregs[REG_ESP] << std::dec
- << ": Resolving call to function: "
- << TheVM->getFunctionReferencedName((void*)RefAddr) << "\n";
+ DEBUG(std::cerr << "In SEGV handler! Addr=0x" << std::hex << RefAddr
+ << " ESP=0x" << ucp->uc_mcontext.gregs[REG_ESP] << std::dec
+ << ": Resolving call to function: "
+ << TheVM->getFunctionReferencedName((void*)RefAddr) << "\n");
// Sanity check to make sure this really is a call instruction...
assert(((unsigned char*)RefAddr)[-1] == 0xE8 && "Not a call instr!");
#include "llvm/CodeGen/MachineCodeEmitter.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Function.h"
+#include "Support/Statistic.h"
namespace {
class Emitter : public MachineCodeEmitter {
BBRefs.clear();
BBLocations.clear();
- std::cerr << "Finished Code Generation of Function: "
- << F.getFunction()->getName() << ": " << CurByte-CurBlock
- << " bytes of text\n";
+ DEBUG(std::cerr << "Finished Code Generation of Function: "
+ << F.getFunction()->getName() << ": " << CurByte-CurBlock
+ << " bytes of text\n");
}
void Emitter::startBasicBlock(MachineBasicBlock &BB) {
#include "llvm/DerivedTypes.h"
#include "llvm/Constants.h"
#include "llvm/Target/TargetMachine.h"
+#include "Support/Statistic.h"
#include "VM.h"
#include <iostream>
// Allocate some memory for it!
GlobalAddress[I] = new char[TD.getTypeSize(Ty)];
- std::cerr << "Allocated global '" << I->getName()
- << "' to addr 0x" << std::hex << GlobalAddress[I] << std::dec
- << "\n";
+ DEBUG(std::cerr << "Allocated global '" << I->getName()
+ << "' to addr 0x" << std::hex << GlobalAddress[I] << std::dec
+ << "\n");
} else {
assert(0 && "References to external globals not handled yet!");
}