LLVM: include/llvm/MC/MCSectionXCOFF.h Source File (original) (raw)

32class MCSectionXCOFF final : public MCSection {

35

36 std::optionalXCOFF::CsectProperties CsectProp;

39 std::optionalXCOFF::DwarfSectionSubtypeFlags DwarfSubtypeFlags;

40 bool MultiSymbolsAllowed;

42 static constexpr unsigned DefaultAlignVal = 4;

43 static constexpr unsigned DefaultTextAlignVal = 32;

44

45

49 bool MultiSymbolsAllowed)

52 Begin),

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");

63

64 QualName->setRepresentedCsect(this);

67

68

71 else

73 }

74 }

75

76

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.");

86

87

88 QualName->setRepresentedCsect(this);

89

90

92 }

93

94 void printCsectDirective(raw_ostream &OS) const;

95

96public:

98

100 assert(isCsect() && "Only csect section has mapping class property!");

101 return CsectProp->MappingClass;

102 }

104 return QualName->getStorageClass();

105 }

107 return QualName->getVisibilityType();

108 }

110 assert(isCsect() && "Only csect section has symbol type property!");

111 return CsectProp->Type;

112 }

114

118 bool isCsect() const { return CsectProp.has_value(); }

119 bool isDwarfSect() const { return DwarfSubtypeFlags.has_value(); }

121 return DwarfSubtypeFlags;

122 }

123 std::optionalXCOFF::CsectProperties getCsectProp() const {

124 return CsectProp;

125 }

127};