LLVM 22.0.0git
Classes | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::MCSection Class Reference

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:
[legend]

Classes

struct  FragList
 
struct  iterator
 

Public Member Functions

 MCSection (const MCSection &)=delete
 
MCSectionoperator= (const MCSection &)=delete
 
StringRef getName () const
 
bool isText () 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)
 
bool hasInstructions () const
 
void setHasInstructions (bool Value)
 
bool isRegistered () const
 
void setIsRegistered (bool Value)
 
unsigned firstLinkerRelaxable () const
 
bool isLinkerRelaxable () const
 
void setFirstLinkerRelaxable (unsigned Order)
 
MCFragmentgetDummyFragment ()
 
FragListcurFragList () const
 
iterator begin () const
 
iterator end () const
 
void dump (DenseMap< const MCFragment *, SmallVector< const MCSymbol *, 0 > > *FragToSyms=nullptr) const
 
bool isBssSection () const
 Check whether this section is "virtual", that is has no actual object file contents.
 

Public Attributes

friend MCAssembler
 
friend MCObjectStreamer
 

Static Public Attributes

static constexpr unsigned NonUniqueID = ~0U
 

Protected Member Functions

 MCSection (StringRef Name, bool IsText, bool IsBss, MCSymbol *Begin)
 

Protected Attributes

StringRef Name
 

Friends

class MCFragment
 

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

Constructor & Destructor Documentation

◆ MCSection() [1/2]

MCSection::MCSection ( StringRef  Name,
bool  IsText,
bool  IsBss,
MCSymbol Begin 
)
protected

Definition at line 21 of file MCSection.cpp.

References llvm::MCFragment::setParent().

◆ MCSection() [2/2]

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

Member Function Documentation

◆ begin()

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

Definition at line 604 of file MCSection.h.

References llvm::MCSection::FragList::Head.

◆ curFragList()

FragList * llvm::MCSection::curFragList ( ) const
inline

◆ dump()

LLVM_DUMP_METHOD void MCSection::dump ( DenseMap< const MCFragment *, SmallVector< const MCSymbol *, 0 > > *  FragToSyms = nullptr) const

Definition at line 36 of file MCSection.cpp.

References llvm::errs(), F, firstLinkerRelaxable(), getName(), isLinkerRelaxable(), OS, and Sym.

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

◆ end()

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

Definition at line 605 of file MCSection.h.

◆ ensureMinAlignment()

void llvm::MCSection::ensureMinAlignment ( Align  MinAlignment)
inline

Makes sure that Alignment is at least MinAlignment.

Definition at line 583 of file MCSection.h.

Referenced by llvm::MCWinCOFFStreamer::emitCOFFSafeSEH(), llvm::MCWinCOFFStreamer::emitCOFFSymbolIndex(), and llvm::MipsTargetELFStreamer::finish().

◆ firstLinkerRelaxable()

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

Definition at line 597 of file MCSection.h.

Referenced by dump().

◆ getAlign()

Align llvm::MCSection::getAlign ( ) const
inline

◆ getBeginSymbol() [1/2]

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

◆ getBeginSymbol() [2/2]

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

Definition at line 569 of file MCSection.h.

◆ getDummyFragment()

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

Definition at line 601 of file MCSection.h.

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

◆ getEndSymbol()

MCSymbol * MCSection::getEndSymbol ( MCContext Ctx)

Definition at line 27 of file MCSection.cpp.

References llvm::MCContext::createTempSymbol().

◆ getName()

StringRef llvm::MCSection::getName ( ) const
inline

◆ getOrdinal()

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

Definition at line 588 of file MCSection.h.

◆ hasEnded()

bool MCSection::hasEnded ( ) const

Definition at line 33 of file MCSection.cpp.

References llvm::MCSymbol::isInSection().

◆ hasInstructions()

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

◆ isBssSection()

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

◆ isLinkerRelaxable()

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

◆ isRegistered()

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

Definition at line 594 of file MCSection.h.

Referenced by llvm::AArch64TargetStreamer::emitNoteSection().

◆ isText()

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

Definition at line 566 of file MCSection.h.

Referenced by llvm::MCAsmInfoXCOFF::useCodeAlign().

◆ operator=()

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

◆ setAlignment()

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

◆ setBeginSymbol()

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

Definition at line 572 of file MCSection.h.

References assert(), and Sym.

Referenced by llvm::TargetLoweringObjectFileGOFF::getModuleMetadata().

◆ setFirstLinkerRelaxable()

void llvm::MCSection::setFirstLinkerRelaxable ( unsigned  Order)
inline

Definition at line 599 of file MCSection.h.

◆ setHasInstructions()

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

Definition at line 592 of file MCSection.h.

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

◆ setIsRegistered()

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

Definition at line 595 of file MCSection.h.

◆ setOrdinal()

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

Definition at line 589 of file MCSection.h.

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

Friends And Related Function Documentation

◆ MCFragment

friend class MCFragment
friend

Definition at line 500 of file MCSection.h.

Member Data Documentation

◆ MCAssembler

friend llvm::MCSection::MCAssembler

Definition at line 498 of file MCSection.h.

◆ MCObjectStreamer

friend llvm::MCSection::MCObjectStreamer

Definition at line 499 of file MCSection.h.

◆ Name

StringRef llvm::MCSection::Name
protected

◆ NonUniqueID

constexpr unsigned llvm::MCSection::NonUniqueID = ~0U
staticconstexpr

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