13#ifndef LLVM_MC_MCSECTIONXCOFF_H
14#define LLVM_MC_MCSECTIONXCOFF_H
36 std::optional<XCOFF::CsectProperties> CsectProp;
39 std::optional<XCOFF::DwarfSectionSubtypeFlags> DwarfSubtypeFlags;
40 bool MultiSymbolsAllowed;
42 static constexpr unsigned DefaultAlignVal = 4;
43 static constexpr unsigned DefaultTextAlignVal = 32;
49 bool MultiSymbolsAllowed)
54 SymbolTableName(SymbolTableName), DwarfSubtypeFlags(
std::nullopt),
55 MultiSymbolsAllowed(MultiSymbolsAllowed), Kind(K) {
58 "Invalid or unhandled type for csect.");
59 assert(QualName !=
nullptr &&
"QualName is needed.");
62 "Invalid csect type for storage mapping class XCOFF::XMC_UL");
77 MCSectionXCOFF(StringRef
Name, SectionKind K, MCSymbolXCOFF *QualName,
79 MCSymbol *Begin, StringRef SymbolTableName,
80 bool MultiSymbolsAllowed)
82 QualName(QualName), SymbolTableName(SymbolTableName),
83 DwarfSubtypeFlags(DwarfSubtypeFlags),
84 MultiSymbolsAllowed(MultiSymbolsAllowed), Kind(K) {
85 assert(QualName !=
nullptr &&
"QualName is needed.");
88 QualName->setRepresentedCsect(
this);
94 void printCsectDirective(raw_ostream &
OS)
const;
100 assert(
isCsect() &&
"Only csect section has mapping class property!");
101 return CsectProp->MappingClass;
104 return QualName->getStorageClass();
107 return QualName->getVisibilityType();
110 assert(
isCsect() &&
"Only csect section has symbol type property!");
111 return CsectProp->Type;
118 bool isCsect()
const {
return CsectProp.has_value(); }
119 bool isDwarfSect()
const {
return DwarfSubtypeFlags.has_value(); }
121 return DwarfSubtypeFlags;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Context object for machine code objects.
std::optional< XCOFF::CsectProperties > getCsectProp() const
bool isMultiSymbolsAllowed() const
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
Instances of this class represent a uniqued identifier for a section in the current translation unit.
void setAlignment(Align Value)
void setRepresentedCsect(MCSectionXCOFF *C)
void setStorageClass(XCOFF::StorageClass SC)
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.
StringRef - 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.