aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/TargetAsmInfo.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-07-09 13:18:02 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-07-09 13:18:02 +0000
commit0c602469f4e99a5775aebce16045f7c2598471e4 (patch)
tree55f1abfa972be68650f904a2c685b7c99a4f9e8a /lib/Target/TargetAsmInfo.cpp
parent8cc948d2288da5c89f1de5208f49bb95c1813c21 (diff)
Add default section name resolution routine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetAsmInfo.cpp')
-rw-r--r--lib/Target/TargetAsmInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 404e152da7..8e34fc30ec 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -254,3 +254,15 @@ TargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV,
return flags;
}
+
+const char*
+TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
+ SectionKind::Kind kind = SectionKindForGlobal(GV);
+
+ if (kind == SectionKind::Text)
+ return getTextSection();
+ else if (kind == SectionKind::BSS && getBSSSection())
+ return getBSSSection();
+
+ return getDataSection();
+}