aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetAsmInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-26 05:57:07 +0000
committerChris Lattner <sabre@nondot.org>2009-07-26 05:57:07 +0000
commit7f88a20f676350676015c4b3fb52de656f473772 (patch)
treed5c4664eaabf4a152d01fa8c91de7de25a35bd85 /lib/Target/TargetAsmInfo.cpp
parentaf89a96c6bc7c9fa2b55e98c6f05606e8cc29d16 (diff)
downloadexternal_llvm-7f88a20f676350676015c4b3fb52de656f473772.zip
external_llvm-7f88a20f676350676015c4b3fb52de656f473772.tar.gz
external_llvm-7f88a20f676350676015c4b3fb52de656f473772.tar.bz2
improve the default impl of getSectionForMergableConstant by
putting readonly constants in the readonly section if we have one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77131 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetAsmInfo.cpp')
-rw-r--r--lib/Target/TargetAsmInfo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 02e01be..51042da 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -364,8 +364,10 @@ TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
const Section *
TargetAsmInfo::getSectionForMergableConstant(uint64_t Size,
unsigned ReloInfo) const {
- // FIXME: Support data.rel stuff someday
- // Lame default implementation. Calculate the section name for machine const.
+ if (ReloInfo == 0)
+ if (const Section *S = getReadOnlySection())
+ return S;
+
return getDataSection();
}