LLVM 24.0.0git
llvm::MCFragment Class Reference

#include "llvm/MC/MCSection.h"

Inheritance diagram for llvm::MCFragment:
[legend]

Public Types

enum  FragmentType : uint8_t {
  FT_Data , FT_Relaxable , FT_Align , FT_PrefAlign ,
  FT_Fill , FT_LEB , FT_Nops , FT_Org ,
  FT_Dwarf , FT_DwarfFrame , FT_SFrame , FT_BoundaryAlign ,
  FT_SymbolId , FT_CVInlineLines , FT_CVDefRange
}

Public Member Functions

LLVM_ABI MCFragment (FragmentType Kind=MCFragment::FT_Data, bool HasInstructions=false)
 MCFragment (const MCFragment &)=delete
MCFragment & operator= (const MCFragment &)=delete
MCFragment * getNext () const
FragmentType getKind () const
MCSection * getParent () const
void setParent (MCSection *Value)
LLVM_ABI const MCSymbol * getAtom () const
unsigned getLayoutOrder () const
void setLayoutOrder (unsigned Value)
bool hasInstructions () const
 Does this fragment have instructions emitted into it?
LLVM_ABI void dump () const
const MCSubtargetInfo * getSubtargetInfo () const
 Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
void setHasInstructions (const MCSubtargetInfo &STI)
 Record that the fragment contains instructions with the MCSubtargetInfo in effect when the instruction was encoded.
bool isLinkerRelaxable () const
void setLinkerRelaxable ()
bool getAllowAutoPadding () const
void setAllowAutoPadding (bool V)
MutableArrayRef< char > getContents ()
ArrayRef< char > getContents () const
LLVM_ABI void setVarContents (ArrayRef< char > Contents)
void clearVarContents ()
MutableArrayRef< char > getVarContents ()
ArrayRef< char > getVarContents () const
size_t getFixedSize () const
size_t getVarSize () const
size_t getSize () const
void clearFixups ()
LLVM_ABI void addFixup (MCFixup Fixup)
LLVM_ABI void insertRelocFixups (ArrayRef< MCFixup > Fixups)
LLVM_ABI void appendFixups (ArrayRef< MCFixup > Fixups)
LLVM_ABI void moveFixupsToEnd ()
MutableArrayRef< MCFixup > getFixups ()
ArrayRef< MCFixup > getFixups () const
LLVM_ABI void setVarFixups (ArrayRef< MCFixup > Fixups)
void clearVarFixups ()
MutableArrayRef< MCFixup > getVarFixups ()
ArrayRef< MCFixup > getVarFixups () const
unsigned getOpcode () const
ArrayRef< MCOperand > getOperands () const
MCInst getInst () const
void setInst (const MCInst &Inst)
void makeAlign (Align Alignment, int64_t Fill, uint8_t FillLen, unsigned MaxBytesToEmit)
Align getAlignment () const
int64_t getAlignFill () const
uint8_t getAlignFillLen () const
unsigned getAlignMaxBytesToEmit () const
bool hasAlignEmitNops () const
void makePrefAlign (Align PrefAlign, const MCSymbol &End, bool EmitNops, uint8_t Fill)
const MCSymbol & getPrefAlignEnd () const
Align getPrefAlignPreferred () const
Align getPrefAlignComputed () const
void setPrefAlignComputed (Align A)
bool getPrefAlignEmitNops () const
uint8_t getPrefAlignFill () const
void makeLEB (bool IsSigned, const MCExpr *Value)
const MCExpr & getLEBValue () const
void setLEBValue (const MCExpr *Expr)
bool isLEBSigned () const
const MCExpr & getDwarfAddrDelta () const
void setDwarfAddrDelta (const MCExpr *E)
int64_t getDwarfLineDelta () const
void setDwarfLineDelta (int64_t LineDelta)
const MCExpr & getSFrameAddrDelta () const
void setSFrameAddrDelta (const MCExpr *E)
MCFragment * getSFrameFDE () const
void setSFrameFDE (MCFragment *F)

Protected Attributes

const MCSubtargetInfo * STI = nullptr

Friends

class MCAssembler
class MCStreamer
class MCObjectStreamer
class MCSection

Detailed Description

Definition at line 42 of file MCSection.h.

Member Enumeration Documentation

◆ FragmentType

Enumerator
FT_Data 
FT_Relaxable 
FT_Align 
FT_PrefAlign 
FT_Fill 
FT_LEB 
FT_Nops 
FT_Org 
FT_Dwarf 
FT_DwarfFrame 
FT_SFrame 
FT_BoundaryAlign 
FT_SymbolId 
FT_CVInlineLines 
FT_CVDefRange 

Definition at line 49 of file MCSection.h.

Constructor & Destructor Documentation

◆ MCFragment() [1/2]

◆ MCFragment() [2/2]

llvm::MCFragment::MCFragment ( const MCFragment & )
delete

References MCFragment().

Member Function Documentation

◆ addFixup()

void MCFragment::addFixup ( MCFixup Fixup)

Definition at line 71 of file MCSection.cpp.

References appendFixups().

◆ appendFixups()

void MCFragment::appendFixups ( ArrayRef< MCFixup > Fixups)

Definition at line 85 of file MCSection.cpp.

References getParent(), and moveFixupsToEnd().

Referenced by addFixup().

◆ clearFixups()

void llvm::MCFragment::clearFixups ( )
inline

Definition at line 228 of file MCSection.h.

◆ clearVarContents()

void llvm::MCFragment::clearVarContents ( )
inline

Definition at line 216 of file MCSection.h.

References setVarContents().

◆ clearVarFixups()

void llvm::MCFragment::clearVarFixups ( )
inline

Definition at line 241 of file MCSection.h.

References setVarFixups().

◆ dump()

◆ getAlignFill()

int64_t llvm::MCFragment::getAlignFill ( ) const
inline

Definition at line 269 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignFillLen()

uint8_t llvm::MCFragment::getAlignFillLen ( ) const
inline

Definition at line 273 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignMaxBytesToEmit()

unsigned llvm::MCFragment::getAlignMaxBytesToEmit ( ) const
inline

Definition at line 277 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignment()

Align llvm::MCFragment::getAlignment ( ) const
inline

Definition at line 265 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAllowAutoPadding()

bool llvm::MCFragment::getAllowAutoPadding ( ) const
inline

Definition at line 206 of file MCSection.h.

◆ getAtom()

const MCSymbol * MCFragment::getAtom ( ) const

◆ getContents() [1/2]

MutableArrayRef< char > llvm::MCFragment::getContents ( )
inline

Definition at line 704 of file MCSection.h.

Referenced by dump().

◆ getContents() [2/2]

ArrayRef< char > llvm::MCFragment::getContents ( ) const
inline

Definition at line 707 of file MCSection.h.

◆ getDwarfAddrDelta()

const MCExpr & llvm::MCFragment::getDwarfAddrDelta ( ) const
inline

Definition at line 346 of file MCSection.h.

References assert(), FT_Dwarf, and FT_DwarfFrame.

Referenced by dump().

◆ getDwarfLineDelta()

int64_t llvm::MCFragment::getDwarfLineDelta ( ) const
inline

Definition at line 354 of file MCSection.h.

References assert(), and FT_Dwarf.

Referenced by dump().

◆ getFixedSize()

size_t llvm::MCFragment::getFixedSize ( ) const
inline

Definition at line 220 of file MCSection.h.

Referenced by llvm::AsmPrinter::emitFunctionBody(), and setVarFixups().

◆ getFixups() [1/2]

MutableArrayRef< MCFixup > llvm::MCFragment::getFixups ( )
inline

Definition at line 722 of file MCSection.h.

References getParent(), llvm::MutableArrayRef(), and llvm::MutableArrayRef< T >::slice().

Referenced by dump().

◆ getFixups() [2/2]

ArrayRef< MCFixup > llvm::MCFragment::getFixups ( ) const
inline

Definition at line 726 of file MCSection.h.

References llvm::ArrayRef(), getParent(), and llvm::ArrayRef< T >::slice().

◆ getInst()

MCInst llvm::MCFragment::getInst ( ) const
inline

◆ getKind()

FragmentType llvm::MCFragment::getKind ( ) const
inline

Definition at line 176 of file MCSection.h.

Referenced by dump().

◆ getLayoutOrder()

unsigned llvm::MCFragment::getLayoutOrder ( ) const
inline

Definition at line 183 of file MCSection.h.

Referenced by attemptToFoldSymbolOffsetDifference().

◆ getLEBValue()

const MCExpr & llvm::MCFragment::getLEBValue ( ) const
inline

Definition at line 332 of file MCSection.h.

References assert(), and FT_LEB.

Referenced by dump(), and llvm::RISCVAsmBackend::relaxLEB128().

◆ getNext()

MCFragment * llvm::MCFragment::getNext ( ) const
inline

◆ getOpcode()

unsigned llvm::MCFragment::getOpcode ( ) const
inline

Definition at line 246 of file MCSection.h.

References assert(), and FT_Relaxable.

◆ getOperands()

ArrayRef< MCOperand > llvm::MCFragment::getOperands ( ) const
inline

Definition at line 740 of file MCSection.h.

References assert(), FT_Relaxable, getParent(), and llvm::MutableArrayRef().

◆ getParent()

◆ getPrefAlignComputed()

Align llvm::MCFragment::getPrefAlignComputed ( ) const
inline

Definition at line 308 of file MCSection.h.

References assert(), and FT_PrefAlign.

Referenced by dump().

◆ getPrefAlignEmitNops()

bool llvm::MCFragment::getPrefAlignEmitNops ( ) const
inline

Definition at line 316 of file MCSection.h.

References assert(), and FT_PrefAlign.

◆ getPrefAlignEnd()

const MCSymbol & llvm::MCFragment::getPrefAlignEnd ( ) const
inline

Definition at line 300 of file MCSection.h.

References assert(), and FT_PrefAlign.

Referenced by dump().

◆ getPrefAlignFill()

uint8_t llvm::MCFragment::getPrefAlignFill ( ) const
inline

Definition at line 320 of file MCSection.h.

References assert(), and FT_PrefAlign.

◆ getPrefAlignPreferred()

Align llvm::MCFragment::getPrefAlignPreferred ( ) const
inline

Definition at line 304 of file MCSection.h.

References assert(), and FT_PrefAlign.

Referenced by dump().

◆ getSFrameAddrDelta()

const MCExpr & llvm::MCFragment::getSFrameAddrDelta ( ) const
inline

Definition at line 364 of file MCSection.h.

References assert(), and FT_SFrame.

◆ getSFrameFDE()

MCFragment * llvm::MCFragment::getSFrameFDE ( ) const
inline

Definition at line 372 of file MCSection.h.

References assert(), FT_SFrame, and MCFragment().

◆ getSize()

size_t llvm::MCFragment::getSize ( ) const
inline

Definition at line 222 of file MCSection.h.

◆ getSubtargetInfo()

const MCSubtargetInfo * llvm::MCFragment::getSubtargetInfo ( ) const
inline

Retrieve the MCSubTargetInfo in effect when the instruction was encoded.

Guaranteed to be non-null if hasInstructions() == true

Definition at line 194 of file MCSection.h.

References STI.

Referenced by writeFragment().

◆ getVarContents() [1/2]

MutableArrayRef< char > llvm::MCFragment::getVarContents ( )
inline

◆ getVarContents() [2/2]

ArrayRef< char > llvm::MCFragment::getVarContents ( ) const
inline

Definition at line 715 of file MCSection.h.

References llvm::ArrayRef(), getParent(), and llvm::MutableArrayRef< T >::slice().

◆ getVarFixups() [1/2]

MutableArrayRef< MCFixup > llvm::MCFragment::getVarFixups ( )
inline

Definition at line 731 of file MCSection.h.

References getParent(), llvm::MutableArrayRef(), and llvm::MutableArrayRef< T >::slice().

Referenced by dump().

◆ getVarFixups() [2/2]

ArrayRef< MCFixup > llvm::MCFragment::getVarFixups ( ) const
inline

Definition at line 735 of file MCSection.h.

References llvm::ArrayRef(), getParent(), and llvm::ArrayRef< T >::slice().

◆ getVarSize()

size_t llvm::MCFragment::getVarSize ( ) const
inline

Definition at line 221 of file MCSection.h.

◆ hasAlignEmitNops()

bool llvm::MCFragment::hasAlignEmitNops ( ) const
inline

Definition at line 281 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ hasInstructions()

bool llvm::MCFragment::hasInstructions ( ) const
inline

Does this fragment have instructions emitted into it?

By default this is false, but specific fragment types may set it to true.

Definition at line 188 of file MCSection.h.

◆ insertRelocFixups()

void MCFragment::insertRelocFixups ( ArrayRef< MCFixup > Fixups)

Definition at line 93 of file MCSection.cpp.

References getParent(), and moveFixupsToEnd().

◆ isLEBSigned()

bool llvm::MCFragment::isLEBSigned ( ) const
inline

Definition at line 340 of file MCSection.h.

References assert(), and FT_LEB.

Referenced by dump(), and llvm::RISCVAsmBackend::relaxLEB128().

◆ isLinkerRelaxable()

bool llvm::MCFragment::isLinkerRelaxable ( ) const
inline

Definition at line 203 of file MCSection.h.

Referenced by dump().

◆ makeAlign()

void llvm::MCFragment::makeAlign ( Align Alignment,
int64_t Fill,
uint8_t FillLen,
unsigned MaxBytesToEmit )
inline

Definition at line 255 of file MCSection.h.

References FT_Align.

◆ makeLEB()

void llvm::MCFragment::makeLEB ( bool IsSigned,
const MCExpr * Value )
inline

Definition at line 326 of file MCSection.h.

References assert(), FT_Data, and FT_LEB.

◆ makePrefAlign()

void llvm::MCFragment::makePrefAlign ( Align PrefAlign,
const MCSymbol & End,
bool EmitNops,
uint8_t Fill )
inline

Definition at line 291 of file MCSection.h.

References llvm::End, and FT_PrefAlign.

◆ moveFixupsToEnd()

void MCFragment::moveFixupsToEnd ( )

Definition at line 73 of file MCSection.cpp.

References getParent(), I, LLVM_UNLIKELY, and llvm::Size.

Referenced by appendFixups(), and insertRelocFixups().

◆ operator=()

MCFragment & llvm::MCFragment::operator= ( const MCFragment & )
delete

References MCFragment().

◆ setAllowAutoPadding()

void llvm::MCFragment::setAllowAutoPadding ( bool V)
inline

Definition at line 207 of file MCSection.h.

References V.

◆ setDwarfAddrDelta()

void llvm::MCFragment::setDwarfAddrDelta ( const MCExpr * E)
inline

Definition at line 350 of file MCSection.h.

References assert(), E(), FT_Dwarf, and FT_DwarfFrame.

◆ setDwarfLineDelta()

void llvm::MCFragment::setDwarfLineDelta ( int64_t LineDelta)
inline

Definition at line 358 of file MCSection.h.

References assert(), and FT_Dwarf.

◆ setHasInstructions()

void llvm::MCFragment::setHasInstructions ( const MCSubtargetInfo & STI)
inline

Record that the fragment contains instructions with the MCSubtargetInfo in effect when the instruction was encoded.

Definition at line 198 of file MCSection.h.

References STI.

◆ setInst()

void llvm::MCFragment::setInst ( const MCInst & Inst)
inline

◆ setLayoutOrder()

void llvm::MCFragment::setLayoutOrder ( unsigned Value)
inline

Definition at line 184 of file MCSection.h.

◆ setLEBValue()

void llvm::MCFragment::setLEBValue ( const MCExpr * Expr)
inline

Definition at line 336 of file MCSection.h.

References assert(), and FT_LEB.

◆ setLinkerRelaxable()

void llvm::MCFragment::setLinkerRelaxable ( )
inline

Definition at line 204 of file MCSection.h.

◆ setParent()

void llvm::MCFragment::setParent ( MCSection * Value)
inline

Definition at line 179 of file MCSection.h.

References MCSection.

◆ setPrefAlignComputed()

void llvm::MCFragment::setPrefAlignComputed ( Align A)
inline

Definition at line 312 of file MCSection.h.

References A(), assert(), and FT_PrefAlign.

◆ setSFrameAddrDelta()

void llvm::MCFragment::setSFrameAddrDelta ( const MCExpr * E)
inline

Definition at line 368 of file MCSection.h.

References assert(), E(), and FT_SFrame.

◆ setSFrameFDE()

void llvm::MCFragment::setSFrameFDE ( MCFragment * F)
inline

Definition at line 376 of file MCSection.h.

References assert(), F, FT_SFrame, and MCFragment().

◆ setVarContents()

◆ setVarFixups()

void MCFragment::setVarFixups ( ArrayRef< MCFixup > Fixups)

◆ MCAssembler

friend class MCAssembler
friend

Definition at line 43 of file MCSection.h.

References MCAssembler.

Referenced by MCAssembler.

◆ MCObjectStreamer

friend class MCObjectStreamer
friend

Definition at line 45 of file MCSection.h.

References MCObjectStreamer.

Referenced by MCObjectStreamer.

◆ MCSection

friend class MCSection
friend

Definition at line 46 of file MCSection.h.

References MCSection.

Referenced by getParent(), MCSection, and setParent().

◆ MCStreamer

friend class MCStreamer
friend

Definition at line 44 of file MCSection.h.

References MCStreamer.

Referenced by MCStreamer.

Member Data Documentation

◆ STI


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