LLVM 23.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
MCFragmentoperator= (const MCFragment &)=delete
MCFragmentgetNext () const
FragmentType getKind () const
MCSectiongetParent () const
void setParent (MCSection *Value)
LLVM_ABI const MCSymbolgetAtom () 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 MCSubtargetInfogetSubtargetInfo () 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< chargetContents ()
ArrayRef< chargetContents () const
LLVM_ABI void setVarContents (ArrayRef< char > Contents)
void clearVarContents ()
MutableArrayRef< chargetVarContents ()
ArrayRef< chargetVarContents () const
size_t getFixedSize () const
size_t getVarSize () const
size_t getSize () const
void clearFixups ()
LLVM_ABI void addFixup (MCFixup Fixup)
LLVM_ABI void appendFixups (ArrayRef< MCFixup > Fixups)
MutableArrayRef< MCFixupgetFixups ()
ArrayRef< MCFixupgetFixups () const
LLVM_ABI void setVarFixups (ArrayRef< MCFixup > Fixups)
void clearVarFixups ()
MutableArrayRef< MCFixupgetVarFixups ()
ArrayRef< MCFixupgetVarFixups () const
unsigned getOpcode () const
ArrayRef< MCOperandgetOperands () 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 MCSymbolgetPrefAlignEnd () 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 MCExprgetLEBValue () const
void setLEBValue (const MCExpr *Expr)
bool isLEBSigned () const
const MCExprgetDwarfAddrDelta () const
void setDwarfAddrDelta (const MCExpr *E)
int64_t getDwarfLineDelta () const
void setDwarfLineDelta (int64_t LineDelta)
const MCExprgetSFrameAddrDelta () const
void setSFrameAddrDelta (const MCExpr *E)
MCFragmentgetSFrameFDE () const
void setSFrameFDE (MCFragment *F)

Protected Attributes

const MCSubtargetInfoSTI = nullptr

Friends

class MCAssembler
class MCStreamer
class MCObjectStreamer
class MCSection

Detailed Description

Definition at line 45 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 52 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(), and Fixup.

◆ appendFixups()

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

Definition at line 73 of file MCSection.cpp.

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

Referenced by addFixup().

◆ clearFixups()

void llvm::MCFragment::clearFixups ( )
inline

Definition at line 231 of file MCSection.h.

◆ clearVarContents()

void llvm::MCFragment::clearVarContents ( )
inline

Definition at line 219 of file MCSection.h.

References setVarContents().

◆ clearVarFixups()

void llvm::MCFragment::clearVarFixups ( )
inline

Definition at line 240 of file MCSection.h.

References setVarFixups().

◆ dump()

◆ getAlignFill()

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

Definition at line 268 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignFillLen()

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

Definition at line 272 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignMaxBytesToEmit()

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

Definition at line 276 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignment()

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

Definition at line 264 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAllowAutoPadding()

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

Definition at line 209 of file MCSection.h.

◆ getAtom()

const MCSymbol * MCFragment::getAtom ( ) const

◆ getContents() [1/2]

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

Definition at line 689 of file MCSection.h.

Referenced by dump().

◆ getContents() [2/2]

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

Definition at line 692 of file MCSection.h.

◆ getDwarfAddrDelta()

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

Definition at line 345 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 353 of file MCSection.h.

References assert(), and FT_Dwarf.

Referenced by dump().

◆ getFixedSize()

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

Definition at line 223 of file MCSection.h.

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

◆ getFixups() [1/2]

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

Definition at line 707 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 711 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 179 of file MCSection.h.

Referenced by dump().

◆ getLayoutOrder()

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

Definition at line 186 of file MCSection.h.

Referenced by attemptToFoldSymbolOffsetDifference().

◆ getLEBValue()

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

Definition at line 331 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 245 of file MCSection.h.

References assert(), and FT_Relaxable.

◆ getOperands()

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

Definition at line 725 of file MCSection.h.

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

◆ getParent()

◆ getPrefAlignComputed()

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

Definition at line 307 of file MCSection.h.

References assert(), and FT_PrefAlign.

Referenced by dump().

◆ getPrefAlignEmitNops()

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

Definition at line 315 of file MCSection.h.

References assert(), and FT_PrefAlign.

◆ getPrefAlignEnd()

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

Definition at line 299 of file MCSection.h.

References assert(), and FT_PrefAlign.

Referenced by dump().

◆ getPrefAlignFill()

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

Definition at line 319 of file MCSection.h.

References assert(), and FT_PrefAlign.

◆ getPrefAlignPreferred()

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

Definition at line 303 of file MCSection.h.

References assert(), and FT_PrefAlign.

Referenced by dump().

◆ getSFrameAddrDelta()

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

Definition at line 363 of file MCSection.h.

References assert(), and FT_SFrame.

◆ getSFrameFDE()

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

Definition at line 371 of file MCSection.h.

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

◆ getSize()

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

Definition at line 225 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 197 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 700 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 716 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 720 of file MCSection.h.

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

◆ getVarSize()

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

Definition at line 224 of file MCSection.h.

◆ hasAlignEmitNops()

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

Definition at line 280 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 191 of file MCSection.h.

◆ isLEBSigned()

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

Definition at line 339 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 206 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 254 of file MCSection.h.

References FT_Align.

◆ makeLEB()

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

Definition at line 325 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 290 of file MCSection.h.

References FT_PrefAlign.

◆ operator=()

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

References MCFragment().

◆ setAllowAutoPadding()

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

Definition at line 210 of file MCSection.h.

◆ setDwarfAddrDelta()

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

Definition at line 349 of file MCSection.h.

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

◆ setDwarfLineDelta()

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

Definition at line 357 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 201 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 187 of file MCSection.h.

◆ setLEBValue()

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

Definition at line 335 of file MCSection.h.

References assert(), and FT_LEB.

◆ setLinkerRelaxable()

void llvm::MCFragment::setLinkerRelaxable ( )
inline

Definition at line 207 of file MCSection.h.

◆ setParent()

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

Definition at line 182 of file MCSection.h.

References MCSection.

◆ setPrefAlignComputed()

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

Definition at line 311 of file MCSection.h.

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

◆ setSFrameAddrDelta()

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

Definition at line 367 of file MCSection.h.

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

◆ setSFrameFDE()

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

Definition at line 375 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 46 of file MCSection.h.

References MCAssembler.

Referenced by MCAssembler.

◆ MCObjectStreamer

friend class MCObjectStreamer
friend

Definition at line 48 of file MCSection.h.

References MCObjectStreamer.

Referenced by MCObjectStreamer.

◆ MCSection

friend class MCSection
friend

Definition at line 49 of file MCSection.h.

References MCSection.

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

◆ MCStreamer

friend class MCStreamer
friend

Definition at line 47 of file MCSection.h.

References MCStreamer.

Referenced by MCStreamer.

Member Data Documentation

◆ STI


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