summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit6194637d662255f37f39df4464408bd26e1a2e73 (patch)
treec96fdec1f4c061a0be9727249d0ce2f87c0a7e37 /llvm/lib/Target/TargetAsmInfo.cpp
parent1e76db06b91ba4d09a20263b6da07ee81bf2f96c (diff)
downloadbcm5719-llvm-6194637d662255f37f39df4464408bd26e1a2e73.tar.gz
bcm5719-llvm-6194637d662255f37f39df4464408bd26e1a2e73.zip
improve the default impl of getSectionForMergableConstant by
putting readonly constants in the readonly section if we have one. llvm-svn: 77131
Diffstat (limited to 'llvm/lib/Target/TargetAsmInfo.cpp')
-rw-r--r--llvm/lib/Target/TargetAsmInfo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp
index 02e01be5dfe..51042dac958 100644
--- a/llvm/lib/Target/TargetAsmInfo.cpp
+++ b/llvm/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();
}
OpenPOWER on IntegriCloud