LLVM API Documentation

llvm::MachineCodeEmitter Class Reference

#include <MachineCodeEmitter.h>

Inheritance diagram for llvm::MachineCodeEmitter:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~MachineCodeEmitter ()
virtual void startFunction (MachineFunction &F)
virtual void finishFunction (MachineFunction &F)
virtual void emitConstantPool (MachineConstantPool *MCP)
virtual void startFunctionStub (unsigned StubSize)
virtual void * finishFunctionStub (const Function *F)
virtual void emitByte (unsigned char B)
virtual void emitWordAt (unsigned W, unsigned *Ptr)
virtual void emitWord (unsigned W)=0
virtual uint64_t getCurrentPCValue ()=0
virtual uint64_t getCurrentPCOffset ()=0
virtual void addRelocation (const MachineRelocation &MR)=0
virtual uint64_t getConstantPoolEntryAddress (unsigned Index)=0
virtual unsigned char * allocateGlobal (unsigned size, unsigned alignment)=0

Static Public Member Functions

static MachineCodeEmittercreateDebugEmitter ()
static MachineCodeEmittercreateFilePrinterEmitter (MachineCodeEmitter &)

Detailed Description

Definition at line 32 of file MachineCodeEmitter.h.


Constructor & Destructor Documentation

virtual llvm::MachineCodeEmitter::~MachineCodeEmitter (  )  [inline, virtual]

Definition at line 34 of file MachineCodeEmitter.h.


Member Function Documentation

virtual void llvm::MachineCodeEmitter::addRelocation ( const MachineRelocation MR  )  [pure virtual]

addRelocation - Whenever a relocatable address is needed, it should be noted with this interface.

Implemented in llvm::ELFCodeEmitter.

virtual unsigned char* llvm::MachineCodeEmitter::allocateGlobal ( unsigned  size,
unsigned  alignment 
) [pure virtual]

Implemented in llvm::ELFCodeEmitter.

MachineCodeEmitter * MachineCodeEmitter::createDebugEmitter (  )  [static]

createDebugEmitter - 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.

Definition at line 170 of file MachineCodeEmitter.cpp.

MachineCodeEmitter * MachineCodeEmitter::createFilePrinterEmitter ( MachineCodeEmitter  )  [static]

createFilePrinterEmitter - Return a dynamically allocated machine code emitter, which prints binary code to a file. This can be used for debugging users of the MachineCodeEmitter interface.

Definition at line 175 of file MachineCodeEmitter.cpp.

References MCE.

virtual void llvm::MachineCodeEmitter::emitByte ( unsigned char  B  )  [inline, virtual]

emitByte - This callback is invoked when a byte needs to be written to the output stream.

Reimplemented in llvm::ELFCodeEmitter.

Definition at line 65 of file MachineCodeEmitter.h.

Referenced by llvm::X86JITInfo::emitFunctionStub().

virtual void llvm::MachineCodeEmitter::emitConstantPool ( MachineConstantPool MCP  )  [inline, virtual]

emitConstantPool - This callback is invoked to output the constant pool for the function.

Reimplemented in llvm::ELFCodeEmitter.

Definition at line 48 of file MachineCodeEmitter.h.

Referenced by llvm::SparcV9CodeEmitter::runOnMachineFunction().

virtual void llvm::MachineCodeEmitter::emitWord ( unsigned  W  )  [pure virtual]

emitWord - This callback is invoked when a word needs to be written to the output stream.

Implemented in llvm::ELFCodeEmitter.

Referenced by llvm::X86JITInfo::emitFunctionStub(), llvm::SparcV9JITInfo::emitFunctionStub(), llvm::PPCJITInfo::emitFunctionStub(), llvm::AlphaJITInfo::emitFunctionStub(), and llvm::SparcV9CodeEmitter::emitWord().

virtual void llvm::MachineCodeEmitter::emitWordAt ( unsigned  W,
unsigned *  Ptr 
) [inline, virtual]

emitWordAt - This callback is invoked when a word needs to be written to the output stream at a different position than the current PC (for instance, when performing relocations).

Reimplemented in llvm::ELFCodeEmitter.

Definition at line 71 of file MachineCodeEmitter.h.

Referenced by llvm::SparcV9CodeEmitter::runOnMachineFunction().

virtual void llvm::MachineCodeEmitter::finishFunction ( MachineFunction F  )  [inline, virtual]

finishFunction - This callback is invoked when the specified function has finished code generation.

Reimplemented in llvm::ELFCodeEmitter.

Definition at line 44 of file MachineCodeEmitter.h.

Referenced by llvm::SparcV9CodeEmitter::runOnMachineFunction().

virtual void* llvm::MachineCodeEmitter::finishFunctionStub ( const Function F  )  [inline, virtual]

finishFunctionStub - This callback is invoked to terminate a function stub.

Reimplemented in llvm::ELFCodeEmitter.

Definition at line 60 of file MachineCodeEmitter.h.

Referenced by llvm::X86JITInfo::emitFunctionStub(), llvm::SparcV9JITInfo::emitFunctionStub(), llvm::PPCJITInfo::emitFunctionStub(), and llvm::AlphaJITInfo::emitFunctionStub().

virtual uint64_t llvm::MachineCodeEmitter::getConstantPoolEntryAddress ( unsigned  Index  )  [pure virtual]

Implemented in llvm::ELFCodeEmitter.

virtual uint64_t llvm::MachineCodeEmitter::getCurrentPCOffset (  )  [pure virtual]

getCurrentPCOffset - Return the offset from the start of the emitted buffer that we are currently writing to.

Implemented in llvm::ELFCodeEmitter.

virtual uint64_t llvm::MachineCodeEmitter::getCurrentPCValue (  )  [pure virtual]

getCurrentPCValue - This returns the address that the next emitted byte will be output to.

Implemented in llvm::ELFCodeEmitter.

Referenced by llvm::X86JITInfo::emitFunctionStub(), llvm::SparcV9JITInfo::emitFunctionStub(), llvm::PPCJITInfo::emitFunctionStub(), llvm::AlphaJITInfo::emitFunctionStub(), and llvm::SparcV9CodeEmitter::runOnMachineFunction().

virtual void llvm::MachineCodeEmitter::startFunction ( MachineFunction F  )  [inline, virtual]

startFunction - This callback is invoked when the specified function is about to be code generated.

Reimplemented in llvm::ELFCodeEmitter.

Definition at line 39 of file MachineCodeEmitter.h.

Referenced by llvm::SparcV9CodeEmitter::runOnMachineFunction().

virtual void llvm::MachineCodeEmitter::startFunctionStub ( unsigned  StubSize  )  [inline, virtual]

startFunctionStub - This callback is invoked when the JIT needs the address of a function that has not been code generated yet. The StubSize specifies the total size required by the stub. Stubs are not allowed to have constant pools, the can only use the other emit* methods.

Reimplemented in llvm::ELFCodeEmitter.

Definition at line 55 of file MachineCodeEmitter.h.

Referenced by llvm::X86JITInfo::emitFunctionStub(), llvm::SparcV9JITInfo::emitFunctionStub(), llvm::PPCJITInfo::emitFunctionStub(), and llvm::AlphaJITInfo::emitFunctionStub().


The documentation for this class was generated from the following files: