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

This represents a section on a Mach-O system (used by Mac OS X). More...

#include "llvm/MC/MCSectionMachO.h"

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

Public Member Functions

StringRef getSegmentName () const
 
unsigned getTypeAndAttributes () const
 
unsigned getStubSize () const
 
MachO::SectionType getType () const
 
bool hasAttribute (unsigned Value) 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.
 
void allocAtoms ()
 
const MCSymbolgetAtom (size_t I) const
 
void setAtom (size_t I, const MCSymbol *Sym)
 
unsigned getLayoutOrder () const
 
void setLayoutOrder (unsigned Value)
 
- 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 Error ParseSectionSpecifier (StringRef Spec, StringRef &Segment, StringRef &Section, unsigned &TAA, bool &TAAParsed, unsigned &StubSize)
 Parse the section specifier indicated by "Spec".
 
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 a Mach-O system (used by Mac OS X).

On a Mac system, these are also described in /usr/include/mach-o/loader.h.

Definition at line 24 of file MCSectionMachO.h.

Member Function Documentation

◆ allocAtoms()

void MCSectionMachO::allocAtoms ( )

Definition at line 290 of file MCSectionMachO.cpp.

References llvm::MCSection::curFragList().

◆ classof()

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

Definition at line 90 of file MCSectionMachO.h.

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

◆ getAtom()

const MCSymbol * MCSectionMachO::getAtom ( size_t  I) const

Definition at line 296 of file MCSectionMachO.cpp.

References I.

◆ getLayoutOrder()

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

Definition at line 87 of file MCSectionMachO.h.

◆ getSegmentName()

StringRef llvm::MCSectionMachO::getSegmentName ( ) const
inline

◆ getStubSize()

unsigned llvm::MCSectionMachO::getStubSize ( ) const
inline

◆ getType()

MachO::SectionType llvm::MCSectionMachO::getType ( ) const
inline

◆ getTypeAndAttributes()

unsigned llvm::MCSectionMachO::getTypeAndAttributes ( ) const
inline

◆ hasAttribute()

bool llvm::MCSectionMachO::hasAttribute ( unsigned  Value) const
inline

Definition at line 61 of file MCSectionMachO.h.

Referenced by useCodeAlign().

◆ ParseSectionSpecifier()

Error MCSectionMachO::ParseSectionSpecifier ( StringRef  Spec,
StringRef Segment,
StringRef Section,
unsigned TAA,
bool TAAParsed,
unsigned StubSize 
)
static

Parse the section specifier indicated by "Spec".

ParseSectionSpecifier - Parse the section specifier indicated by "Spec".

This is a string that can appear after a .section directive in a mach-o flavored .s file. If successful, this fills in the specified Out parameters and returns an empty string. When an invalid section specifier is present, this returns an Error indicating the problem. If no TAA was parsed, TAA is not altered, and TAAWasSet becomes false.

This is a string that can appear after a .section directive in a mach-o flavored .s file. If successful, this fills in the specified Out parameters and returns an empty string. When an invalid section specifier is present, this returns a string indicating the problem.

Definition at line 181 of file MCSectionMachO.cpp.

References llvm::createStringError(), llvm::StringRef::empty(), llvm::find_if(), llvm::StringRef::getAsInteger(), Idx, llvm::inconvertibleErrorCode(), llvm::MachO::S_SYMBOL_STUBS, llvm::MachO::SECTION_TYPE, SectionAttrDescriptors, SectionTypeDescriptors, llvm::SmallVectorBase< Size_T >::size(), and llvm::Error::success().

Referenced by llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), and llvm::TargetLoweringObjectFileMachO::getExplicitSectionGlobal().

◆ printSwitchToSection()

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

◆ setAtom()

void MCSectionMachO::setAtom ( size_t  I,
const MCSymbol Sym 
)

Definition at line 300 of file MCSectionMachO.cpp.

References I, and Sym.

◆ setLayoutOrder()

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

Definition at line 88 of file MCSectionMachO.h.

◆ useCodeAlign()

bool MCSectionMachO::useCodeAlign ( ) const
overridevirtual

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

Implements llvm::MCSection.

Definition at line 172 of file MCSectionMachO.cpp.

References hasAttribute(), and llvm::MachO::S_ATTR_PURE_INSTRUCTIONS.

Friends And Related Function Documentation

◆ MCContext

friend class MCContext
friend

Definition at line 44 of file MCSectionMachO.h.


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