aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commit56acf5c9f629fa3fafe06097d056765784b1be2a (patch)
treed5c4664eaabf4a152d01fa8c91de7de25a35bd85 /lib
parent07203df7d4bf735368ca48195c95273a15481b9e (diff)
downloadexternal_llvm-56acf5c9f629fa3fafe06097d056765784b1be2a.zip
external_llvm-56acf5c9f629fa3fafe06097d056765784b1be2a.tar.gz
external_llvm-56acf5c9f629fa3fafe06097d056765784b1be2a.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')
-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();
}