LLVM API Documentation
Public Member Functions | |
| MachOCodeEmitter (MachOWriter &mow) | |
| 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 uintptr_t | getConstantPoolEntryAddress (unsigned Index) const |
| FIXME: These should all be handled with relocations! | |
| virtual uintptr_t | getJumpTableEntryAddress (unsigned Index) const |
| virtual void | StartMachineBasicBlock (MachineBasicBlock *MBB) |
| virtual uintptr_t | getMachineBasicBlockAddress (MachineBasicBlock *MBB) const |
| virtual uintptr_t | getLabelAddress (uint64_t Label) const |
| virtual void | emitLabel (uint64_t LabelID) |
| emitLabel - Emits a label | |
| virtual void | setModuleInfo (llvm::MachineModuleInfo *MMI) |
| virtual void | startGVStub (const GlobalValue *F, unsigned StubSize, unsigned Alignment=1) |
| JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! | |
| virtual void * | finishGVStub (const GlobalValue *F) |
Definition at line 62 of file MachOWriter.cpp.
| llvm::MachOCodeEmitter::MachOCodeEmitter | ( | MachOWriter & | mow | ) | [inline] |
Definition at line 94 of file MachOWriter.cpp.
References llvm::TargetData::getPointerSizeInBits(), llvm::TargetMachine::getTargetData(), llvm::TargetData::isLittleEndian(), and TM.
| void MachOCodeEmitter::startFunction | ( | MachineFunction & | MF | ) | [virtual] |
startFunction - This callback is invoked when a new machine function is about to be emitted.
Implements llvm::MachineCodeEmitter.
Definition at line 160 of file MachOWriter.cpp.
References llvm::MachOWriter::MachOSection::align, Align, llvm::MachineCodeEmitter::BufferBegin, llvm::MachineCodeEmitter::BufferEnd, llvm::MachineCodeEmitter::CurBufferPtr, F, llvm::GlobalValue::getAlignment(), llvm::MachineFunction::getFunction(), llvm::TargetData::getPrefTypeAlignment(), llvm::TargetMachine::getTargetData(), llvm::MachOWriter::getTextSection(), llvm::GlobalValue::getType(), llvm::Log2_32(), llvm::MachOWriter::MachOSection::SectionData, llvm::MachOWriter::MachOSection::size, and TD.
| bool MachOCodeEmitter::finishFunction | ( | MachineFunction & | MF | ) | [virtual] |
finishFunction - This callback is invoked after the function is completely finished.
Implements llvm::MachineCodeEmitter.
Definition at line 205 of file MachOWriter.cpp.
References llvm::MachineCodeEmitter::BufferBegin, llvm::MachineCodeEmitter::CurBufferPtr, emitConstantPool(), emitJumpTables(), llvm::MachineRelocation::getBasicBlock(), llvm::MachineFunction::getConstantPool(), getConstantPoolEntryAddress(), llvm::MachineRelocation::getConstantPoolIndex(), llvm::MachineFunction::getFunction(), llvm::MachineRelocation::getGlobalValue(), getJumpTableEntryAddress(), llvm::MachineRelocation::getJumpTableIndex(), llvm::MachineFunction::getJumpTableInfo(), llvm::MachOWriter::getJumpTableSection(), getMachineBasicBlockAddress(), llvm::MachOWriter::getTextSection(), llvm::Mangler::getValueName(), llvm::MachOWriter::MachOSection::Index, llvm::MachineRelocation::isBasicBlock(), llvm::MachineRelocation::isConstantPoolIndex(), llvm::MachineRelocation::isGlobalValue(), llvm::MachineRelocation::isJumpTableIndex(), llvm::MachOWriter::Mang, MR, llvm::MachOWriter::PendingGlobals, llvm::MachOWriter::MachOSection::Relocations, llvm::MachineRelocation::setConstantVal(), llvm::MachineRelocation::setResultPointer(), llvm::MachOWriter::MachOSection::size, and llvm::MachOWriter::SymbolTable.
| virtual void llvm::MachOCodeEmitter::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 102 of file MachOWriter.cpp.
References Relocations.
| void MachOCodeEmitter::emitConstantPool | ( | MachineConstantPool * | MCP | ) |
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.
Definition at line 262 of file MachOWriter.cpp.
References CP, llvm::MachineConstantPool::getConstants(), llvm::MachOWriter::getConstSection(), llvm::TargetMachine::getRelocationModel(), llvm::TargetMachine::getTargetData(), llvm::TargetData::getTypePaddedSize(), llvm::MachOWriter::MachOSection::Index, llvm::MachOWriter::InitMem(), llvm::OutputBuffer::outbyte(), llvm::Reloc::PIC_, llvm::MachOWriter::MachOSection::Relocations, llvm::MachOWriter::MachOSection::SectionData, llvm::MachOWriter::MachOSection::size, Ty, and Val.
Referenced by finishFunction().
| void MachOCodeEmitter::emitJumpTables | ( | MachineJumpTableInfo * | MJTI | ) |
emitJumpTables - Emit all the jump tables for a given jump table info record to the appropriate section.
Definition at line 303 of file MachOWriter.cpp.
References llvm::MachOWriter::GetJTRelocation(), llvm::MachineJumpTableInfo::getJumpTables(), llvm::MachOWriter::getJumpTableSection(), llvm::TargetMachine::getRelocationModel(), llvm::MachOWriter::getTextSection(), JT, MR, llvm::OutputBuffer::outaddr(), llvm::Reloc::PIC_, llvm::MachineRelocation::setConstantVal(), and llvm::MachineRelocation::setResultPointer().
Referenced by finishFunction().
| virtual uintptr_t llvm::MachOCodeEmitter::getConstantPoolEntryAddress | ( | unsigned | Index | ) | const [inline, virtual] |
FIXME: These should all be handled with relocations!
getConstantPoolEntryAddress - Return the address of the 'Index' entry in the constant pool that was last emitted with the emitConstantPool method.
Implements llvm::MachineCodeEmitter.
Definition at line 109 of file MachOWriter.cpp.
Referenced by finishFunction().
| virtual uintptr_t llvm::MachOCodeEmitter::getJumpTableEntryAddress | ( | unsigned | Index | ) | const [inline, virtual] |
getJumpTableEntryAddress - Return the address of the jump table with index 'Index' in the function that last called initJumpTableInfo.
Implements llvm::MachineCodeEmitter.
Definition at line 113 of file MachOWriter.cpp.
Referenced by finishFunction().
| virtual void llvm::MachOCodeEmitter::StartMachineBasicBlock | ( | MachineBasicBlock * | MBB | ) | [inline, virtual] |
StartMachineBasicBlock - This should be called by the target when a new basic block is about to be emitted. This way the MCE knows where the start of the block is, and can implement getMachineBasicBlockAddress.
Implements llvm::MachineCodeEmitter.
Definition at line 118 of file MachOWriter.cpp.
References llvm::MachineBasicBlock::getNumber(), and MBBLocations.
| virtual uintptr_t llvm::MachOCodeEmitter::getMachineBasicBlockAddress | ( | MachineBasicBlock * | MBB | ) | const [inline, virtual] |
getMachineBasicBlockAddress - Return the address of the specified MachineBasicBlock, only usable after the label for the MBB has been emitted.
Implements llvm::MachineCodeEmitter.
Definition at line 124 of file MachOWriter.cpp.
References llvm::MachineBasicBlock::getNumber(), and MBBLocations.
Referenced by finishFunction().
| 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::MachineCodeEmitter.
Definition at line 130 of file MachOWriter.cpp.
| virtual void llvm::MachOCodeEmitter::emitLabel | ( | uint64_t | LabelID | ) | [inline, virtual] |
emitLabel - Emits a label
Implements llvm::MachineCodeEmitter.
Definition at line 136 of file MachOWriter.cpp.
| virtual void llvm::MachOCodeEmitter::setModuleInfo | ( | llvm::MachineModuleInfo * | Info | ) | [inline, virtual] |
Specifies the MachineModuleInfo object. This is used for exception handling purposes.
Implements llvm::MachineCodeEmitter.
Definition at line 142 of file MachOWriter.cpp.
| virtual void llvm::MachOCodeEmitter::startGVStub | ( | const GlobalValue * | F, | |
| unsigned | StubSize, | |||
| unsigned | Alignment = 1 | |||
| ) | [inline, virtual] |
JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!
Implements llvm::MachineCodeEmitter.
Definition at line 145 of file MachOWriter.cpp.
| virtual void* llvm::MachOCodeEmitter::finishGVStub | ( | const GlobalValue * | F | ) | [inline, virtual] |
finishGVStub - This callback is invoked to terminate a GV stub.
Implements llvm::MachineCodeEmitter.
Definition at line 150 of file MachOWriter.cpp.