mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-13 07:00:59 +00:00
Add default section name resolution routine
llvm-svn: 53292
This commit is contained in:
parent
552675bb0f
commit
5bc572ad96
@ -471,6 +471,10 @@ namespace llvm {
|
||||
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 {
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user