LLVM API Documentation

llvm::MCSectionELF Class Reference

#include <MCSectionELF.h>

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

List of all members.

Public Types

enum  {
  SHT_NULL = 0x00U, SHT_PROGBITS = 0x01U, SHT_SYMTAB = 0x02U, SHT_STRTAB = 0x03U,
  SHT_RELA = 0x04U, SHT_HASH = 0x05U, SHT_DYNAMIC = 0x06U, SHT_NOTE = 0x07U,
  SHT_NOBITS = 0x08U, SHT_REL = 0x09U, SHT_SHLIB = 0x0AU, SHT_DYNSYM = 0x0BU,
  SHT_INIT_ARRAY = 0x0EU, SHT_FINI_ARRAY = 0x0FU, SHT_PREINIT_ARRAY = 0x10U, SHT_GROUP = 0x11U,
  SHT_SYMTAB_SHNDX = 0x12U, LAST_KNOWN_SECTION_TYPE = SHT_SYMTAB_SHNDX
}
enum  {
  SHF_WRITE = 0x1U, SHF_ALLOC = 0x2U, SHF_EXECINSTR = 0x4U, SHF_MERGE = 0x10U,
  SHF_STRINGS = 0x20U, SHF_INFO_LINK = 0x40U, SHF_LINK_ORDER = 0x80U, SHF_OS_NONCONFORMING = 0x100U,
  SHF_GROUP = 0x200U, SHF_TLS = 0x400U, FIRST_TARGET_DEP_FLAG = 0x800U, TARGET_INDEP_SHF = FIRST_TARGET_DEP_FLAG-1U
}
 Valid section flags. More...

Public Member Functions

bool ShouldOmitSectionDirective (const char *Name, const TargetAsmInfo &TAI) const
bool ShouldPrintSectionType (unsigned Ty) const
 ShouldPrintSectionType - Only prints the section type if supported.
bool HasCommonSymbols () const
StringRef getSectionName () const
unsigned getType () const
unsigned getFlags () const
virtual void PrintSwitchToSection (const TargetAsmInfo &TAI, raw_ostream &OS) const
virtual void PrintTargetSpecificSectionFlags (const TargetAsmInfo &TAI, raw_ostream &OS) const

Static Public Member Functions

static MCSectionELF * Create (const StringRef &Section, unsigned Type, unsigned Flags, SectionKind K, bool isExplicit, MCContext &Ctx)

Protected Member Functions

 MCSectionELF (const StringRef &Section, unsigned type, unsigned flags, SectionKind K, bool isExplicit)


Detailed Description

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

Definition at line 23 of file MCSectionELF.h.


Member Enumeration Documentation

anonymous enum

These are the section type and flags fields. An ELF section can have only one Type, but can have more than one of the flags specified.

Valid section types.

Enumerator:
SHT_NULL 
SHT_PROGBITS 
SHT_SYMTAB 
SHT_STRTAB 
SHT_RELA 
SHT_HASH 
SHT_DYNAMIC 
SHT_NOTE 
SHT_NOBITS 
SHT_REL 
SHT_SHLIB 
SHT_DYNSYM 
SHT_INIT_ARRAY 
SHT_FINI_ARRAY 
SHT_PREINIT_ARRAY 
SHT_GROUP 
SHT_SYMTAB_SHNDX 
LAST_KNOWN_SECTION_TYPE 

Definition at line 65 of file MCSectionELF.h.

anonymous enum

Valid section flags.

Enumerator:
SHF_WRITE 
SHF_ALLOC 
SHF_EXECINSTR 
SHF_MERGE 
SHF_STRINGS 
SHF_INFO_LINK 
SHF_LINK_ORDER 
SHF_OS_NONCONFORMING 
SHF_GROUP 
SHF_TLS 
FIRST_TARGET_DEP_FLAG  FIRST_TARGET_DEP_FLAG - This is the first flag that subclasses are allowed to specify.
TARGET_INDEP_SHF  TARGET_INDEP_SHF - This is the bitmask for all the target independent section flags. Targets can define their own target flags above these. If they do that, they should implement their own MCSectionELF subclasses and implement the virtual method hooks below to handle printing needs.

Definition at line 124 of file MCSectionELF.h.


Constructor & Destructor Documentation

llvm::MCSectionELF::MCSectionELF ( const StringRef &  Section,
unsigned  type,
unsigned  flags,
SectionKind  K,
bool  isExplicit 
) [inline, protected]

Definition at line 38 of file MCSectionELF.h.

Referenced by Create().


Member Function Documentation

MCSectionELF * MCSectionELF::Create ( const StringRef &  Section,
unsigned  Type,
unsigned  Flags,
SectionKind  K,
bool  isExplicit,
MCContext &  Ctx 
) [static]

Reimplemented in llvm::MCSectionXCore.

Definition at line 18 of file MCSectionELF.cpp.

References MCSectionELF().

Referenced by llvm::TargetLoweringObjectFileELF::getELFSection().

bool MCSectionELF::ShouldOmitSectionDirective ( const char *  Name,
const TargetAsmInfo &  TAI 
) const

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

Definition at line 25 of file MCSectionELF.cpp.

References llvm::TargetAsmInfo::usesELFSectionDirectiveForBSS().

Referenced by PrintSwitchToSection().

bool MCSectionELF::ShouldPrintSectionType ( unsigned  Ty  )  const

ShouldPrintSectionType - Only prints the section type if supported.

Definition at line 39 of file MCSectionELF.cpp.

References SHT_NOBITS, and SHT_PROGBITS.

Referenced by PrintSwitchToSection().

bool MCSectionELF::HasCommonSymbols (  )  const

HasCommonSymbols - True if this section holds common symbols, this is indicated on the ELF object file by a symbol with SHN_COMMON section header index.

Definition at line 130 of file MCSectionELF.cpp.

StringRef llvm::MCSectionELF::getSectionName (  )  const [inline]

Definition at line 167 of file MCSectionELF.h.

Referenced by PrintSwitchToSection().

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

Definition at line 171 of file MCSectionELF.h.

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

void MCSectionELF::PrintSwitchToSection ( const TargetAsmInfo &  TAI,
raw_ostream &  OS 
) const [virtual]

virtual void llvm::MCSectionELF::PrintTargetSpecificSectionFlags ( const TargetAsmInfo &  TAI,
raw_ostream &  OS 
) const [inline, virtual]

PrintTargetSpecificSectionFlags - Targets that define their own MCSectionELF subclasses with target specific section flags should implement this method if they end up adding letters to the attributes list.

Reimplemented in llvm::MCSectionXCore.

Definition at line 182 of file MCSectionELF.h.

Referenced by PrintSwitchToSection().


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