LLVM API Documentation

llvm::ELFWriter Class Reference

#include <ELFWriter.h>

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

List of all members.

Public Types

typedef std::vector< unsigned
char > 
DataBuffer

Public Member Functions

MachineCodeEmitter & getMachineCodeEmitter () const
 ELFWriter (raw_ostream &O, TargetMachine &TM)
 ~ELFWriter ()

Static Public Attributes

static char ID = 0

Protected Member Functions

bool doInitialization (Module &M)
bool runOnMachineFunction (MachineFunction &MF)
bool doFinalization (Module &M)

Protected Attributes

raw_ostream & O
TargetMachine & TM
Mangler * Mang
ELFCodeEmitter * MCE
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 32 of file ELFWriter.h.


Member Typedef Documentation

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

Definition at line 44 of file ELFWriter.h.


Constructor & Destructor Documentation

ELFWriter::ELFWriter ( raw_ostream &  O,
TargetMachine &  TM 
)

ELFWriter::~ELFWriter (  ) 

Definition at line 212 of file ELFWriter.cpp.

References MCE.


Member Function Documentation

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

Definition at line 37 of file ELFWriter.h.

References MCE.

Referenced by llvm::AddELFWriter().

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 218 of file ELFWriter.cpp.

References e_flags, llvm::TargetMachine::getELFWriterInfo(), llvm::TargetELFWriterInfo::getEMachine(), is64Bit, isLittleEndian, Mang, llvm::OutputBuffer::outaddr(), llvm::OutputBuffer::outbyte(), llvm::OutputBuffer::outhalf(), llvm::OutputBuffer::outword(), and TM.

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 350 of file ELFWriter.cpp.

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

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

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

Reimplemented from llvm::FunctionPass.

Definition at line 357 of file ELFWriter.cpp.

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


Friends And Related Function Documentation

friend class ELFCodeEmitter [friend]

Definition at line 33 of file ELFWriter.h.

Referenced by ELFWriter().


Member Data Documentation

char ELFWriter::ID = 0 [static]

Definition at line 35 of file ELFWriter.h.

Output stream to send the resultant object file to.

Definition at line 49 of file ELFWriter.h.

Target machine description.

Definition at line 53 of file ELFWriter.h.

Referenced by doInitialization(), and ELFWriter().

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

Definition at line 57 of file ELFWriter.h.

Referenced by doFinalization(), and doInitialization().

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

Definition at line 61 of file ELFWriter.h.

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

Definition at line 69 of file ELFWriter.h.

Definition at line 72 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 80 of file ELFWriter.h.

Referenced by doInitialization(), and ELFWriter().

Definition at line 80 of file ELFWriter.h.

Referenced by doInitialization(), and ELFWriter().


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