diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-26 06:26:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-26 06:26:55 +0000 |
commit | fb6867c7db4ea9368b38a92e59b45cac034dc998 (patch) | |
tree | fe6174c7ba81199b10b5b0c2e679fdb79427cd98 /llvm/lib/Target/DarwinTargetAsmInfo.cpp | |
parent | aae21f49156a17c347cf6da44ff30af1ba7bde54 (diff) | |
download | bcm5719-llvm-fb6867c7db4ea9368b38a92e59b45cac034dc998.tar.gz bcm5719-llvm-fb6867c7db4ea9368b38a92e59b45cac034dc998.zip |
simplify getSectionForMergableConstant to take a SectionKind.
llvm-svn: 77134
Diffstat (limited to 'llvm/lib/Target/DarwinTargetAsmInfo.cpp')
-rw-r--r-- | llvm/lib/Target/DarwinTargetAsmInfo.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/llvm/lib/Target/DarwinTargetAsmInfo.cpp b/llvm/lib/Target/DarwinTargetAsmInfo.cpp index 1804adf6a4c..778aa22e885 100644 --- a/llvm/lib/Target/DarwinTargetAsmInfo.cpp +++ b/llvm/lib/Target/DarwinTargetAsmInfo.cpp @@ -188,25 +188,18 @@ DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { } 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 } |