LLVM API Documentation

llvm::ELFCodeEmitter Class Reference

Inheritance diagram for llvm::ELFCodeEmitter:

Inheritance graph
[legend]
Collaboration diagram for llvm::ELFCodeEmitter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ELFCodeEmitter (ELFWriter &ew)
void startFunction (MachineFunction &F)
void finishFunction (MachineFunction &F)
void emitConstantPool (MachineConstantPool *MCP)
virtual void emitByte (unsigned char B)
virtual void emitWordAt (unsigned W, unsigned *Ptr)
virtual void emitWord (unsigned W)
virtual uint64_t getCurrentPCValue ()
virtual uint64_t getCurrentPCOffset ()
void addRelocation (const MachineRelocation &MR)
virtual uint64_t getConstantPoolEntryAddress (unsigned Index)
virtual unsigned char * allocateGlobal (unsigned size, unsigned alignment)
void startFunctionStub (unsigned StubSize)
 JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!
void * finishFunctionStub (const Function *F)

Detailed Description

ELFCodeEmitter - This class is used by the ELFWriter to emit the code for functions to the ELF file.

Definition at line 50 of file ELFWriter.cpp.


Constructor & Destructor Documentation

llvm::ELFCodeEmitter::ELFCodeEmitter ( ELFWriter ew  )  [inline]

Definition at line 56 of file ELFWriter.cpp.


Member Function Documentation

void llvm::ELFCodeEmitter::addRelocation ( const MachineRelocation MR  )  [inline, virtual]

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

Implements llvm::MachineCodeEmitter.

Definition at line 80 of file ELFWriter.cpp.

virtual unsigned char* llvm::ELFCodeEmitter::allocateGlobal ( unsigned  size,
unsigned  alignment 
) [inline, virtual]

Implements llvm::MachineCodeEmitter.

Definition at line 88 of file ELFWriter.cpp.

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

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

Reimplemented from llvm::MachineCodeEmitter.

Definition at line 65 of file ELFWriter.cpp.

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

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

Reimplemented from llvm::MachineCodeEmitter.

Definition at line 61 of file ELFWriter.cpp.

References llvm::MachineConstantPool::isEmpty().

virtual void llvm::ELFCodeEmitter::emitWord ( unsigned  W  )  [inline, virtual]

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

Implements llvm::MachineCodeEmitter.

Definition at line 71 of file ELFWriter.cpp.

virtual void llvm::ELFCodeEmitter::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 from llvm::MachineCodeEmitter.

Definition at line 68 of file ELFWriter.cpp.

void ELFCodeEmitter::finishFunction ( MachineFunction F  )  [virtual]

finishFunction - This callback is invoked after the function is completely finished.

Reimplemented from llvm::MachineCodeEmitter.

Definition at line 130 of file ELFWriter.cpp.

References llvm::GlobalValue::ExternalLinkage, F, llvm::GlobalValue::InternalLinkage, llvm::GlobalValue::LinkOnceLinkage, llvm::ELF::STB_GLOBAL, llvm::ELF::STB_LOCAL, llvm::ELF::STB_WEAK, llvm::ELF::STT_FUNC, llvm::ELFWriter::SymbolTable, and llvm::GlobalValue::WeakLinkage.

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

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

Reimplemented from llvm::MachineCodeEmitter.

Definition at line 98 of file ELFWriter.cpp.

References abort().

virtual uint64_t llvm::ELFCodeEmitter::getConstantPoolEntryAddress ( unsigned  Index  )  [inline, virtual]

Implements llvm::MachineCodeEmitter.

Definition at line 83 of file ELFWriter.cpp.

virtual uint64_t llvm::ELFCodeEmitter::getCurrentPCOffset (  )  [inline, virtual]

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

Implements llvm::MachineCodeEmitter.

Definition at line 77 of file ELFWriter.cpp.

virtual uint64_t llvm::ELFCodeEmitter::getCurrentPCValue (  )  [inline, virtual]

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

Implements llvm::MachineCodeEmitter.

Definition at line 74 of file ELFWriter.cpp.

void ELFCodeEmitter::startFunction ( MachineFunction F  )  [virtual]

startFunction - This callback is invoked when a new machine function is about to be emitted.

Reimplemented from llvm::MachineCodeEmitter.

Definition at line 108 of file ELFWriter.cpp.

References Align, llvm::ELFWriter::getSection(), llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_EXECINSTR, and llvm::ELF::SHT_PROGBITS.

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

JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!

Reimplemented from llvm::MachineCodeEmitter.

Definition at line 94 of file ELFWriter.cpp.

References abort().


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