LLVM  3.7.0
Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::MCSectionMachO Class Reference

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

#include <MCSectionMachO.h>

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

Public Member Functions

StringRef getSegmentName () const
 
StringRef getSectionName () const
 
unsigned getTypeAndAttributes () const
 
unsigned getStubSize () const
 
MachO::SectionType getType () const
 
bool hasAttribute (unsigned Value) const
 
void PrintSwitchToSection (const MCAsmInfo &MAI, raw_ostream &OS, const MCExpr *Subsection) const override
 
bool UseCodeAlign () const override
 Return true if a .align directive should use "optimized nops" to fill instead of 0s. More...
 
bool isVirtualSection () const override
 Check whether this section is "virtual", that is has no actual object file contents. More...
 
- Public Member Functions inherited from llvm::MCSection
virtual ~MCSection ()
 
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 isRegistered () const
 
void setIsRegistered (bool Value)
 
MCSection::FragmentListTypegetFragmentList ()
 
const MCSection::FragmentListTypegetFragmentList () const
 
MCSection::iterator begin ()
 
MCSection::const_iterator begin () const
 
MCSection::iterator end ()
 
MCSection::const_iterator end () const
 
MCSection::reverse_iterator rbegin ()
 
MCSection::const_reverse_iterator rbegin () const
 
MCSection::reverse_iterator rend ()
 
MCSection::const_reverse_iterator rend () const
 
MCSection::iterator getSubsectionInsertionPoint (unsigned Subsection)
 
void dump ()
 

Static Public Member Functions

static std::string ParseSectionSpecifier (StringRef Spec, StringRef &Segment, StringRef &Section, unsigned &TAA, bool &TAAParsed, unsigned &StubSize)
 ParseSectionSpecifier - Parse the section specifier indicated by "Spec". More...
 
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_MachO }
 
enum  BundleLockStateType { NotBundleLocked, BundleLocked, BundleLockedAlignToEnd }
 Express the state of bundle locked groups while emitting code. More...
 
typedef iplist< MCFragmentFragmentListType
 
typedef
FragmentListType::const_iterator 
const_iterator
 
typedef FragmentListType::iterator iterator
 
typedef
FragmentListType::const_reverse_iterator 
const_reverse_iterator
 
typedef
FragmentListType::reverse_iterator 
reverse_iterator
 
- Protected Member Functions inherited from llvm::MCSection
 MCSection (SectionVariant V, SectionKind K, MCSymbol *Begin)
 
- Protected Attributes inherited from llvm::MCSection
SectionVariant Variant
 
SectionKind Kind
 

Detailed Description

MCSectionMachO - 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 26 of file MCSectionMachO.h.

Member Function Documentation

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

Definition at line 85 of file MCSectionMachO.h.

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

StringRef llvm::MCSectionMachO::getSectionName ( ) const
inline
StringRef llvm::MCSectionMachO::getSegmentName ( ) const
inline
unsigned llvm::MCSectionMachO::getStubSize ( ) const
inline
MachO::SectionType llvm::MCSectionMachO::getType ( ) const
inline
unsigned llvm::MCSectionMachO::getTypeAndAttributes ( ) const
inline
bool llvm::MCSectionMachO::hasAttribute ( unsigned  Value) const
inline

Definition at line 63 of file MCSectionMachO.h.

Referenced by canUseLocalRelocation(), canUsePrivateLabel(), and UseCodeAlign().

bool MCSectionMachO::isVirtualSection ( ) const
overridevirtual

Check whether this section is "virtual", that is has no actual object file contents.

Implements llvm::MCSection.

Definition at line 160 of file MCSectionMachO.cpp.

References getType(), llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_THREAD_LOCAL_ZEROFILL, and llvm::MachO::S_ZEROFILL.

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

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

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 a string 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 171 of file MCSectionMachO.cpp.

References llvm::sys::path::begin(), llvm::StringRef::empty(), llvm::sys::path::end(), llvm::StringRef::getAsInteger(), llvm::MachO::S_SYMBOL_STUBS, llvm::MachO::SECTION_TYPE, SectionAttrDescriptors, SectionTypeDescriptors, llvm::StringRef::size(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::StringRef::split().

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

void MCSectionMachO::PrintSwitchToSection ( const MCAsmInfo MAI,
raw_ostream OS,
const MCExpr Subsection 
) const
overridevirtual
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 156 of file MCSectionMachO.cpp.

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

Friends And Related Function Documentation

friend class MCContext
friend

Definition at line 40 of file MCSectionMachO.h.


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