LLVM 22.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_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 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)

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_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 215 of file MCSection.h.

◆ clearVarContents()

void llvm::MCFragment::clearVarContents ( )
inline

Definition at line 203 of file MCSection.h.

References setVarContents().

◆ clearVarFixups()

void llvm::MCFragment::clearVarFixups ( )
inline

Definition at line 224 of file MCSection.h.

References setVarFixups().

◆ dump()

◆ getAlignFill()

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

Definition at line 252 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignFillLen()

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

Definition at line 256 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignMaxBytesToEmit()

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

Definition at line 260 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignment()

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

Definition at line 248 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAllowAutoPadding()

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

Definition at line 193 of file MCSection.h.

◆ getAtom()

const MCSymbol * MCFragment::getAtom ( ) const

◆ getContents() [1/2]

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

Definition at line 640 of file MCSection.h.

Referenced by dump().

◆ getContents() [2/2]

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

Definition at line 643 of file MCSection.h.

◆ getDwarfAddrDelta()

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

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

References assert(), and FT_Dwarf.

Referenced by dump().

◆ getFixedSize()

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

Definition at line 207 of file MCSection.h.

Referenced by setVarFixups().

◆ getFixups() [1/2]

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

Definition at line 658 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 662 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 163 of file MCSection.h.

Referenced by dump().

◆ getLayoutOrder()

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

Definition at line 170 of file MCSection.h.

Referenced by attemptToFoldSymbolOffsetDifference().

◆ getLEBValue()

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

Definition at line 276 of file MCSection.h.

References assert(), and FT_LEB.

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

◆ getNext()

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

Definition at line 161 of file MCSection.h.

References MCFragment().

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

◆ getOpcode()

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

Definition at line 229 of file MCSection.h.

References assert(), and FT_Relaxable.

◆ getOperands()

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

Definition at line 676 of file MCSection.h.

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

◆ getParent()

◆ getSFrameAddrDelta()

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

Definition at line 308 of file MCSection.h.

References assert(), and FT_SFrame.

◆ getSFrameFDE()

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

Definition at line 316 of file MCSection.h.

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

◆ getSize()

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

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

◆ getVarContents() [1/2]

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

◆ getVarContents() [2/2]

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

Definition at line 651 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 667 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 671 of file MCSection.h.

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

◆ getVarSize()

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

Definition at line 208 of file MCSection.h.

◆ hasAlignEmitNops()

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

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

◆ isLEBSigned()

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

Definition at line 284 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 190 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 238 of file MCSection.h.

References FT_Align.

◆ makeLEB()

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

Definition at line 270 of file MCSection.h.

References assert(), FT_Data, and FT_LEB.

◆ operator=()

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

References MCFragment().

◆ setAllowAutoPadding()

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

Definition at line 194 of file MCSection.h.

◆ setDwarfAddrDelta()

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

Definition at line 294 of file MCSection.h.

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

◆ setDwarfLineDelta()

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

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

◆ setInst()

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

◆ setLayoutOrder()

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

Definition at line 171 of file MCSection.h.

◆ setLEBValue()

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

Definition at line 280 of file MCSection.h.

References assert(), and FT_LEB.

◆ setLinkerRelaxable()

void llvm::MCFragment::setLinkerRelaxable ( )
inline

Definition at line 191 of file MCSection.h.

◆ setParent()

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

Definition at line 166 of file MCSection.h.

References MCSection.

◆ setSFrameAddrDelta()

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

Definition at line 312 of file MCSection.h.

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

◆ setSFrameFDE()

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

Definition at line 320 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.


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