LLVM API Documentation
#include <ELFCodeEmitter.h>
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) |
Definition at line 22 of file ELFCodeEmitter.h.
| llvm::ELFCodeEmitter::ELFCodeEmitter | ( | ELFWriter & | ew | ) | [inline, explicit] |
Definition at line 41 of file ELFCodeEmitter.h.
| 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] |
startFunction - This callback is invoked when a new machine function is about to be emitted.
Implements llvm::ObjectCodeEmitter.
Definition at line 39 of file ELFCodeEmitter.cpp.
References Align, DEBUG, emitConstantPool(), emitJumpTables(), llvm::errs(), llvm::MachineFunction::getAlignment(), llvm::MachineFunction::getConstantPool(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getJumpTableInfo(), llvm::Value::getName(), llvm::ELFWriter::getTextSection(), and llvm::ObjectCodeEmitter::setBinaryObject().
| 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.