aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetAsmInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-26 19:23:28 +0000
committerChris Lattner <sabre@nondot.org>2009-07-26 19:23:28 +0000
commit0fcf4dc6d367216ff51501af282e33e93da8586f (patch)
tree37e6bf1e5da0f89ae50c33fa16f8ac0f1ca0d2da /lib/Target/TargetAsmInfo.cpp
parent30b2bdfa734d59bb7bc769dc2f06e4900a77f6f8 (diff)
downloadexternal_llvm-0fcf4dc6d367216ff51501af282e33e93da8586f.zip
external_llvm-0fcf4dc6d367216ff51501af282e33e93da8586f.tar.gz
external_llvm-0fcf4dc6d367216ff51501af282e33e93da8586f.tar.bz2
untangle a TargetAsmInfo hack where ELFTargetAsmInfo would create a
'unnamed' bss section, but some impls would want a named one. Since they don't have consistent behavior, just make each target do their own thing, instead of doing something "sortof common" then having targets change immutable objects later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetAsmInfo.cpp')
-rw-r--r--lib/Target/TargetAsmInfo.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 0052075..28d6324 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -389,12 +389,12 @@ TargetAsmInfo::getSectionForMergeableConstant(SectionKind Kind) const {
}
-const Section *TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags,
- bool Override) const {
+const Section *TargetAsmInfo::getNamedSection(const char *Name,
+ unsigned Flags) const {
Section &S = Sections[Name];
// This is newly-created section, set it up properly.
- if (S.Flags == SectionFlags::Invalid || Override) {
+ if (S.Name.empty()) {
S.Flags = Flags | SectionFlags::Named;
S.Name = Name;
}
@@ -403,12 +403,11 @@ const Section *TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags,
}
const Section*
-TargetAsmInfo::getUnnamedSection(const char *Directive, unsigned Flags,
- bool Override) const {
+TargetAsmInfo::getUnnamedSection(const char *Directive, unsigned Flags) const {
Section& S = Sections[Directive];
// This is newly-created section, set it up properly.
- if (S.Flags == SectionFlags::Invalid || Override) {
+ if (S.Name.empty()) {
S.Flags = Flags & ~SectionFlags::Named;
S.Name = Directive;
}