llvm-6502/include/llvm/CodeGen/MachineCodeEmitter.h
Chris Lattner 8562d4ec7c More support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4873 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:56:28 +00:00

47 lines
1.5 KiB
C++

//===-- 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
class MachineFunction;
class MachineBasicBlock;
class Value;
struct MachineCodeEmitter {
/// startFunction - This callback is invoked when the specified function is
/// about to be code generated.
///
virtual void startFunction(MachineFunction &F) {}
/// 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) {}
/// emitByte - This callback is invoked when a byte needs to be written to the
/// output stream.
///
virtual void emitByte(unsigned char B) {}
/// emitPCRelativeDisp - This callback is invoked when we need to write out a
/// PC relative displacement for the specified Value*. This is used for call
/// and jump instructions typically.
///
virtual void emitPCRelativeDisp(Value *V) {}
};
#endif