LLVM  8.0.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::MCSection Class Referenceabstract

Instances of this class represent a uniqued identifier for a section in the current translation unit. More...

#include "llvm/MC/MCSection.h"

Inheritance diagram for llvm::MCSection:
Inheritance graph
[legend]
Collaboration diagram for llvm::MCSection:
Collaboration graph
[legend]

Public Types

enum  SectionVariant { SV_COFF = 0, SV_ELF, SV_MachO, SV_Wasm }
 
enum  BundleLockStateType { NotBundleLocked, BundleLocked, BundleLockedAlignToEnd }
 Express the state of bundle locked groups while emitting code. More...
 
using FragmentListType = iplist< MCFragment >
 
using const_iterator = FragmentListType::const_iterator
 
using iterator = FragmentListType::iterator
 
using const_reverse_iterator = FragmentListType::const_reverse_iterator
 
using reverse_iterator = FragmentListType::reverse_iterator
 

Public Member Functions

 MCSection (const MCSection &)=delete
 
MCSectionoperator= (const MCSection &)=delete
 
SectionKind getKind () const
 
SectionVariant getVariant () const
 
MCSymbolgetBeginSymbol ()
 
const MCSymbolgetBeginSymbol () const
 
void setBeginSymbol (MCSymbol *Sym)
 
MCSymbolgetEndSymbol (MCContext &Ctx)
 
bool hasEnded () const
 
unsigned getAlignment () const
 
void setAlignment (unsigned Value)
 
unsigned getOrdinal () const
 
void setOrdinal (unsigned Value)
 
unsigned getLayoutOrder () const
 
void setLayoutOrder (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 hasData () const
 
void setHasData (bool Value)
 
bool isRegistered () const
 
void setIsRegistered (bool Value)
 
MCSection::FragmentListTypegetFragmentList ()
 
const MCSection::FragmentListTypegetFragmentList () const
 
const MCDummyFragmentgetDummyFragment () const
 
MCDummyFragmentgetDummyFragment ()
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
MCSection::iterator getSubsectionInsertionPoint (unsigned Subsection)
 
void dump () const
 
virtual void PrintSwitchToSection (const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, const MCExpr *Subsection) const =0
 
virtual bool UseCodeAlign () const =0
 Return true if a .align directive should use "optimized nops" to fill instead of 0s. More...
 
virtual bool isVirtualSection () const =0
 Check whether this section is "virtual", that is has no actual object file contents. More...
 

Static Public Member Functions

static FragmentListType MCSection::* getSublistAccess (MCFragment *)
 Support for MCFragment::getNextNode(). More...
 

Protected Member Functions

 MCSection (SectionVariant V, SectionKind K, MCSymbol *Begin)
 
 ~MCSection ()
 

Protected Attributes

SectionVariant Variant
 
SectionKind Kind
 

Detailed Description

Instances of this class represent a uniqued identifier for a section in the current translation unit.

The MCContext class uniques and creates these.

Definition at line 39 of file MCSection.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 52 of file MCSection.h.

◆ const_reverse_iterator

Definition at line 55 of file MCSection.h.

◆ FragmentListType

Definition at line 50 of file MCSection.h.

◆ iterator

Definition at line 53 of file MCSection.h.

◆ reverse_iterator

Definition at line 56 of file MCSection.h.

Member Enumeration Documentation

◆ BundleLockStateType

Express the state of bundle locked groups while emitting code.

Enumerator
NotBundleLocked 
BundleLocked 
BundleLockedAlignToEnd 

Definition at line 44 of file MCSection.h.

◆ SectionVariant

Enumerator
SV_COFF 
SV_ELF 
SV_MachO 
SV_Wasm 

Definition at line 41 of file MCSection.h.

Constructor & Destructor Documentation

◆ MCSection() [1/2]

MCSection::MCSection ( SectionVariant  V,
SectionKind  K,
MCSymbol Begin 
)
protected

Definition at line 24 of file MCSection.cpp.

◆ ~MCSection()

MCSection::~MCSection ( )
protecteddefault

Referenced by hasEnded().

◆ MCSection() [2/2]

llvm::MCSection::MCSection ( const MCSection )
delete

Member Function Documentation

◆ begin() [1/2]

iterator llvm::MCSection::begin ( )
inline

Definition at line 163 of file MCSection.h.

Referenced by dump(), llvm::MCAssembler::Finish(), and llvm::MCContext::getWasmSection().

◆ begin() [2/2]

const_iterator llvm::MCSection::begin ( ) const
inline

Definition at line 164 of file MCSection.h.

◆ dump()

LLVM_DUMP_METHOD void MCSection::dump ( ) const

Definition at line 91 of file MCSection.cpp.

References begin(), end(), and llvm::errs().

◆ end() [1/2]

iterator llvm::MCSection::end ( )
inline

Definition at line 166 of file MCSection.h.

Referenced by dump(), llvm::MCAssembler::Finish(), and getSubsectionInsertionPoint().

◆ end() [2/2]

const_iterator llvm::MCSection::end ( ) const
inline

Definition at line 167 of file MCSection.h.

◆ getAlignment()

unsigned llvm::MCSection::getAlignment ( ) const
inline

◆ getBeginSymbol() [1/2]

MCSymbol* llvm::MCSection::getBeginSymbol ( )
inline

◆ getBeginSymbol() [2/2]

const MCSymbol* llvm::MCSection::getBeginSymbol ( ) const
inline

Definition at line 111 of file MCSection.h.

◆ getBundleLockState()

BundleLockStateType llvm::MCSection::getBundleLockState ( ) const
inline

Definition at line 130 of file MCSection.h.

Referenced by CheckBundleSubtargets(), and llvm::MCELFStreamer::EmitBundleUnlock().

◆ getDummyFragment() [1/2]

const MCDummyFragment& llvm::MCSection::getDummyFragment ( ) const
inline

Definition at line 160 of file MCSection.h.

Referenced by getPlatformName().

◆ getDummyFragment() [2/2]

MCDummyFragment& llvm::MCSection::getDummyFragment ( )
inline

Definition at line 161 of file MCSection.h.

◆ getEndSymbol()

MCSymbol * MCSection::getEndSymbol ( MCContext Ctx)

Definition at line 29 of file MCSection.cpp.

References llvm::MCContext::createTempSymbol().

Referenced by llvm::MCStreamer::endSection().

◆ getFragmentList() [1/2]

MCSection::FragmentListType& llvm::MCSection::getFragmentList ( )
inline

◆ getFragmentList() [2/2]

const MCSection::FragmentListType& llvm::MCSection::getFragmentList ( ) const
inline

Definition at line 151 of file MCSection.h.

◆ getKind()

SectionKind llvm::MCSection::getKind ( ) const
inline

◆ getLayoutOrder()

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

Definition at line 127 of file MCSection.h.

Referenced by llvm::MachObjectWriter::getPaddingSize().

◆ getOrdinal()

unsigned llvm::MCSection::getOrdinal ( ) const
inline

◆ getSublistAccess()

static FragmentListType MCSection::* llvm::MCSection::getSublistAccess ( MCFragment )
inlinestatic

Support for MCFragment::getNextNode().

Definition at line 156 of file MCSection.h.

◆ getSubsectionInsertionPoint()

MCSection::iterator MCSection::getSubsectionInsertionPoint ( unsigned  Subsection)

◆ getVariant()

SectionVariant llvm::MCSection::getVariant ( ) const
inline

◆ hasData()

bool llvm::MCSection::hasData ( ) const
inline

Definition at line 144 of file MCSection.h.

◆ hasEnded()

bool MCSection::hasEnded ( ) const

Definition at line 35 of file MCSection.cpp.

References llvm::MCSymbol::isInSection(), and ~MCSection().

Referenced by llvm::MCStreamer::SwitchSection().

◆ hasInstructions()

bool llvm::MCSection::hasInstructions ( ) const
inline

◆ isBundleGroupBeforeFirstInst()

bool llvm::MCSection::isBundleGroupBeforeFirstInst ( ) const
inline

Definition at line 134 of file MCSection.h.

Referenced by CheckBundleSubtargets(), and llvm::MCELFStreamer::EmitBundleUnlock().

◆ isBundleLocked()

bool llvm::MCSection::isBundleLocked ( ) const
inline

◆ isRegistered()

bool llvm::MCSection::isRegistered ( ) const
inline

Definition at line 147 of file MCSection.h.

Referenced by isWeak(), and llvm::MCAssembler::registerSection().

◆ isVirtualSection()

virtual bool llvm::MCSection::isVirtualSection ( ) const
pure virtual

◆ operator=()

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

◆ PrintSwitchToSection()

virtual void llvm::MCSection::PrintSwitchToSection ( const MCAsmInfo MAI,
const Triple T,
raw_ostream OS,
const MCExpr Subsection 
) const
pure virtual

◆ rbegin() [1/2]

reverse_iterator llvm::MCSection::rbegin ( )
inline

Definition at line 169 of file MCSection.h.

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

◆ rbegin() [2/2]

const_reverse_iterator llvm::MCSection::rbegin ( ) const
inline

Definition at line 170 of file MCSection.h.

◆ rend() [1/2]

reverse_iterator llvm::MCSection::rend ( )
inline

Definition at line 172 of file MCSection.h.

◆ rend() [2/2]

const_reverse_iterator llvm::MCSection::rend ( ) const
inline

Definition at line 173 of file MCSection.h.

References llvm::dump().

◆ setAlignment()

void llvm::MCSection::setAlignment ( unsigned  Value)
inline

◆ setBeginSymbol()

void llvm::MCSection::setBeginSymbol ( MCSymbol Sym)
inline

Definition at line 114 of file MCSection.h.

References assert().

Referenced by canGoAfterDWARF(), and hasPrefix().

◆ setBundleGroupBeforeFirstInst()

void llvm::MCSection::setBundleGroupBeforeFirstInst ( bool  IsFirst)
inline

Definition at line 137 of file MCSection.h.

Referenced by CheckBundleSubtargets(), and llvm::MCELFStreamer::EmitBundleLock().

◆ setBundleLockState()

void MCSection::setBundleLockState ( BundleLockStateType  NewState)

◆ setHasData()

void llvm::MCSection::setHasData ( bool  Value)
inline

Definition at line 145 of file MCSection.h.

Referenced by llvm::MCObjectStreamer::EmitBytes().

◆ setHasInstructions()

void llvm::MCSection::setHasInstructions ( bool  Value)
inline

Definition at line 142 of file MCSection.h.

Referenced by llvm::MCObjectStreamer::EmitInstruction().

◆ setIsRegistered()

void llvm::MCSection::setIsRegistered ( bool  Value)
inline

Definition at line 148 of file MCSection.h.

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

◆ setLayoutOrder()

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

Definition at line 128 of file MCSection.h.

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

◆ setOrdinal()

void llvm::MCSection::setOrdinal ( unsigned  Value)
inline

Definition at line 125 of file MCSection.h.

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

◆ UseCodeAlign()

virtual bool llvm::MCSection::UseCodeAlign ( ) const
pure virtual

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

Implemented in llvm::MCSectionELF, llvm::MCSectionCOFF, llvm::MCSectionMachO, and llvm::MCSectionWasm.

Referenced by getPrefixes(), llvm::IsCPSRDead< MCInst >(), and parseHexOcta().

Member Data Documentation

◆ Kind

SectionKind llvm::MCSection::Kind
protected

Definition at line 97 of file MCSection.h.

Referenced by llvm::MCSectionWasm::isWasmData().

◆ Variant

SectionVariant llvm::MCSection::Variant
protected

Definition at line 96 of file MCSection.h.


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