13#ifndef LLVM_MC_MCSECTIONXCOFF_H
14#define LLVM_MC_MCSECTIONXCOFF_H
35 std::optional<XCOFF::CsectProperties> CsectProp;
38 std::optional<XCOFF::DwarfSectionSubtypeFlags> DwarfSubtypeFlags;
39 bool MultiSymbolsAllowed;
41 static constexpr unsigned DefaultAlignVal = 4;
42 static constexpr unsigned DefaultTextAlignVal = 32;
48 bool MultiSymbolsAllowed)
53 SymbolTableName(SymbolTableName), DwarfSubtypeFlags(
std::nullopt),
54 MultiSymbolsAllowed(MultiSymbolsAllowed), Kind(
K) {
57 "Invalid or unhandled type for csect.");
58 assert(QualName !=
nullptr &&
"QualName is needed.");
61 "Invalid csect type for storage mapping class XCOFF::XMC_UL");
63 QualName->setRepresentedCsect(
this);
76 MCSectionXCOFF(StringRef
Name, SectionKind
K, MCSymbolXCOFF *QualName,
78 MCSymbol *Begin, StringRef SymbolTableName,
79 bool MultiSymbolsAllowed)
81 QualName(QualName), SymbolTableName(SymbolTableName),
82 DwarfSubtypeFlags(DwarfSubtypeFlags),
83 MultiSymbolsAllowed(MultiSymbolsAllowed), Kind(
K) {
84 assert(QualName !=
nullptr &&
"QualName is needed.");
87 QualName->setRepresentedCsect(
this);
97 assert(
isCsect() &&
"Only csect section has mapping class property!");
98 return CsectProp->MappingClass;
101 return QualName->getStorageClass();
104 return QualName->getVisibilityType();
107 assert(
isCsect() &&
"Only csect section has symbol type property!");
108 return CsectProp->Type;
115 bool isCsect()
const {
return CsectProp.has_value(); }
116 bool isDwarfSect()
const {
return DwarfSubtypeFlags.has_value(); }
118 return DwarfSubtypeFlags;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
std::optional< XCOFF::CsectProperties > getCsectProp() const
bool isMultiSymbolsAllowed() const
LLVM_ABI ~MCSectionXCOFF()
StringRef getSymbolTableName() const
XCOFF::VisibilityType getVisibilityType() const
std::optional< XCOFF::DwarfSectionSubtypeFlags > getDwarfSubtypeFlags() const
void setSymbolTableName(StringRef STN)
XCOFF::StorageClass getStorageClass() const
SectionKind getKind() const
XCOFF::StorageMappingClass getMappingClass() const
MCSymbolXCOFF * getQualNameSymbol() const
XCOFF::SymbolType getCSectType() const
void setAlignment(Align Value)
MCSection(StringRef Name, bool IsText, bool IsBss, MCSymbol *Begin)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
SectionKind - This is a simple POD value that classifies the properties of a section.
Represent a constant reference to a string, i.e.
DwarfSectionSubtypeFlags
Values for defining the section subtype of sections of type STYP_DWARF as they would appear in the (s...
VisibilityType
Values for visibility as they would appear when encoded in the high 4 bits of the 16-bit unsigned n_t...
StorageMappingClass
Storage Mapping Class definitions.
@ XMC_TD
Scalar data item in the TOC.
@ XMC_UL
Uninitialized thread-local variable.
@ XTY_CM
Common csect definition. For uninitialized storage.
@ XTY_SD
Csect definition for initialized storage.
@ XTY_ER
External reference.
This is an optimization pass for GlobalISel generic memory operations.
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.