Implement trivially simple debugger for MachineCodeEmitter interface
authorChris Lattner <sabre@nondot.org>
Tue, 3 Dec 2002 06:09:26 +0000 (06:09 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 3 Dec 2002 06:09:26 +0000 (06:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4880 91177308-0d34-0410-b5e6-96231b3b80d8

tools/jello/jello.cpp

index aaf115a675ae80773e8a391130d3802a697174ed..879076f9d62974120d71adfb0261b6af54103051 100644 (file)
 
 
 #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> ";
+  }
 };