mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
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
This commit is contained in:
parent
202a2d0e17
commit
e4bdfa6353
@ -6,6 +6,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "VM.h"
|
||||
#include "Support/Statistic.h"
|
||||
#include <signal.h>
|
||||
#include <ucontext.h>
|
||||
#include <iostream>
|
||||
@ -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!");
|
||||
|
@ -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) {
|
||||
|
@ -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 <iostream>
|
||||
|
||||
@ -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!");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user