2002-12-02 21:21:36 +00:00
|
|
|
//===-- llvm/CodeGen/MachineCodeEmitter.h - Code emission -------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// This file defines an abstract interface that is used by the machine code
|
|
|
|
// emission framework to output the code. This allows machine code emission to
|
|
|
|
// be seperated from concerns such as resolution of call targets, and where the
|
|
|
|
// machine code will be written (memory or disk, f.e.).
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
|
|
|
|
#define LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
|
|
|
|
|
2002-12-02 21:44:13 +00:00
|
|
|
class MachineFunction;
|
|
|
|
class MachineBasicBlock;
|
2002-12-02 21:21:36 +00:00
|
|
|
|
2002-12-02 21:44:13 +00:00
|
|
|
struct MachineCodeEmitter {
|
2002-12-02 21:21:36 +00:00
|
|
|
|
2002-12-02 21:44:13 +00:00
|
|
|
/// startFunction - This callback is invoked when the specified function is
|
|
|
|
/// about to be code generated.
|
|
|
|
///
|
|
|
|
virtual void startFunction(MachineFunction &F) {}
|
2002-12-02 21:21:36 +00:00
|
|
|
|
2002-12-02 21:44:13 +00:00
|
|
|
/// finishFunction - This callback is invoked when the specified function has
|
|
|
|
/// finished code generation.
|
|
|
|
///
|
|
|
|
virtual void finishFunction(MachineFunction &F) {}
|
|
|
|
|
|
|
|
/// startBasicBlock - This callback is invoked when a new basic block is about
|
|
|
|
/// to be emitted.
|
|
|
|
///
|
|
|
|
virtual void startBasicBlock(MachineBasicBlock &BB) {}
|
2002-12-02 21:21:36 +00:00
|
|
|
|
2002-12-02 21:44:13 +00:00
|
|
|
/// emitByte - This callback is invoked when a byte needs to be written to the
|
|
|
|
/// output stream.
|
|
|
|
virtual void emitByte(unsigned char B) {}
|
2002-12-02 21:21:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|