LLVM API Documentation

llvm::ELFWriter Class Reference

#include <ELFWriter.h>

Inheritance diagram for llvm::ELFWriter:

Inheritance graph
[legend]
Collaboration diagram for llvm::ELFWriter:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< unsigned
char > 
DataBuffer

Public Member Functions

MachineCodeEmittergetMachineCodeEmitter () const
 ~ELFWriter ()

Protected Member Functions

 ELFWriter (std::ostream &O, TargetMachine &TM)
bool doInitialization (Module &M)
bool runOnMachineFunction (MachineFunction &MF)
bool doFinalization (Module &M)

Protected Attributes

std::ostream & O
TargetMachineTM
ManglerMang
ELFCodeEmitterMCE
unsigned short e_machine
unsigned e_flags
bool is64Bit
bool isLittleEndian

Friends

class ELFCodeEmitter

Classes

struct  ELFSection
struct  ELFSym

Detailed Description

ELFWriter - This class implements the common target-independent code for writing ELF files. Targets should derive a class from this to parameterize the output format.

Definition at line 30 of file ELFWriter.h.


Member Typedef Documentation

typedef std::vector<unsigned char> llvm::ELFWriter::DataBuffer

Definition at line 39 of file ELFWriter.h.


Constructor & Destructor Documentation

ELFWriter::~ELFWriter (  ) 

Definition at line 178 of file ELFWriter.cpp.

References MCE.

ELFWriter::ELFWriter ( std::ostream &  O,
TargetMachine TM 
) [protected]

Definition at line 166 of file ELFWriter.cpp.

References e_flags, e_machine, ELFCodeEmitter, llvm::TargetData::getPointerSizeInBits(), llvm::TargetMachine::getTargetData(), is64Bit, llvm::TargetData::isLittleEndian(), isLittleEndian, MCE, and TM.


Member Function Documentation

bool ELFWriter::doFinalization ( Module M  )  [protected, virtual]

doFinalization - Now that the module has been completely processed, emit the ELF file to 'O'.

Reimplemented from llvm::FunctionPass.

Definition at line 320 of file ELFWriter.cpp.

References E, llvm::Module::global_begin(), llvm::Module::global_end(), I, M, and Mang.

bool ELFWriter::doInitialization ( Module M  )  [protected, virtual]

doInitialization - Emit the file header and all of the global variables for the module to the ELF file.

Reimplemented from llvm::FunctionPass.

Definition at line 184 of file ELFWriter.cpp.

References e_flags, e_machine, is64Bit, isLittleEndian, M, and Mang.

MachineCodeEmitter& llvm::ELFWriter::getMachineCodeEmitter (  )  const [inline]

Definition at line 33 of file ELFWriter.h.

References MCE.

bool ELFWriter::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 313 of file ELFWriter.cpp.


Friends And Related Function Documentation

friend class ELFCodeEmitter [friend]

Definition at line 31 of file ELFWriter.h.

Referenced by ELFWriter().


Member Data Documentation

unsigned llvm::ELFWriter::e_flags [protected]

Definition at line 69 of file ELFWriter.h.

Referenced by doInitialization(), and ELFWriter().

unsigned short llvm::ELFWriter::e_machine [protected]

Definition at line 66 of file ELFWriter.h.

Referenced by doInitialization(), and ELFWriter().

bool llvm::ELFWriter::is64Bit [protected]

is64Bit/isLittleEndian - This information is inferred from the target machine directly, indicating whether to emit a 32- or 64-bit ELF file.

Definition at line 77 of file ELFWriter.h.

Referenced by doInitialization(), and ELFWriter().

bool llvm::ELFWriter::isLittleEndian [protected]

Definition at line 77 of file ELFWriter.h.

Referenced by doInitialization(), and ELFWriter().

Mangler* llvm::ELFWriter::Mang [protected]

Mang - The object used to perform name mangling for this module.

Definition at line 54 of file ELFWriter.h.

Referenced by doFinalization(), and doInitialization().

ELFCodeEmitter* llvm::ELFWriter::MCE [protected]

MCE - The MachineCodeEmitter object that we are exposing to emit machine code for functions to the .o file.

Definition at line 58 of file ELFWriter.h.

Referenced by ELFWriter(), getMachineCodeEmitter(), and ~ELFWriter().

std::ostream& llvm::ELFWriter::O [protected]

Output stream to send the resultant object file to.

Definition at line 46 of file ELFWriter.h.

TargetMachine& llvm::ELFWriter::TM [protected]

Target machine description.

Definition at line 50 of file ELFWriter.h.

Referenced by ELFWriter().


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