From 6194637d662255f37f39df4464408bd26e1a2e73 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 26 Jul 2009 05:57:07 +0000 Subject: improve the default impl of getSectionForMergableConstant by putting readonly constants in the readonly section if we have one. llvm-svn: 77131 --- llvm/lib/Target/TargetAsmInfo.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Target/TargetAsmInfo.cpp') 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(); } -- cgit v1.2.3