From 328da65bd14045d3e229cbc5549835cebf6ff703 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sat, 16 Aug 2008 12:58:12 +0000 Subject: Add interface for section override. Use this for Sparc, since it should use named BSS section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54844 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/TargetAsmInfo.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/Target/TargetAsmInfo.cpp') diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index cc0745f680..6baebd0ffe 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/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; } -- cgit v1.2.3-70-g09d2