LLVM API Documentation
#include <MachOWriter.h>


Public Types | |
| typedef std::vector< unsigned char > | DataBuffer |
Public Member Functions | |
| MachineCodeEmitter & | getMachineCodeEmitter () const |
| MachOWriter (raw_ostream &O, TargetMachine &TM) | |
| virtual | ~MachOWriter () |
| virtual const char * | getPassName () const |
Static Public Attributes | |
| static char | ID = 0 |
Protected Member Functions | |
| bool | doInitialization (Module &M) |
| bool | runOnMachineFunction (MachineFunction &MF) |
| bool | doFinalization (Module &M) |
Static Protected Member Functions | |
| static void | InitMem (const Constant *C, void *Addr, intptr_t Offset, const TargetData *TD, std::vector< MachineRelocation > &MRs) |
Protected Attributes | |
| raw_ostream & | O |
| TargetMachine & | TM |
| Mangler * | Mang |
| MachOCodeEmitter * | MCE |
| bool | is64Bit |
| bool | isLittleEndian |
| MachOHeader | Header |
| std::vector< MachOSym > | SymbolTable |
| DataBuffer | SymT |
| DataBuffer | StrT |
| std::vector< GlobalValue * > | PendingGlobals |
| std::vector< unsigned > | DynamicSymbolTable |
Friends | |
| class | MachOCodeEmitter |
Classes | |
| struct | MachODySymTab |
| struct | MachOHeader |
| struct | MachOSection |
| struct | MachOSegment |
| struct | MachOSymCmp |
| struct | MachOSymTab |
Definition at line 86 of file MachOWriter.h.
| typedef std::vector<unsigned char> llvm::MachOWriter::DataBuffer |
Definition at line 101 of file MachOWriter.h.
| MachOWriter::MachOWriter | ( | raw_ostream & | O, | |
| TargetMachine & | TM | |||
| ) |
Definition at line 338 of file MachOWriter.cpp.
References llvm::TargetData::getPointerSizeInBits(), llvm::TargetMachine::getTargetData(), is64Bit, llvm::TargetData::isLittleEndian(), isLittleEndian, MachOCodeEmitter, MCE, and TM.
| MachOWriter::~MachOWriter | ( | ) | [virtual] |
| MachineCodeEmitter& llvm::MachOWriter::getMachineCodeEmitter | ( | ) | const [inline] |
| virtual const char* llvm::MachOWriter::getPassName | ( | ) | const [inline, virtual] |
getPassName - Return a nice clean name for a pass. This usually implemented in terms of the name that is registered by one of the Registration templates, but can be overloaded directly.
getPassName - Return a nice clean name for a pass. This usually implemented in terms of the name that is registered by one of the Registration templates, but can be overloaded directly.
Reimplemented from llvm::Pass.
Definition at line 97 of file MachOWriter.h.
| bool MachOWriter::doInitialization | ( | Module & | M | ) | [protected, virtual] |
doInitialization - Emit the file header and all of the global variables for the module to the Mach-O file.
Reimplemented from llvm::FunctionPass.
Definition at line 440 of file MachOWriter.cpp.
References llvm::MachOWriter::MachOHeader::filetype, Header, is64Bit, isLittleEndian, Mang, llvm::MachOWriter::MachOHeader::MH_OBJECT, and llvm::MachOWriter::MachOHeader::setMagic().
| bool MachOWriter::runOnMachineFunction | ( | MachineFunction & | MF | ) | [protected, virtual] |
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
Implements llvm::MachineFunctionPass.
Definition at line 435 of file MachOWriter.cpp.
| bool MachOWriter::doFinalization | ( | Module & | M | ) | [protected, virtual] |
doFinalization - Now that the module has been completely processed, emit the Mach-O file to 'O'.
doFinalization - Now that the module has been completely processed, emit the Mach-O file to 'O'.
Reimplemented from llvm::FunctionPass.
Definition at line 455 of file MachOWriter.cpp.
References DynamicSymbolTable, E, llvm::Module::global_begin(), llvm::Module::global_end(), I, Mang, O, StrT, SymbolTable, SymT, and llvm::raw_ostream::write().
| void MachOWriter::InitMem | ( | const Constant * | C, | |
| void * | Addr, | |||
| intptr_t | Offset, | |||
| const TargetData * | TD, | |||
| std::vector< MachineRelocation > & | MRs | |||
| ) | [static, protected] |
Definition at line 804 of file MachOWriter.cpp.
References Add(), llvm::ByteSwap_16(), llvm::ByteSwap_32(), llvm::ByteSwap_64(), llvm::cerr(), CP, llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::TargetData::getABITypeSize(), llvm::StructLayout::getElementOffset(), llvm::MachineRelocation::getGV(), llvm::TargetData::getIndexedOffset(), llvm::User::getNumOperands(), llvm::Constant::getOperand(), llvm::TargetData::getPointerSize(), llvm::TargetData::getStructLayout(), llvm::Value::getType(), llvm::Type::getTypeID(), Indices, llvm::Type::IntegerTyID, llvm::TargetData::isBigEndian(), llvm::Type::isSingleValueType(), llvm::Type::PointerTyID, llvm::SmallVectorImpl< T >::size(), val, llvm::MachineRelocation::VANILLA, and WorkList.
Referenced by llvm::MachOCodeEmitter::emitConstantPool().
friend class MachOCodeEmitter [friend] |
char MachOWriter::ID = 0 [static] |
Definition at line 89 of file MachOWriter.h.
raw_ostream& llvm::MachOWriter::O [protected] |
Output stream to send the resultant object file to.
Definition at line 105 of file MachOWriter.h.
Referenced by doFinalization().
TargetMachine& llvm::MachOWriter::TM [protected] |
Target machine description.
Definition at line 109 of file MachOWriter.h.
Referenced by MachOWriter().
Mangler* llvm::MachOWriter::Mang [protected] |
Mang - The object used to perform name mangling for this module.
Definition at line 113 of file MachOWriter.h.
Referenced by doFinalization(), doInitialization(), and llvm::MachOCodeEmitter::finishFunction().
MachOCodeEmitter* llvm::MachOWriter::MCE [protected] |
MCE - The MachineCodeEmitter object that we are exposing to emit machine code for functions to the .o file.
Definition at line 117 of file MachOWriter.h.
Referenced by getMachineCodeEmitter(), MachOWriter(), and ~MachOWriter().
bool llvm::MachOWriter::is64Bit [protected] |
is64Bit/isLittleEndian - This information is inferred from the target machine directly, indicating what header values and flags to set.
Definition at line 121 of file MachOWriter.h.
Referenced by doInitialization(), and MachOWriter().
bool llvm::MachOWriter::isLittleEndian [protected] |
MachOHeader llvm::MachOWriter::Header [protected] |
Header - An instance of MachOHeader that we will update while we build the file, and then emit during finalization.
Definition at line 240 of file MachOWriter.h.
Referenced by doInitialization().
std::vector<MachOSym> llvm::MachOWriter::SymbolTable [protected] |
SymbolTable - This is the list of symbols we have emitted to the file. This actually gets rearranged before emission to the file (to put the local symbols first in the list).
Definition at line 576 of file MachOWriter.h.
Referenced by doFinalization(), and llvm::MachOCodeEmitter::finishFunction().
DataBuffer llvm::MachOWriter::SymT [protected] |
SymT - A buffer to hold the symbol table before we write it out at the appropriate location in the file.
Definition at line 580 of file MachOWriter.h.
Referenced by doFinalization().
DataBuffer llvm::MachOWriter::StrT [protected] |
StrT - A buffer to hold the string table before we write it out at the appropriate location in the file.
Definition at line 584 of file MachOWriter.h.
Referenced by doFinalization().
std::vector<GlobalValue*> llvm::MachOWriter::PendingGlobals [protected] |
PendingSyms - This is a list of externally defined symbols that we have been asked to emit, but have not seen a reference to. When a reference is seen, the symbol will move from this list to the SymbolTable.
Definition at line 589 of file MachOWriter.h.
Referenced by llvm::MachOCodeEmitter::finishFunction().
std::vector<unsigned> llvm::MachOWriter::DynamicSymbolTable [protected] |
DynamicSymbolTable - This is just a vector of indices into SymbolTable to aid in emitting the DYSYMTAB load command.
Definition at line 593 of file MachOWriter.h.
Referenced by doFinalization().
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.