Safeguard DBG_VALUE handling. Unbreaks the ASAN buildbot.
[oota-llvm.git] / lib / CodeGen / MachineCodeEmitter.cpp
index dc2d0d658be051aba8258e0734a8a3bd1fc7b643..81b49784c05237f5e6a7f287c0a6626f110fc794 100644 (file)
@@ -1,53 +1,14 @@
-//===-- MachineCodeEmitter.cpp - Implement the MachineCodeEmitter itf -----===//
+//===-- llvm/CodeGen/MachineCodeEmitter.cpp - Code emission -----*- C++ -*-===//
 //
-// This file implements the MachineCodeEmitter interface.
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 
 #include "llvm/CodeGen/MachineCodeEmitter.h"
-#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 << "<disp %" << V->getName() << ": 0xXX 0xXX 0xXX 0xXX> ";
-    }
-    void emitGlobalAddress(GlobalValue *V, bool isPCRelative) {
-      std::cout << "<addr %" << V->getName() << ": 0xXX 0xXX 0xXX 0xXX> ";
-    }
-    void emitGlobalAddress(const std::string &Name, bool isPCRelative) {
-      std::cout << "<addr %" << Name << ": 0xXX 0xXX 0xXX 0xXX> ";
-    }
-
-    void emitFunctionConstantValueAddress(unsigned ConstantNum, int Offset) {
-      std::cout << "<addr const#" << ConstantNum;
-      if (Offset) std::cout << " + " << Offset;
-      std::cout << "> ";
-    }
-  };
-}
 
+using namespace llvm;
 
-/// createDebugMachineCodeEmitter - Return a dynamically allocated machine
-/// code emitter, which just prints the opcodes and fields out the cout.  This
-/// can be used for debugging users of the MachineCodeEmitter interface.
-///
-MachineCodeEmitter *MachineCodeEmitter::createDebugMachineCodeEmitter() {
-  return new DebugMachineCodeEmitter();
-}
+void MachineCodeEmitter::anchor() { }