LLVM API Documentation

Public Member Functions | Protected Member Functions | Protected Attributes
llvm::MCObjectWriter Class Reference

#include <MCObjectWriter.h>

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

List of all members.

Public Member Functions

virtual ~MCObjectWriter ()
virtual void reset ()
 lifetime management
bool isLittleEndian () const
raw_ostreamgetStream ()
void Write8 (uint8_t Value)
void WriteLE16 (uint16_t Value)
void WriteLE32 (uint32_t Value)
void WriteLE64 (uint64_t Value)
void WriteBE16 (uint16_t Value)
void WriteBE32 (uint32_t Value)
void WriteBE64 (uint64_t Value)
void Write16 (uint16_t Value)
void Write32 (uint32_t Value)
void Write64 (uint64_t Value)
void WriteZeros (unsigned N)
void WriteBytes (const SmallVectorImpl< char > &ByteVec, unsigned ZeroFillSize=0)
void WriteBytes (StringRef Str, unsigned ZeroFillSize=0)
High-Level API
virtual void ExecutePostLayoutBinding (MCAssembler &Asm, const MCAsmLayout &Layout)=0
 Perform any late binding of symbols (for example, to assign symbol indices for use when generating relocations).
virtual void RecordRelocation (const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, const MCFixup &Fixup, MCValue Target, bool &IsPCRel, uint64_t &FixedValue)=0
 Record a relocation entry.
bool IsSymbolRefDifferenceFullyResolved (const MCAssembler &Asm, const MCSymbolRefExpr *A, const MCSymbolRefExpr *B, bool InSet) const
 Check whether the difference (A - B) between two symbol references is fully resolved.
virtual bool IsSymbolRefDifferenceFullyResolvedImpl (const MCAssembler &Asm, const MCSymbolData &DataA, const MCFragment &FB, bool InSet, bool IsPCRel) const
virtual void WriteObject (MCAssembler &Asm, const MCAsmLayout &Layout)=0
 Write the object file.

Protected Member Functions

 MCObjectWriter (raw_ostream &_OS, bool _IsLittleEndian)

Protected Attributes

raw_ostreamOS
unsigned IsLittleEndian: 1

Detailed Description

MCObjectWriter - Defines the object file and target independent interfaces used by the assembler backend to write native file format object files.

The object writer contains a few callbacks used by the assembler to allow the object writer to modify the assembler data structures at appropriate points. Once assembly is complete, the object writer is given the MCAssembler instance, which contains all the symbol and section data which should be emitted as part of WriteObject().

The object writer also contains a number of helper methods for writing binary data to the output stream.

Definition at line 39 of file MCObjectWriter.h.


Constructor & Destructor Documentation

llvm::MCObjectWriter::MCObjectWriter ( raw_ostream _OS,
bool  _IsLittleEndian 
) [inline, protected]

Definition at line 49 of file MCObjectWriter.h.

Definition at line 17 of file MCObjectWriter.cpp.


Member Function Documentation

virtual void llvm::MCObjectWriter::ExecutePostLayoutBinding ( MCAssembler Asm,
const MCAsmLayout Layout 
) [pure virtual]

Perform any late binding of symbols (for example, to assign symbol indices for use when generating relocations).

This routine is called by the assembler after layout and relaxation is complete.

Implemented in llvm::MachObjectWriter.

Referenced by llvm::MCAssembler::Finish().

Definition at line 60 of file MCObjectWriter.h.

References OS.

Referenced by llvm::MCLOHDirective::Emit(), writeFragment(), and llvm::MCAssembler::writeSectionData().

Definition at line 58 of file MCObjectWriter.h.

References IsLittleEndian.

Check whether the difference (A - B) between two symbol references is fully resolved.

Clients are not required to answer precisely and may conservatively return false, even when a difference is fully resolved.

Definition at line 21 of file MCObjectWriter.cpp.

References llvm::MCSymbol::AliasedSymbol(), llvm::MCSymbolData::getFragment(), llvm::MCSymbolRefExpr::getKind(), llvm::MCSymbolRefExpr::getSymbol(), llvm::MCAssembler::getSymbolData(), IsSymbolRefDifferenceFullyResolvedImpl(), llvm::MCSymbol::isUndefined(), and llvm::MCSymbolRefExpr::VK_None.

bool MCObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl ( const MCAssembler Asm,
const MCSymbolData DataA,
const MCFragment FB,
bool  InSet,
bool  IsPCRel 
) const [virtual]
virtual void llvm::MCObjectWriter::RecordRelocation ( const MCAssembler Asm,
const MCAsmLayout Layout,
const MCFragment Fragment,
const MCFixup Fixup,
MCValue  Target,
bool IsPCRel,
uint64_t &  FixedValue 
) [pure virtual]

Record a relocation entry.

This routine is called by the assembler after layout and relaxation, and post layout binding. The implementation is responsible for storing information about the relocation so that it can be emitted during WriteObject().

Implemented in llvm::MachObjectWriter.

virtual void llvm::MCObjectWriter::reset ( ) [inline, virtual]

lifetime management

Reimplemented in llvm::MachObjectWriter.

Definition at line 56 of file MCObjectWriter.h.

Referenced by llvm::MCAssembler::reset().

void llvm::MCObjectWriter::Write16 ( uint16_t  Value) [inline]
void llvm::MCObjectWriter::Write32 ( uint32_t  Value) [inline]
void llvm::MCObjectWriter::Write64 ( uint64_t  Value) [inline]
void llvm::MCObjectWriter::Write8 ( uint8_t  Value) [inline]
void llvm::MCObjectWriter::WriteBE16 ( uint16_t  Value) [inline]

Definition at line 133 of file MCObjectWriter.h.

void llvm::MCObjectWriter::WriteBE32 ( uint32_t  Value) [inline]

Definition at line 138 of file MCObjectWriter.h.

void llvm::MCObjectWriter::WriteBE64 ( uint64_t  Value) [inline]

Definition at line 143 of file MCObjectWriter.h.

void llvm::MCObjectWriter::WriteBytes ( const SmallVectorImpl< char > &  ByteVec,
unsigned  ZeroFillSize = 0 
) [inline]
void llvm::MCObjectWriter::WriteBytes ( StringRef  Str,
unsigned  ZeroFillSize = 0 
) [inline]

Definition at line 182 of file MCObjectWriter.h.

void llvm::MCObjectWriter::WriteLE16 ( uint16_t  Value) [inline]

Definition at line 118 of file MCObjectWriter.h.

void llvm::MCObjectWriter::WriteLE32 ( uint32_t  Value) [inline]

Definition at line 123 of file MCObjectWriter.h.

void llvm::MCObjectWriter::WriteLE64 ( uint64_t  Value) [inline]

Definition at line 128 of file MCObjectWriter.h.

virtual void llvm::MCObjectWriter::WriteObject ( MCAssembler Asm,
const MCAsmLayout Layout 
) [pure virtual]

Write the object file.

This routine is called by the assembler after layout and relaxation is complete, fixups have been evaluated and applied, and relocations generated.

Implemented in llvm::MachObjectWriter.

Referenced by llvm::MCAssembler::Finish().

Definition at line 169 of file MCObjectWriter.h.

Referenced by llvm::MachObjectWriter::WriteObject().


Member Data Documentation

Definition at line 46 of file MCObjectWriter.h.

Referenced by isLittleEndian().


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