mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
Implement trivially simple debugger for MachineCodeEmitter interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4880 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b1ed0fc630
commit
ffe6eac6a2
@ -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
Block a user