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");
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);
93 void printCsectDirective(raw_ostream &
OS)
const;
103 assert(
isCsect() &&
"Only csect section has mapping class property!");
104 return CsectProp->MappingClass;
107 return QualName->getStorageClass();
110 return QualName->getVisibilityType();
113 assert(
isCsect() &&
"Only csect section has symbol type property!");
114 return CsectProp->Type;
120 uint32_t Subsection)
const override;
125 bool isCsect()
const {
return CsectProp.has_value(); }
126 bool isDwarfSect()
const {
return DwarfSubtypeFlags.has_value(); }
128 return DwarfSubtypeFlags;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class is intended to be used as a base class for asm properties and features specific to the tar...
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
static bool classof(const MCSection *S)
void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, uint32_t Subsection) const override
bool useCodeAlign() const override
Return true if a .align directive should use "optimized nops" to fill instead of 0s.
XCOFF::SymbolType getCSectType() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
void setAlignment(Align Value)
SectionVariant getVariant() const
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.
Triple - Helper class for working with autoconf configuration names.
This class implements an extremely fast bulk output stream that can only output to a stream.
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.