summaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCSection.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-08 22:41:53 +0000
committerChris Lattner <sabre@nondot.org>2009-08-08 22:41:53 +0000
commit892e18239308f8a02a4c83758616be84a459c19d (patch)
tree84b7cceebedea3e4afd191e06686054be73baf22 /include/llvm/MC/MCSection.h
parent0aac30195c8f3f7066d4d069693e5d91f054f081 (diff)
downloadexternal_llvm-892e18239308f8a02a4c83758616be84a459c19d.zip
external_llvm-892e18239308f8a02a4c83758616be84a459c19d.tar.gz
external_llvm-892e18239308f8a02a4c83758616be84a459c19d.tar.bz2
1. Make MCSection an abstract class.
2. Move section switch printing to MCSection virtual method which takes a TAI. This eliminates textual formatting stuff from TLOF. 3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and TLOFELF::AtIsCommentChar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCSection.h')
-rw-r--r--include/llvm/MC/MCSection.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/llvm/MC/MCSection.h b/include/llvm/MC/MCSection.h
index 0669d0f..4e5969a 100644
--- a/include/llvm/MC/MCSection.h
+++ b/include/llvm/MC/MCSection.h
@@ -20,6 +20,8 @@
namespace llvm {
class MCContext;
+ class TargetAsmInfo;
+ class raw_ostream;
/// MCSection - Instances of this class represent a uniqued identifier for a
/// section in the current translation unit. The MCContext class uniques and
@@ -43,13 +45,13 @@ namespace llvm {
public:
virtual ~MCSection();
- static MCSection *Create(const StringRef &Name, bool IsDirective,
- SectionKind K, MCContext &Ctx);
-
const std::string &getName() const { return Name; }
bool isDirective() const { return IsDirective; }
SectionKind getKind() const { return Kind; }
+
+ virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
+ raw_ostream &OS) const = 0;
};
@@ -60,7 +62,9 @@ namespace llvm {
static MCSectionELF *Create(const StringRef &Name, bool IsDirective,
SectionKind K, MCContext &Ctx);
-
+
+ virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
+ raw_ostream &OS) const;
};
class MCSectionMachO : public MCSection {
@@ -70,6 +74,9 @@ namespace llvm {
static MCSectionMachO *Create(const StringRef &Name, bool IsDirective,
SectionKind K, MCContext &Ctx);
+
+ virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
+ raw_ostream &OS) const;
};
class MCSectionCOFF : public MCSection {
@@ -79,6 +86,9 @@ namespace llvm {
static MCSectionCOFF *Create(const StringRef &Name, bool IsDirective,
SectionKind K, MCContext &Ctx);
+
+ virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
+ raw_ostream &OS) const;
};
} // end namespace llvm