LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::MCSectionELF Class Referencefinal

This represents a section on linux, lots of unix variants and some bare metal systems. More...

#include "llvm/MC/MCSectionELF.h"

Inheritance diagram for llvm::MCSectionELF:
Inheritance graph
[legend]

Public Member Functions

bool shouldOmitSectionDirective (StringRef Name, const MCAsmInfo &MAI) const
 Decides whether a '.section' directive should be printed before the section name.
 
unsigned getType () const
 
unsigned getFlags () const
 
unsigned getEntrySize () const
 
void setFlags (unsigned F)
 
const MCSymbolELFgetGroup () const
 
bool isComdat () const
 
void printSwitchToSection (const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, uint32_t Subsection) const override
 
bool useCodeAlign () const override
 Return true if a .align directive should use "optimized nops" to fill instead of 0s.
 
StringRef getVirtualSectionKind () const override
 
bool isUnique () const
 
unsigned getUniqueID () const
 
const MCSectiongetLinkedToSection () const
 
const MCSymbolgetLinkedToSymbol () const
 
void setOffsets (uint64_t Start, uint64_t End)
 
std::pair< uint64_t, uint64_tgetOffsets () const
 
- Public Member Functions inherited from llvm::MCSection
 MCSection (const MCSection &)=delete
 
MCSectionoperator= (const MCSection &)=delete
 
StringRef getName () const
 
bool isText () const
 
SectionVariant getVariant () const
 
MCSymbolgetBeginSymbol ()
 
const MCSymbolgetBeginSymbol () const
 
void setBeginSymbol (MCSymbol *Sym)
 
MCSymbolgetEndSymbol (MCContext &Ctx)
 
bool hasEnded () const
 
Align getAlign () const
 
void setAlignment (Align Value)
 
void ensureMinAlignment (Align MinAlignment)
 Makes sure that Alignment is at least MinAlignment.
 
unsigned getOrdinal () const
 
void setOrdinal (unsigned Value)
 
BundleLockStateType getBundleLockState () const
 
void setBundleLockState (BundleLockStateType NewState)
 
bool isBundleLocked () const
 
bool isBundleGroupBeforeFirstInst () const
 
void setBundleGroupBeforeFirstInst (bool IsFirst)
 
bool hasInstructions () const
 
void setHasInstructions (bool Value)
 
bool hasLayout () const
 
void setHasLayout (bool Value)
 
bool isRegistered () const
 
void setIsRegistered (bool Value)
 
const MCDummyFragmentgetDummyFragment () const
 
MCDummyFragmentgetDummyFragment ()
 
FragListcurFragList () const
 
iterator begin () const
 
iterator end () const
 
bool empty () const
 
void dump () const
 
virtual void printSwitchToSection (const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, uint32_t Subsection) const =0
 
virtual bool useCodeAlign () const =0
 Return true if a .align directive should use "optimized nops" to fill instead of 0s.
 
bool isVirtualSection () const
 Check whether this section is "virtual", that is has no actual object file contents.
 
virtual StringRef getVirtualSectionKind () const
 

Static Public Member Functions

static bool classof (const MCSection *S)
 

Friends

class MCContext
 

Additional Inherited Members

- Public Types inherited from llvm::MCSection
enum  SectionVariant {
  SV_COFF = 0 , SV_ELF , SV_GOFF , SV_MachO ,
  SV_Wasm , SV_XCOFF , SV_SPIRV , SV_DXContainer
}
 
enum  BundleLockStateType { NotBundleLocked , BundleLocked , BundleLockedAlignToEnd }
 Express the state of bundle locked groups while emitting code. More...
 
- Public Attributes inherited from llvm::MCSection
friend MCAssembler
 
friend MCObjectStreamer
 
- Static Public Attributes inherited from llvm::MCSection
static constexpr unsigned NonUniqueID = ~0U
 
- Protected Member Functions inherited from llvm::MCSection
 MCSection (SectionVariant V, StringRef Name, bool IsText, bool IsVirtual, MCSymbol *Begin)
 
 ~MCSection ()
 
- Protected Attributes inherited from llvm::MCSection
StringRef Name
 
SectionVariant Variant
 

Detailed Description

This represents a section on linux, lots of unix variants and some bare metal systems.

Definition at line 27 of file MCSectionELF.h.

Member Function Documentation

◆ classof()

static bool llvm::MCSectionELF::classof ( const MCSection S)
inlinestatic

Definition at line 107 of file MCSectionELF.h.

References llvm::MCSection::getVariant(), and llvm::MCSection::SV_ELF.

◆ getEntrySize()

unsigned llvm::MCSectionELF::getEntrySize ( ) const
inline

Definition at line 80 of file MCSectionELF.h.

◆ getFlags()

unsigned llvm::MCSectionELF::getFlags ( ) const
inline

Definition at line 79 of file MCSectionELF.h.

Referenced by llvm::ELFObjectWriter::shouldRelocateWithSymbol(), and useCodeAlign().

◆ getGroup()

const MCSymbolELF * llvm::MCSectionELF::getGroup ( ) const
inline

◆ getLinkedToSection()

const MCSection * llvm::MCSectionELF::getLinkedToSection ( ) const
inline

Definition at line 94 of file MCSectionELF.h.

References llvm::MCSymbol::getSection().

◆ getLinkedToSymbol()

const MCSymbol * llvm::MCSectionELF::getLinkedToSymbol ( ) const
inline

Definition at line 97 of file MCSectionELF.h.

◆ getOffsets()

std::pair< uint64_t, uint64_t > llvm::MCSectionELF::getOffsets ( ) const
inline

Definition at line 103 of file MCSectionELF.h.

◆ getType()

unsigned llvm::MCSectionELF::getType ( ) const
inline

Definition at line 78 of file MCSectionELF.h.

References Type.

Referenced by llvm::ELFObjectWriter::usesRela().

◆ getUniqueID()

unsigned llvm::MCSectionELF::getUniqueID ( ) const
inline

◆ getVirtualSectionKind()

StringRef MCSectionELF::getVirtualSectionKind ( ) const
overridevirtual

Reimplemented from llvm::MCSection.

Definition at line 213 of file MCSectionELF.cpp.

◆ isComdat()

bool llvm::MCSectionELF::isComdat ( ) const
inline

◆ isUnique()

bool llvm::MCSectionELF::isUnique ( ) const
inline

Definition at line 91 of file MCSectionELF.h.

References llvm::MCSection::NonUniqueID.

Referenced by printSwitchToSection(), and shouldOmitSectionDirective().

◆ printSwitchToSection()

void MCSectionELF::printSwitchToSection ( const MCAsmInfo MAI,
const Triple T,
raw_ostream OS,
uint32_t  Subsection 
) const
overridevirtual

◆ setFlags()

void llvm::MCSectionELF::setFlags ( unsigned  F)
inline

Definition at line 81 of file MCSectionELF.h.

References F.

◆ setOffsets()

void llvm::MCSectionELF::setOffsets ( uint64_t  Start,
uint64_t  End 
)
inline

Definition at line 99 of file MCSectionELF.h.

References End.

◆ shouldOmitSectionDirective()

bool MCSectionELF::shouldOmitSectionDirective ( StringRef  Name,
const MCAsmInfo MAI 
) const

Decides whether a '.section' directive should be printed before the section name.

Definition at line 22 of file MCSectionELF.cpp.

References isUnique(), llvm::MCSection::Name, and llvm::MCAsmInfo::shouldOmitSectionDirective().

Referenced by printSwitchToSection().

◆ useCodeAlign()

bool MCSectionELF::useCodeAlign ( ) const
overridevirtual

Return true if a .align directive should use "optimized nops" to fill instead of 0s.

Implements llvm::MCSection.

Definition at line 209 of file MCSectionELF.cpp.

References getFlags(), and llvm::ELF::SHF_EXECINSTR.

Friends And Related Function Documentation

◆ MCContext

friend class MCContext
friend

Definition at line 54 of file MCSectionELF.h.


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