LLVM API Documentation

llvm::ELFCodeEmitter Class Reference

#include <ELFCodeEmitter.h>

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

List of all members.

Public Member Functions

 ELFCodeEmitter (ELFWriter &ew)
void addRelocation (const MachineRelocation &MR)
 addRelocation - Register new relocations for this function
void emitConstantPool (MachineConstantPool *MCP)
void emitJumpTables (MachineJumpTableInfo *MJTI)
void startFunction (MachineFunction &F)
bool finishFunction (MachineFunction &F)
virtual void emitLabel (uint64_t LabelID)
 emitLabel - Emits a label
virtual uintptr_t getLabelAddress (uint64_t Label) const
virtual void setModuleInfo (llvm::MachineModuleInfo *MMI)


Detailed Description

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

Definition at line 22 of file ELFCodeEmitter.h.


Constructor & Destructor Documentation

llvm::ELFCodeEmitter::ELFCodeEmitter ( ELFWriter &  ew  )  [inline, explicit]

Definition at line 41 of file ELFCodeEmitter.h.


Member Function Documentation

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

addRelocation - Register new relocations for this function

Reimplemented from llvm::ObjectCodeEmitter.

Definition at line 44 of file ELFCodeEmitter.h.

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

emitConstantPool - For each constant pool entry, figure out which section the constant should live in and emit data to it

emitConstantPool - For each constant pool entry, figure out which section the constant should live in and emit the constant

Implements llvm::ObjectCodeEmitter.

Definition at line 140 of file ELFCodeEmitter.cpp.

References llvm::MachineConstantPoolEntry::ConstVal, CP, llvm::ObjectCodeEmitter::CPLocations, llvm::ObjectCodeEmitter::CPSections, llvm::ELFWriter::EmitGlobalConstant(), llvm::ELFWriter::getConstantPoolSection(), llvm::MachineConstantPool::getConstants(), llvm::TargetMachine::getRelocationModel(), llvm::MachineConstantPoolEntry::isMachineConstantPoolEntry(), llvm::Reloc::PIC_, llvm::ELFSection::SectionIdx, llvm::BinaryObject::size(), and llvm::MachineConstantPoolEntry::Val.

Referenced by startFunction().

void llvm::ELFCodeEmitter::emitJumpTables ( MachineJumpTableInfo *  MJTI  )  [virtual]

emitJumpTables - Emit all the jump tables for a given jump table info and record them to the appropriate section.

emitJumpTables - Emit all the jump tables for a given jump table info record to the appropriate section.

Implements llvm::ObjectCodeEmitter.

Definition at line 166 of file ELFCodeEmitter.cpp.

References llvm::BinaryObject::emitByte(), llvm::MachineRelocation::getBB(), llvm::TargetMachine::getELFWriterInfo(), llvm::MachineJumpTableInfo::getEntrySize(), llvm::MachineJumpTableInfo::getJumpTables(), llvm::ELFWriter::getJumpTableSection(), llvm::TargetMachine::getRelocationModel(), JT, llvm::ObjectCodeEmitter::JTLocations, MR, llvm::Reloc::PIC_, and llvm::BinaryObject::size().

Referenced by startFunction().

void llvm::ELFCodeEmitter::startFunction ( MachineFunction &  MF  )  [virtual]

bool llvm::ELFCodeEmitter::finishFunction ( MachineFunction &  MF  )  [virtual]

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

Implements llvm::ObjectCodeEmitter.

Definition at line 70 of file ELFCodeEmitter.cpp.

References llvm::ELFWriter::AddPendingExternalSymbol(), llvm::ELFWriter::AddPendingGlobalSymbol(), llvm::BinaryObject::addRelocation(), llvm::ObjectCodeEmitter::CPLocations, llvm::ObjectCodeEmitter::CPSections, F, llvm::MachineRelocation::getBasicBlock(), llvm::ObjectCodeEmitter::getConstantPoolEntryAddress(), llvm::MachineRelocation::getConstantPoolIndex(), llvm::BinaryObject::getCurrentPCOffset(), llvm::MachineRelocation::getExternalSymbol(), llvm::MachineFunction::getFunction(), llvm::ELFWriter::getGlobalELFBinding(), llvm::ELFWriter::getGlobalELFVisibility(), llvm::MachineRelocation::getGlobalValue(), llvm::ELFSym::getGV(), llvm::ObjectCodeEmitter::getJumpTableEntryAddress(), llvm::MachineRelocation::getJumpTableIndex(), llvm::MachineFunction::getJumpTableInfo(), llvm::ELFWriter::getJumpTableSection(), llvm::ObjectCodeEmitter::getMachineBasicBlockAddress(), llvm::GlobalValue::hasPrivateLinkage(), llvm::MachineRelocation::isBasicBlock(), llvm::MachineRelocation::isConstantPoolIndex(), llvm::MachineJumpTableInfo::isEmpty(), llvm::MachineRelocation::isExternalSymbol(), llvm::MachineRelocation::isGlobalValue(), llvm::MachineRelocation::isJumpTableIndex(), llvm::ObjectCodeEmitter::JTLocations, llvm_unreachable, llvm::ObjectCodeEmitter::MBBLocations, MR, MRI, llvm::ELFSection::SectionIdx, llvm::ELFSym::SectionIdx, llvm::MachineRelocation::setConstantVal(), llvm::MachineRelocation::setResultPointer(), llvm::ELFSym::Size, llvm::ELFSym::STT_FUNC, llvm::ELFWriter::SymbolList, and llvm::ELFSym::Value.

virtual void llvm::ELFCodeEmitter::emitLabel ( uint64_t  LabelID  )  [inline, virtual]

emitLabel - Emits a label

Implements llvm::ObjectCodeEmitter.

Definition at line 60 of file ELFCodeEmitter.h.

virtual uintptr_t llvm::ELFCodeEmitter::getLabelAddress ( uint64_t  Label  )  const [inline, virtual]

getLabelAddress - Return the address of the specified LabelID, only usable after the LabelID has been emitted.

Implements llvm::ObjectCodeEmitter.

Definition at line 66 of file ELFCodeEmitter.h.

virtual void llvm::ELFCodeEmitter::setModuleInfo ( llvm::MachineModuleInfo *  Info  )  [inline, virtual]

Specifies the MachineModuleInfo object. This is used for exception handling purposes.

Implements llvm::ObjectCodeEmitter.

Definition at line 71 of file ELFCodeEmitter.h.


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