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
This commit is contained in:
Chris Lattner
2009-07-26 19:23:28 +00:00
parent 30b2bdfa73
commit 0fcf4dc6d3
16 changed files with 36 additions and 51 deletions

View File

@@ -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;
}