(re)introduce new simpler apis for creation sectionkinds.
[oota-llvm.git] / include / llvm / MC / SectionKind.h
index 35a0d190f2633909de86e2e28ebd72244f363670..8cb9b325c723e73d77fd5c9cb1746c1c2f3bdc22 100644 (file)
@@ -117,7 +117,6 @@ public:
   
 protected:
   Kind K : 8;
-  
 public:
   
   bool isMetadata() const { return K == Metadata; }
@@ -177,6 +176,25 @@ public:
     Res.K = K;
     return Res;
   }
+  
+  static SectionKind getMetadata() { return get(Metadata); }
+  static SectionKind getText() { return get(Text); }
+  static SectionKind getReadOnly() { return get(ReadOnly); }
+  static SectionKind getMergeableCString() { return get(MergeableCString); }
+  static SectionKind getMergeableConst() { return get(MergeableConst); }
+  static SectionKind getMergeableConst4() { return get(MergeableConst4); }
+  static SectionKind getMergeableConst8() { return get(MergeableConst8); }
+  static SectionKind getMergeableConst16() { return get(MergeableConst16); }
+  static SectionKind getThreadBSS() { return get(ThreadBSS); }
+  static SectionKind getThreadData() { return get(ThreadData); }
+  static SectionKind getBSS() { return get(BSS); }
+  static SectionKind getDataRel() { return get(DataRel); }
+  static SectionKind getDataRelLocal() { return get(DataRelLocal); }
+  static SectionKind getDataNoRel() { return get(DataNoRel); }
+  static SectionKind getReadOnlyWithRel() { return get(ReadOnlyWithRel); }
+  static SectionKind getReadOnlyWithRelLocal(){
+    return get(ReadOnlyWithRelLocal);
+  }
 };
   
 } // end namespace llvm