From e4bdfa6353bbdf38eaa90b2bf254078c23cb4dbe Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Fri, 13 Dec 2002 13:15:36 +0000 Subject: [PATCH] Made status output debug-only (for testing diffs against lli). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5022 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/jello/Callback.cpp | 9 +++++---- tools/jello/Emitter.cpp | 7 ++++--- tools/jello/GlobalVars.cpp | 7 ++++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/jello/Callback.cpp b/tools/jello/Callback.cpp index 0969f194109..b843e106895 100644 --- a/tools/jello/Callback.cpp +++ b/tools/jello/Callback.cpp @@ -6,6 +6,7 @@ //===----------------------------------------------------------------------===// #include "VM.h" +#include "Support/Statistic.h" #include #include #include @@ -26,10 +27,10 @@ static void TrapHandler(int TN, siginfo_t *SI, ucontext_t *ucp) { 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!"); diff --git a/tools/jello/Emitter.cpp b/tools/jello/Emitter.cpp index a9cbed5799b..c7876fea9be 100644 --- a/tools/jello/Emitter.cpp +++ b/tools/jello/Emitter.cpp @@ -9,6 +9,7 @@ #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/Function.h" +#include "Support/Statistic.h" namespace { class Emitter : public MachineCodeEmitter { @@ -61,9 +62,9 @@ void Emitter::finishFunction(MachineFunction &F) { 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) { diff --git a/tools/jello/GlobalVars.cpp b/tools/jello/GlobalVars.cpp index b13511c0460..77f274295d2 100644 --- a/tools/jello/GlobalVars.cpp +++ b/tools/jello/GlobalVars.cpp @@ -8,6 +8,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Constants.h" #include "llvm/Target/TargetMachine.h" +#include "Support/Statistic.h" #include "VM.h" #include @@ -28,9 +29,9 @@ void VM::emitGlobals() { // 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!"); }