From 9af6a5d5fe313a70261217b21f0f9f891a82cad3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 3 Dec 2002 06:09:26 +0000 Subject: [PATCH] Implement trivially simple debugger for MachineCodeEmitter interface llvm-svn: 4880 --- llvm/tools/jello/jello.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/llvm/tools/jello/jello.cpp b/llvm/tools/jello/jello.cpp index aaf115a675ae..879076f9d629 100644 --- a/llvm/tools/jello/jello.cpp +++ b/llvm/tools/jello/jello.cpp @@ -18,10 +18,23 @@ #include "llvm/CodeGen/MachineCodeEmitter.h" - +#include "llvm/CodeGen/MachineFunction.h" struct JelloMachineCodeEmitter : public MachineCodeEmitter { + void startFunction(MachineFunction &F) { + std::cout << "\n**** Writing machine code for function: " + << F.getFunction()->getName() << "\n"; + } + void startBasicBlock(MachineBasicBlock &BB) { + std::cout << "\n--- Basic Block: " << BB.getBasicBlock()->getName() << "\n"; + } + void emitByte(unsigned char B) { + std::cout << "0x" << std::hex << (unsigned int)B << std::dec << " "; + } + void emitPCRelativeDisp(Value *V) { + std::cout << "<" << V->getName() << ": 0x00 0x00 0x00 0x00> "; + } };