LLVM API Documentation
#include <MachOCodeEmitter.h>
Public Member Functions | |
| MachOCodeEmitter (MachOWriter &mow, MachOSection &mos) | |
| virtual void | startFunction (MachineFunction &MF) |
| virtual bool | finishFunction (MachineFunction &MF) |
| virtual void | addRelocation (const MachineRelocation &MR) |
| void | emitConstantPool (MachineConstantPool *MCP) |
| void | emitJumpTables (MachineJumpTableInfo *MJTI) |
| 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 23 of file MachOCodeEmitter.h.
| llvm::MachOCodeEmitter::MachOCodeEmitter | ( | MachOWriter & | mow, | |
| MachOSection & | mos | |||
| ) |
Definition at line 34 of file MachOCodeEmitter.cpp.
References llvm::TargetData::getPointerSizeInBits(), llvm::TargetMachine::getTargetAsmInfo(), llvm::TargetMachine::getTargetData(), and llvm::TargetData::isLittleEndian().
| void llvm::MachOCodeEmitter::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 44 of file MachOCodeEmitter.cpp.
References llvm::MachOSection::align, Align, llvm::BinaryObject::emitAlignment(), F, llvm::GlobalValue::getAlignment(), llvm::ObjectCodeEmitter::getCurrentPCOffset(), llvm::MachineFunction::getFunction(), llvm::Mangler::getMangledName(), llvm::TargetData::getPrefTypeAlignment(), llvm::TargetMachine::getTargetData(), llvm::MachOWriter::getTextSection(), llvm::GlobalValue::getType(), llvm::MachOSection::Index, llvm::Log2_32(), llvm::MachOWriter::Mang, llvm::MachOWriter::SymbolTable, and TD.
| bool llvm::MachOCodeEmitter::finishFunction | ( | MachineFunction & | MF | ) | [virtual] |
finishFunction - This callback is invoked after the function is completely finished.
Implements llvm::ObjectCodeEmitter.
Definition at line 74 of file MachOCodeEmitter.cpp.
References llvm::BinaryObject::addRelocation(), llvm::ObjectCodeEmitter::CPLocations, llvm::ObjectCodeEmitter::CPSections, emitConstantPool(), emitJumpTables(), llvm::MachineRelocation::getBasicBlock(), llvm::MachineFunction::getConstantPool(), llvm::ObjectCodeEmitter::getConstantPoolEntryAddress(), llvm::MachineRelocation::getConstantPoolIndex(), llvm::MachineRelocation::getGlobalValue(), llvm::ObjectCodeEmitter::getJumpTableEntryAddress(), llvm::MachineRelocation::getJumpTableIndex(), llvm::MachineFunction::getJumpTableInfo(), llvm::MachOWriter::getJumpTableSection(), llvm::ObjectCodeEmitter::getMachineBasicBlockAddress(), llvm::MachOWriter::getTextSection(), llvm::MachOSection::Index, llvm::MachineRelocation::isBasicBlock(), llvm::MachineRelocation::isConstantPoolIndex(), llvm::MachineRelocation::isGlobalValue(), llvm::MachineRelocation::isJumpTableIndex(), llvm::ObjectCodeEmitter::JTLocations, llvm_unreachable, llvm::ObjectCodeEmitter::MBBLocations, MR, llvm::MachOWriter::PendingGlobals, llvm::MachineRelocation::setConstantVal(), and llvm::MachineRelocation::setResultPointer().
| virtual void llvm::MachOCodeEmitter::addRelocation | ( | const MachineRelocation & | relocation | ) | [inline, virtual] |
addRelocation - Whenever a relocatable address is needed, it should be noted with this interface.
addRelocation - Whenever a relocatable address is needed, it should be noted with this interface.
Reimplemented from llvm::ObjectCodeEmitter.
Definition at line 47 of file MachOCodeEmitter.h.
| void llvm::MachOCodeEmitter::emitConstantPool | ( | MachineConstantPool * | MCP | ) | [virtual] |
emitConstantPool - For each constant pool entry, figure out which section the constant should live in, allocate space for it, and emit it to the Section data buffer.
Implements llvm::ObjectCodeEmitter.
Definition at line 127 of file MachOCodeEmitter.cpp.
References CP, llvm::ObjectCodeEmitter::CPLocations, llvm::ObjectCodeEmitter::CPSections, llvm::MachineConstantPool::getConstants(), llvm::MachOWriter::getConstSection(), llvm::BinaryObject::getData(), llvm::TargetMachine::getRelocationModel(), llvm::TargetMachine::getTargetData(), llvm::TargetData::getTypeAllocSize(), llvm::MachOSection::Index, llvm::MachOWriter::InitMem(), llvm::Reloc::PIC_, llvm::BinaryObject::size(), Ty, and Val.
Referenced by finishFunction().
| void llvm::MachOCodeEmitter::emitJumpTables | ( | MachineJumpTableInfo * | MJTI | ) | [virtual] |
emitJumpTables - Emit all the jump tables for a given jump table info record to the appropriate section.
Implements llvm::ObjectCodeEmitter.
Definition at line 165 of file MachOCodeEmitter.cpp.
References llvm::MachOWriter::GetJTRelocation(), llvm::MachineJumpTableInfo::getJumpTables(), llvm::MachOWriter::getJumpTableSection(), llvm::TargetMachine::getRelocationModel(), llvm::MachOWriter::getTextSection(), llvm::MachOSection::Index, JT, llvm::ObjectCodeEmitter::JTLocations, MR, llvm::Reloc::PIC_, llvm::MachineRelocation::setConstantVal(), and llvm::MachineRelocation::setResultPointer().
Referenced by finishFunction().
| virtual void llvm::MachOCodeEmitter::emitLabel | ( | uint64_t | LabelID | ) | [inline, virtual] |
emitLabel - Emits a label
Implements llvm::ObjectCodeEmitter.
Definition at line 54 of file MachOCodeEmitter.h.
References llvm::ObjectCodeEmitter::getCurrentPCOffset().
| virtual uintptr_t llvm::MachOCodeEmitter::getLabelAddress | ( | uint64_t | LabelID | ) | 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 58 of file MachOCodeEmitter.h.
| virtual void llvm::MachOCodeEmitter::setModuleInfo | ( | llvm::MachineModuleInfo * | Info | ) | [inline, virtual] |
Specifies the MachineModuleInfo object. This is used for exception handling purposes.
Implements llvm::ObjectCodeEmitter.
Definition at line 62 of file MachOCodeEmitter.h.