sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
[oota-llvm.git] / lib / Target / PIC16 / PIC16Section.h
index 4c2ae05707c5c3fa872c0307c2611c4abf5a2b84..f69cc2c80731383f167ca251e9ed38e5e2825cd1 100644 (file)
 #define LLVM_PIC16SECTION_H
 
 #include "llvm/MC/MCSection.h"
-#include "llvm/MC/MCContext.h"
-#include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
 
   class MCSectionPIC16 : public MCSection {
-    MCSectionPIC16(const StringRef &Name, bool IsDirective, SectionKind K,
-                 MCContext &Ctx) : MCSection(Name, IsDirective, K, Ctx) {}
+    std::string Name;
+    
+    MCSectionPIC16(const StringRef &name, SectionKind K,
+                   MCContext &Ctx);
   public:
     
-    static MCSectionPIC16 *Create(const StringRef &Name, bool IsDirective, 
-                                  SectionKind K, MCContext &Ctx) {
-      return new (Ctx) MCSectionPIC16(Name, IsDirective, K, Ctx);
-    }
+    const std::string &getName() const { return Name; }
     
+    static MCSectionPIC16 *Create(const StringRef &Name, 
+                                  SectionKind K, MCContext &Ctx);
     
     virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
-                                      raw_ostream &OS) const {
-      OS << getName() << '\n';
-    }
-
+                                      raw_ostream &OS) const;
   };
 
 } // end namespace llvm