aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-08-07 09:51:54 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-08-07 09:51:54 +0000
commit4578862dcc71ddff55b66a819a44c0df7953bc71 (patch)
tree9593b5067819f835033d2036a94f2c8bad6e2d51 /lib/Target
parent5b794b98cebbc3982b87780657e0d280c2bcdd04 (diff)
downloadexternal_llvm-4578862dcc71ddff55b66a819a44c0df7953bc71.zip
external_llvm-4578862dcc71ddff55b66a819a44c0df7953bc71.tar.gz
external_llvm-4578862dcc71ddff55b66a819a44c0df7953bc71.tar.bz2
Provide convenient helpers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/Mips/MipsTargetAsmInfo.cpp4
-rw-r--r--lib/Target/TargetAsmInfo.cpp10
2 files changed, 4 insertions, 10 deletions
diff --git a/lib/Target/Mips/MipsTargetAsmInfo.cpp b/lib/Target/Mips/MipsTargetAsmInfo.cpp
index 10b1d84..04edd0d 100644
--- a/lib/Target/Mips/MipsTargetAsmInfo.cpp
+++ b/lib/Target/Mips/MipsTargetAsmInfo.cpp
@@ -61,7 +61,7 @@ SectionKindForGlobal(const GlobalValue *GV) const {
if (Subtarget->hasABICall())
return K;
- if (K != SectionKind::Data && K != SectionKind::BSS &&
+ if (K != SectionKind::Data && K != SectionKind::BSS &&
K != SectionKind::RODataMergeConst)
return K;
@@ -69,7 +69,7 @@ SectionKindForGlobal(const GlobalValue *GV) const {
const TargetData *TD = ETM->getTargetData();
unsigned Size = TD->getABITypeSize(GV->getType()->getElementType());
unsigned Threshold = Subtarget->getSSectionThreshold();
-
+
if (Size > 0 && Size <= Threshold) {
if (K == SectionKind::BSS)
return SectionKind::SmallBSS;
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index eb74836..9bc0b40 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -306,15 +306,9 @@ TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
} else {
if (Kind == SectionKind::Text)
return getTextSection_();
- else if ((Kind == SectionKind::BSS ||
- Kind == SectionKind::SmallBSS) &&
- getBSSSection_())
+ else if (isBSS(Kind) && getBSSSection_())
return getBSSSection_();
- else if (getReadOnlySection_() &&
- (Kind == SectionKind::ROData ||
- Kind == SectionKind::RODataMergeConst ||
- Kind == SectionKind::RODataMergeStr ||
- Kind == SectionKind::SmallROData))
+ else if (getReadOnlySection_() && SectionKind::isReadOnly(Kind))
return getReadOnlySection_();
}