LLVM API Documentation

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

MCAsmBackend - Generic interface to target specific assembler backends. More...

#include <MCAsmBackend.h>

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

List of all members.

Public Member Functions

virtual ~MCAsmBackend ()
virtual void reset ()
 lifetime management
virtual MCObjectWritercreateObjectWriter (raw_ostream &OS) const =0
virtual MCELFObjectTargetWritercreateELFObjectTargetWriter () const
bool hasDataInCodeSupport () const
virtual bool doesSectionRequireSymbols (const MCSection &Section) const
virtual bool isSectionAtomizable (const MCSection &Section) const
virtual unsigned getMinimumNopSize () const
virtual bool writeNopData (uint64_t Count, MCObjectWriter *OW) const =0
virtual void handleAssemblerFlag (MCAssemblerFlag Flag)
virtual uint32_t generateCompactUnwindEncoding (ArrayRef< MCCFIInstruction >) const
 Generate the compact unwind encoding for the CFI instructions.
Target Fixup Interfaces
virtual unsigned getNumFixupKinds () const =0
 getNumFixupKinds - Get the number of target specific fixup kinds.
virtual const MCFixupKindInfogetFixupKindInfo (MCFixupKind Kind) const
 getFixupKindInfo - Get information on a fixup kind.
virtual void processFixupValue (const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFixup &Fixup, const MCFragment *DF, const MCValue &Target, uint64_t &Value, bool &IsResolved)
virtual void applyFixup (const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value, bool IsPCRel) const =0
Target Relaxation Interfaces
virtual bool mayNeedRelaxation (const MCInst &Inst) const =0
virtual bool fixupNeedsRelaxation (const MCFixup &Fixup, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout) const =0
virtual void relaxInstruction (const MCInst &Inst, MCInst &Res) const =0

Protected Member Functions

 MCAsmBackend ()

Protected Attributes

unsigned HasDataInCodeSupport: 1

Detailed Description

MCAsmBackend - Generic interface to target specific assembler backends.

Definition at line 34 of file MCAsmBackend.h.


Constructor & Destructor Documentation

MCAsmBackend::MCAsmBackend ( ) [protected]

Definition at line 15 of file MCAsmBackend.cpp.

Definition at line 17 of file MCAsmBackend.cpp.


Member Function Documentation

virtual void llvm::MCAsmBackend::applyFixup ( const MCFixup Fixup,
char *  Data,
unsigned  DataSize,
uint64_t  Value,
bool  IsPCRel 
) const [pure virtual]

applyFixup - Apply the Value for given Fixup into the provided data fragment, at the offset specified by the fixup and following the fixup kind as appropriate.

Implemented in llvm::MipsAsmBackend.

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

createELFObjectTargetWriter - Create a new ELFObjectTargetWriter to enable non-standard ELFObjectWriters.

Definition at line 55 of file MCAsmBackend.h.

References llvm_unreachable.

virtual MCObjectWriter* llvm::MCAsmBackend::createObjectWriter ( raw_ostream OS) const [pure virtual]

createObjectWriter - Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file.

Implemented in llvm::MipsAsmBackend.

virtual bool llvm::MCAsmBackend::doesSectionRequireSymbols ( const MCSection Section) const [inline, virtual]

doesSectionRequireSymbols - Check whether the given section requires that all symbols (even temporaries) have symbol table entries.

Definition at line 66 of file MCAsmBackend.h.

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

virtual bool llvm::MCAsmBackend::fixupNeedsRelaxation ( const MCFixup Fixup,
uint64_t  Value,
const MCRelaxableFragment DF,
const MCAsmLayout Layout 
) const [pure virtual]

fixupNeedsRelaxation - Target specific predicate for whether a given fixup requires the associated instruction to be relaxed.

Implemented in llvm::MipsAsmBackend.

virtual uint32_t llvm::MCAsmBackend::generateCompactUnwindEncoding ( ArrayRef< MCCFIInstruction ) const [inline, virtual]

Generate the compact unwind encoding for the CFI instructions.

Definition at line 149 of file MCAsmBackend.h.

Referenced by llvm::MCStreamer::generateCompactUnwindEncodings().

getFixupKindInfo - Get information on a fixup kind.

Reimplemented in llvm::MipsAsmBackend.

Definition at line 20 of file MCAsmBackend.cpp.

References llvm::array_lengthof(), and llvm::MCFixupKindInfo::FKF_IsPCRel.

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

virtual unsigned llvm::MCAsmBackend::getMinimumNopSize ( ) const [inline, virtual]

getMinimumNopSize - Returns the minimum size of a nop in bytes on this target. The assembler will use this to emit excess padding in situations where the padding required for simple alignment would be less than the minimum nop size.

Definition at line 134 of file MCAsmBackend.h.

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

virtual unsigned llvm::MCAsmBackend::getNumFixupKinds ( ) const [pure virtual]

getNumFixupKinds - Get the number of target specific fixup kinds.

Implemented in llvm::MipsAsmBackend.

virtual void llvm::MCAsmBackend::handleAssemblerFlag ( MCAssemblerFlag  Flag) [inline, virtual]

handleAssemblerFlag - Handle any target-specific assembler flags. By default, do nothing.

Definition at line 145 of file MCAsmBackend.h.

Referenced by llvm::MCELFStreamer::EmitAssemblerFlag().

hasDataInCodeSupport - Check whether this target implements data-in-code markers. If not, data region directives will be ignored.

Definition at line 62 of file MCAsmBackend.h.

References HasDataInCodeSupport.

virtual bool llvm::MCAsmBackend::isSectionAtomizable ( const MCSection Section) const [inline, virtual]

isSectionAtomizable - Check whether the given section can be split into atoms.

See also:
MCAssembler::isSymbolLinkerVisible().

Definition at line 74 of file MCAsmBackend.h.

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

virtual bool llvm::MCAsmBackend::mayNeedRelaxation ( const MCInst Inst) const [pure virtual]

mayNeedRelaxation - Check whether the given instruction may need relaxation.

Parameters:
Inst- The instruction to test.

Implemented in llvm::MipsAsmBackend.

Referenced by llvm::MCObjectStreamer::EmitInstruction().

virtual void llvm::MCAsmBackend::processFixupValue ( const MCAssembler Asm,
const MCAsmLayout Layout,
const MCFixup Fixup,
const MCFragment DF,
const MCValue Target,
uint64_t &  Value,
bool IsResolved 
) [inline, virtual]

processFixupValue - Target hook to adjust the literal value of a fixup if necessary. IsResolved signals whether the caller believes a relocation is needed; the target can modify the value. The default does nothing.

Reimplemented in llvm::MipsAsmBackend.

Definition at line 90 of file MCAsmBackend.h.

virtual void llvm::MCAsmBackend::relaxInstruction ( const MCInst Inst,
MCInst Res 
) const [pure virtual]

RelaxInstruction - Relax the instruction in the given fragment to the next wider instruction.

Parameters:
InstThe instruction to relax, which may be the same as the output.
[out]ResOn return, the relaxed instruction.

Implemented in llvm::MipsAsmBackend.

Referenced by llvm::MCObjectStreamer::EmitInstruction().

virtual void llvm::MCAsmBackend::reset ( ) [inline, virtual]
virtual bool llvm::MCAsmBackend::writeNopData ( uint64_t  Count,
MCObjectWriter OW 
) const [pure virtual]

writeNopData - Write an (optimal) nop sequence of Count bytes to the given output. If the target cannot generate such a sequence, it should return an error.

Returns:
- True on success.

Implemented in llvm::MipsAsmBackend.

Referenced by writeFragment().


Member Data Documentation

Definition at line 41 of file MCAsmBackend.h.

Referenced by hasDataInCodeSupport().


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