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)

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

◆ clearVarContents()

void llvm::MCFragment::clearVarContents ( )
inline

Definition at line 205 of file MCSection.h.

References setVarContents().

◆ clearVarFixups()

void llvm::MCFragment::clearVarFixups ( )
inline

Definition at line 226 of file MCSection.h.

References setVarFixups().

◆ dump()

◆ getAlignFill()

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

Definition at line 254 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignFillLen()

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

Definition at line 258 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignMaxBytesToEmit()

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

Definition at line 262 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAlignment()

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

Definition at line 250 of file MCSection.h.

References assert(), and FT_Align.

Referenced by dump().

◆ getAllowAutoPadding()

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

Definition at line 195 of file MCSection.h.

◆ getAtom()

const MCSymbol * MCFragment::getAtom ( ) const

◆ getContents() [1/2]

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

Definition at line 636 of file MCSection.h.

Referenced by dump().

◆ getContents() [2/2]

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

Definition at line 639 of file MCSection.h.

◆ getDwarfAddrDelta()

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

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

References assert(), and FT_Dwarf.

Referenced by dump().

◆ getFixedSize()

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

Definition at line 209 of file MCSection.h.

Referenced by setVarFixups().

◆ getFixups() [1/2]

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

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

Referenced by dump().

◆ getLayoutOrder()

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

Definition at line 172 of file MCSection.h.

Referenced by attemptToFoldSymbolOffsetDifference().

◆ getLEBValue()

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

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

References MCFragment().

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

◆ getOpcode()

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

Definition at line 231 of file MCSection.h.

References assert(), and FT_Relaxable.

◆ getOperands()

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

Definition at line 672 of file MCSection.h.

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

◆ getParent()

◆ getSFrameAddrDelta()

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

Definition at line 310 of file MCSection.h.

References assert(), and FT_SFrame.

◆ getSFrameFDE()

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

Definition at line 318 of file MCSection.h.

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

◆ getSize()

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

Definition at line 211 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 183 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 647 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 663 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 667 of file MCSection.h.

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

◆ getVarSize()

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

Definition at line 210 of file MCSection.h.

◆ hasAlignEmitNops()

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

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

◆ isLEBSigned()

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

Definition at line 286 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 192 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 240 of file MCSection.h.

References FT_Align.

◆ makeLEB()

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

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

◆ setDwarfAddrDelta()

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

Definition at line 296 of file MCSection.h.

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

◆ setDwarfLineDelta()

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

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

◆ setLEBValue()

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

Definition at line 282 of file MCSection.h.

References assert(), and FT_LEB.

◆ setLinkerRelaxable()

void llvm::MCFragment::setLinkerRelaxable ( )
inline

Definition at line 193 of file MCSection.h.

◆ setParent()

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

Definition at line 168 of file MCSection.h.

References MCSection.

◆ setSFrameAddrDelta()

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

Definition at line 314 of file MCSection.h.

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

◆ setSFrameFDE()

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

Definition at line 322 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: