SectionFlagsForGlobal(const GlobalValue *GV = NULL,
const char* name = NULL) const;
+ /// SectionForGlobal - This hooks returns proper section name for given
+ /// global with all necessary flags and marks.
+ const char* SectionForGlobal(const GlobalValue *GV) const;
+
// Accessors.
//
const char *getTextSection() const {
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();
+}