summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCSectionELF.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-08 21:26:26 +0000
committerChris Lattner <sabre@nondot.org>2010-04-08 21:26:26 +0000
commit74aae4726a66733c5872588287535a984f9a94c7 (patch)
tree881707df3911fb308e40f805a973d89773ec36d3 /include/llvm/MC/MCSectionELF.h
parent2d16a67b9466102ae479f0027cedc1a20dd493d1 (diff)
downloadllvm-74aae4726a66733c5872588287535a984f9a94c7.tar.gz
llvm-74aae4726a66733c5872588287535a984f9a94c7.tar.bz2
llvm-74aae4726a66733c5872588287535a984f9a94c7.tar.xz
move elf section uniquing to MCContext. Along the way
merge XCore's section into MCSectionELF git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCSectionELF.h')
-rw-r--r--include/llvm/MC/MCSectionELF.h43
1 files changed, 17 insertions, 26 deletions
diff --git a/include/llvm/MC/MCSectionELF.h b/include/llvm/MC/MCSectionELF.h
index e550cd2c11..7054668eb1 100644
--- a/include/llvm/MC/MCSectionELF.h
+++ b/include/llvm/MC/MCSectionELF.h
@@ -36,16 +36,14 @@ class MCSectionELF : public MCSection {
/// explicit section specified.
bool IsExplicit;
-protected:
+private:
+ friend class MCContext;
MCSectionELF(StringRef Section, unsigned type, unsigned flags,
SectionKind K, bool isExplicit)
: MCSection(K), SectionName(Section), Type(type), Flags(flags),
IsExplicit(isExplicit) {}
+ ~MCSectionELF();
public:
-
- static MCSectionELF *Create(StringRef Section, unsigned Type,
- unsigned Flags, SectionKind K, bool isExplicit,
- MCContext &Ctx);
/// ShouldOmitSectionDirective - Decides whether a '.section' directive
/// should be printed before the section name
@@ -153,40 +151,33 @@ public:
// This section holds Thread-Local Storage.
SHF_TLS = 0x400U,
+
+
+ // Start of target-specific flags.
+
+ /// XCORE_SHF_CP_SECTION - All sections with the "c" flag are grouped
+ /// together by the linker to form the constant pool and the cp register is
+ /// set to the start of the constant pool by the boot code.
+ XCORE_SHF_CP_SECTION = 0x800U,
- /// FIRST_TARGET_DEP_FLAG - This is the first flag that subclasses are
- /// allowed to specify.
- FIRST_TARGET_DEP_FLAG = 0x800U,
-
- /// TARGET_INDEP_SHF - This is the bitmask for all the target independent
- /// section flags. Targets can define their own target flags above these.
- /// If they do that, they should implement their own MCSectionELF subclasses
- /// and implement the virtual method hooks below to handle printing needs.
- TARGET_INDEP_SHF = FIRST_TARGET_DEP_FLAG-1U
+ /// XCORE_SHF_DP_SECTION - All sections with the "d" flag are grouped
+ /// together by the linker to form the data section and the dp register is
+ /// set to the start of the section by the boot code.
+ XCORE_SHF_DP_SECTION = 0x1000U
};
StringRef getSectionName() const { return SectionName; }
unsigned getType() const { return Type; }
unsigned getFlags() const { return Flags; }
- virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
- raw_ostream &OS) const;
+ void PrintSwitchToSection(const MCAsmInfo &MAI,
+ raw_ostream &OS) const;
/// isBaseAddressKnownZero - We know that non-allocatable sections (like
/// debug info) have a base of zero.
virtual bool isBaseAddressKnownZero() const {
return (getFlags() & SHF_ALLOC) == 0;
}
-
- /// PrintTargetSpecificSectionFlags - Targets that define their own
- /// MCSectionELF subclasses with target specific section flags should
- /// implement this method if they end up adding letters to the attributes
- /// list.
- virtual void PrintTargetSpecificSectionFlags(const MCAsmInfo &MAI,
- raw_ostream &OS) const {
- }
-
-
};
} // end namespace llvm