summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/TargetAsmInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp
index 404e152da7b..8e34fc30ec5 100644
--- a/llvm/lib/Target/TargetAsmInfo.cpp
+++ b/llvm/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();
+}
OpenPOWER on IntegriCloud