X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FMachineCodeEmitter.cpp;h=81b49784c05237f5e6a7f287c0a6626f110fc794;hb=9bcad42c3aadab118b6ed5f30f2ea0d87228fd3f;hp=d91efe2cc1b5bcf8d99c5815410e3006876c9a00;hpb=e0e72177c0ca447d1d2acab798a7ca2786d5618d;p=oota-llvm.git diff --git a/lib/CodeGen/MachineCodeEmitter.cpp b/lib/CodeGen/MachineCodeEmitter.cpp index d91efe2cc1b..81b49784c05 100644 --- a/lib/CodeGen/MachineCodeEmitter.cpp +++ b/lib/CodeGen/MachineCodeEmitter.cpp @@ -1,61 +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 startFunctionStub(const Function &F, unsigned StubSize) { - std::cout << "\n--- Function stub for function: " << F.getName() << "\n"; - } - void *finishFunctionStub(const Function &F) { - std::cout << "\n"; - return 0; - } - - 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() { }