X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FMachineCodeEmitter.cpp;h=81b49784c05237f5e6a7f287c0a6626f110fc794;hb=79844fc3d269d2fccee1de3e0b8b6c374ce63ff2;hp=dc2d0d658be051aba8258e0734a8a3bd1fc7b643;hpb=7775df1a6c499bb24479d1f0e1420ba89f686fbb;p=oota-llvm.git diff --git a/lib/CodeGen/MachineCodeEmitter.cpp b/lib/CodeGen/MachineCodeEmitter.cpp index dc2d0d658be..81b49784c05 100644 --- a/lib/CodeGen/MachineCodeEmitter.cpp +++ b/lib/CodeGen/MachineCodeEmitter.cpp @@ -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 - -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 << "getName() << ": 0xXX 0xXX 0xXX 0xXX> "; - } - void emitGlobalAddress(GlobalValue *V, bool isPCRelative) { - std::cout << "getName() << ": 0xXX 0xXX 0xXX 0xXX> "; - } - void emitGlobalAddress(const std::string &Name, bool isPCRelative) { - std::cout << " "; - } - - void emitFunctionConstantValueAddress(unsigned ConstantNum, int 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() { }