-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/Function.h"
-#include <iostream>
-
-namespace {
- struct DebugMachineCodeEmitter : public MachineCodeEmitter {
- void startFunction(MachineFunction &F) {
- std::cout << "\n**** Writing machine code for function: "
- << F.getFunction()->getName() << "\n";
- }
- void finishFunction(MachineFunction &F) {
- std::cout << "\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() << ": 0xXX 0xXX 0xXX 0xXX> ";
- }
- };
-}