summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetAsmInfo.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-08-16 12:58:12 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-08-16 12:58:12 +0000
commit2ae5446b62689e5e1a8092024791f319f4e3ccd8 (patch)
tree349f4c912b286fcd053250d96169a962e6076411 /llvm/lib/Target/TargetAsmInfo.cpp
parentbd890b1fafa6cacab188c9d72af6f55a0147dd49 (diff)
downloadbcm5719-llvm-2ae5446b62689e5e1a8092024791f319f4e3ccd8.tar.gz
bcm5719-llvm-2ae5446b62689e5e1a8092024791f319f4e3ccd8.zip
Add interface for section override. Use this for Sparc, since it should use named BSS section.
llvm-svn: 54844
Diffstat (limited to 'llvm/lib/Target/TargetAsmInfo.cpp')
-rw-r--r--llvm/lib/Target/TargetAsmInfo.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp
index cc0745f680a..6baebd0ffe7 100644
--- a/llvm/lib/Target/TargetAsmInfo.cpp
+++ b/llvm/lib/Target/TargetAsmInfo.cpp
@@ -352,11 +352,12 @@ TargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV,
}
const Section*
-TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags) const {
+TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags,
+ bool Override) const {
Section& S = Sections[Name];
// This is newly-created section, set it up properly.
- if (S.Flags == SectionFlags::Invalid) {
+ if (S.Flags == SectionFlags::Invalid || Override) {
S.Flags = Flags | SectionFlags::Named;
S.Name = Name;
}
@@ -365,11 +366,12 @@ TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags) const {
}
const Section*
-TargetAsmInfo::getUnnamedSection(const char *Directive, unsigned Flags) const {
+TargetAsmInfo::getUnnamedSection(const char *Directive, unsigned Flags,
+ bool Override) const {
Section& S = Sections[Directive];
// This is newly-created section, set it up properly.
- if (S.Flags == SectionFlags::Invalid) {
+ if (S.Flags == SectionFlags::Invalid || Override) {
S.Flags = Flags & ~SectionFlags::Named;
S.Name = Directive;
}
OpenPOWER on IntegriCloud