//===-- MachineCodeEmitter.cpp - Implement the MachineCodeEmitter itf -----===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
//
// This file implements the MachineCodeEmitter interface.
//
#include "llvm/Function.h"
#include <fstream>
+namespace llvm {
+
namespace {
struct DebugMachineCodeEmitter : public MachineCodeEmitter {
void startFunction(MachineFunction &F) {
return 0;
}
};
-}
-
-
-/// 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::createDebugEmitter() {
- return new DebugMachineCodeEmitter();
-}
-namespace {
class FilePrinterEmitter : public MachineCodeEmitter {
std::ofstream actual;
std::ostream &o;
MCE.finishFunction(F);
}
+ void emitConstantPool(MachineConstantPool *MCP) {
+ MCE.emitConstantPool(MCP);
+ }
+
void startFunctionStub(const Function &F, unsigned StubSize) {
MCE.startFunctionStub(F, StubSize);
}
};
}
+/// 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::createDebugEmitter() {
+ return new DebugMachineCodeEmitter();
+}
+
MachineCodeEmitter *
MachineCodeEmitter::createFilePrinterEmitter(MachineCodeEmitter &MCE) {
return new FilePrinterEmitter(MCE, std::cerr);
}
+
+} // End llvm namespace