ThreadData, ///< Initialized TLS data objects
ThreadBSS ///< Uninitialized TLS data objects
};
+
+ static inline bool isReadOnly(Kind K) {
+ return (K == SectionKind::ROData ||
+ K == SectionKind::RODataMergeConst ||
+ K == SectionKind::RODataMergeStr ||
+ K == SectionKind::SmallROData);
+ }
+
+ static inline bool isBSS(Kind K) {
+ return (K == SectionKind::BSS ||
+ K == SectionKind::SmallBSS);
+ }
}
namespace SectionFlags {
if (Subtarget->hasABICall())
return K;
- if (K != SectionKind::Data && K != SectionKind::BSS &&
+ if (K != SectionKind::Data && K != SectionKind::BSS &&
K != SectionKind::RODataMergeConst)
return K;
const TargetData *TD = ETM->getTargetData();
unsigned Size = TD->getABITypeSize(GV->getType()->getElementType());
unsigned Threshold = Subtarget->getSSectionThreshold();
-
+
if (Size > 0 && Size <= Threshold) {
if (K == SectionKind::BSS)
return SectionKind::SmallBSS;
} else {
if (Kind == SectionKind::Text)
return getTextSection_();
- else if ((Kind == SectionKind::BSS ||
- Kind == SectionKind::SmallBSS) &&
- getBSSSection_())
+ else if (isBSS(Kind) && getBSSSection_())
return getBSSSection_();
- else if (getReadOnlySection_() &&
- (Kind == SectionKind::ROData ||
- Kind == SectionKind::RODataMergeConst ||
- Kind == SectionKind::RODataMergeStr ||
- Kind == SectionKind::SmallROData))
+ else if (getReadOnlySection_() && SectionKind::isReadOnly(Kind))
return getReadOnlySection_();
}