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