Implement unique sections with an unique ID.

This allows the compiler/assembly programmer to switch back to a
section. This in turn fixes the bootstrap failure on powerpc (tested
on gcc110) without changing the ppc codegen at all.

I will try to cleanup the various getELFSection overloads in a  followup patch.
Just using a default argument now would lead to ambiguities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234099 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-04-04 18:02:01 +00:00
parent ffcb79bea1
commit 903f4a2051
18 changed files with 103 additions and 50 deletions

View File

@@ -39,11 +39,10 @@ private:
mutable MCSymbol *End;
protected:
MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin, bool Unique)
: Begin(Begin), End(nullptr), Variant(V), Kind(K), Unique(Unique) {}
MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin)
: Begin(Begin), End(nullptr), Variant(V), Kind(K) {}
SectionVariant Variant;
SectionKind Kind;
bool Unique;
public:
virtual ~MCSection();
@@ -55,7 +54,6 @@ public:
MCSymbol *getBeginSymbol() const { return Begin; }
MCSymbol *getEndSymbol(MCContext &Ctx) const;
bool hasEnded() const;
bool isUnique() const { return Unique; }
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS,
const MCExpr *Subsection) const = 0;