LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 (raw_ostream &O, TargetMachine &TM)
 ~ELFWriter ()

Static Public Attributes

char ID = 0

Protected Member Functions

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

Protected Attributes

raw_ostreamO
TargetMachineTM
ManglerMang
ELFCodeEmitterMCE
unsigned short e_machine
unsigned e_flags
bool is64Bit
bool isLittleEndian

Friends

class ELFCodeEmitter

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
 

Definition at line 197 of file ELFWriter.cpp.

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

ELFWriter::~ELFWriter  ) 
 

Definition at line 209 of file ELFWriter.cpp.


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

References Module::global_begin(), Module::global_end(), 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 215 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.

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

Definition at line 37 of file ELFWriter.h.

Referenced by llvm::AddELFWriter().

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


Friends And Related Function Documentation

friend class ELFCodeEmitter [friend]
 

Definition at line 33 of file ELFWriter.h.

Referenced by ELFWriter().


Member Data Documentation

unsigned llvm::ELFWriter::e_flags [protected]
 

Definition at line 72 of file ELFWriter.h.

Referenced by doInitialization(), and ELFWriter().

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

Definition at line 69 of file ELFWriter.h.

char ELFWriter::ID = 0 [static]
 

Definition at line 51 of file ELFWriter.cpp.

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().

bool llvm::ELFWriter::isLittleEndian [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().

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

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

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

Referenced by ELFWriter().

raw_ostream& llvm::ELFWriter::O [protected]
 

Output stream to send the resultant object file to.

Definition at line 49 of file ELFWriter.h.

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

Target machine description.

Definition at line 53 of file ELFWriter.h.

Referenced by doInitialization(), and ELFWriter().


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


This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.