forked from OSchip/llvm-project
Implement trivially simple debugger for MachineCodeEmitter interface
llvm-svn: 4880
This commit is contained in:
parent
9aa0b12f0a
commit
9af6a5d5fe
|
@ -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> ";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue