simplify getSectionForMergableConstant to take a SectionKind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77134 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 1804adf..778aa22 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -188,25 +188,18 @@
}
const Section *
-DarwinTargetAsmInfo::getSectionForMergableConstant(uint64_t Size,
- unsigned ReloInfo) const {
+DarwinTargetAsmInfo::getSectionForMergableConstant(SectionKind Kind) const {
// If this constant requires a relocation, we have to put it in the data
// segment, not in the text segment.
- if (ReloInfo != 0)
+ if (Kind.isDataRel())
return ConstDataSection;
- switch (Size) {
- default: break;
- case 4:
+ if (Kind.isMergableConst4())
return FourByteConstantSection;
- case 8:
+ if (Kind.isMergableConst8())
return EightByteConstantSection;
- case 16:
- if (SixteenByteConstantSection)
- return SixteenByteConstantSection;
- break;
- }
-
+ if (Kind.isMergableConst16() && SixteenByteConstantSection)
+ return SixteenByteConstantSection;
return ReadOnlySection; // .const
}