diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-26 05:57:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-26 05:57:07 +0000 |
commit | 56acf5c9f629fa3fafe06097d056765784b1be2a (patch) | |
tree | d5c4664eaabf4a152d01fa8c91de7de25a35bd85 /lib | |
parent | 07203df7d4bf735368ca48195c95273a15481b9e (diff) | |
download | external_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.cpp | 6 |
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(); } |