1894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===-- llvm/Target/TargetLoweringObjectFile.h - Object Info ----*- C++ -*-===//
2894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
3894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//                     The LLVM Compiler Infrastructure
4894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
5894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file is distributed under the University of Illinois Open Source
6894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// License. See LICENSE.TXT for details.
7894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
8894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
9894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
10894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file implements classes used to handle lowerings specific to common
11894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// object file formats.
12894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
13894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
14894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
15894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#ifndef LLVM_MC_SECTIONKIND_H
16894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#define LLVM_MC_SECTIONKIND_H
17894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
18894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumannamespace llvm {
19894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
20894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// SectionKind - This is a simple POD value that classifies the properties of
21894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// a section.  A section is classified into the deepest possible
22894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// classification, and then the target maps them onto their sections based on
23894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// what capabilities they have.
24894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman///
25894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// The comments below describe these as if they were an inheritance hierarchy
26894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// in order to explain the predicates below.
27894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman///
28894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanclass SectionKind {
29894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  enum Kind {
30894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    /// Metadata - Debug info sections or other metadata.
31894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    Metadata,
32894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
33894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    /// Text - Text section, used for functions and other executable code.
34894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    Text,
35894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
36894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    /// ReadOnly - Data that is never written to at program runtime by the
37894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    /// program or the dynamic linker.  Things in the top-level readonly
38894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    /// SectionKind are not mergeable.
39894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    ReadOnly,
40894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
41894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        /// MergableCString - Any null-terminated string which allows merging.
42894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        /// These values are known to end in a nul value of the specified size,
43894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        /// not otherwise contain a nul value, and be mergable.  This allows the
44894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        /// linker to unique the strings if it so desires.
45894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
46894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// Mergeable1ByteCString - 1 byte mergable, null terminated, string.
47894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           Mergeable1ByteCString,
48894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
49894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// Mergeable2ByteCString - 2 byte mergable, null terminated, string.
50894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           Mergeable2ByteCString,
51894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
52894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// Mergeable4ByteCString - 4 byte mergable, null terminated, string.
53894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           Mergeable4ByteCString,
54894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
55894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        /// MergeableConst - These are sections for merging fixed-length
56894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        /// constants together.  For example, this can be used to unique
57894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        /// constant pool entries etc.
58894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        MergeableConst,
59894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
60894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman            /// MergeableConst4 - This is a section used by 4-byte constants,
61894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman            /// for example, floats.
62894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman            MergeableConst4,
63894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
64894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman            /// MergeableConst8 - This is a section used by 8-byte constants,
65894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman            /// for example, doubles.
66894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman            MergeableConst8,
67894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
68894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman            /// MergeableConst16 - This is a section used by 16-byte constants,
69894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman            /// for example, vectors.
70894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman            MergeableConst16,
71894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
72894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    /// Writeable - This is the base of all segments that need to be written
73894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    /// to during program runtime.
74894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
75894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman       /// ThreadLocal - This is the base of all TLS segments.  All TLS
76894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman       /// objects must be writeable, otherwise there is no reason for them to
77894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman       /// be thread local!
78894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
79894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// ThreadBSS - Zero-initialized TLS data objects.
80894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           ThreadBSS,
81894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
82894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// ThreadData - Initialized TLS data objects.
83894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           ThreadData,
84894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
85894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman       /// GlobalWriteableData - Writeable data that is global (not thread
86894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman       /// local).
87894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
88894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// BSS - Zero initialized writeable data.
89894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           BSS,
90894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
91894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// BSSLocal - This is BSS (zero initialized and writable) data
92894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// which has local linkage.
93894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               BSSLocal,
94894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
95894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// BSSExtern - This is BSS data with normal external linkage.
96894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               BSSExtern,
97894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
98894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// Common - Data with common linkage.  These represent tentative
99894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// definitions, which always have a zero initializer and are never
100894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// marked 'constant'.
101894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           Common,
102894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
103894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// DataRel - This is the most general form of data that is written
104894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// to by the program, it can have random relocations to arbitrary
105894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// globals.
106894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           DataRel,
107894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
108894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// DataRelLocal - This is writeable data that has a non-zero
109894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// initializer and has relocations in it, but all of the
110894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// relocations are known to be within the final linked image
111894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// the global is linked into.
112894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               DataRelLocal,
113894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
114894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                   /// DataNoRel - This is writeable data that has a non-zero
115894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                   /// initializer, but whose initializer is known to have no
116894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                   /// relocations.
117894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                   DataNoRel,
118894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
119894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// ReadOnlyWithRel - These are global variables that are never
120894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// written to by the program, but that have relocations, so they
121894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// must be stuck in a writeable section so that the dynamic linker
122894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// can write to them.  If it chooses to, the dynamic linker can
123894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// mark the pages these globals end up on as read-only after it is
124894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           /// done with its relocation phase.
125894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           ReadOnlyWithRel,
126894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
127894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// ReadOnlyWithRelLocal - This is data that is readonly by the
128894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// program, but must be writeable so that the dynamic linker
129894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// can perform relocations in it.  This is used when we know
130894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// that all the relocations are to globals in this final
131894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               /// linked image.
132894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman               ReadOnlyWithRelLocal
133894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
134894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  } K : 8;
135894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanpublic:
136894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
137894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isMetadata() const { return K == Metadata; }
138894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isText() const { return K == Text; }
139894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
140894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isReadOnly() const {
141894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return K == ReadOnly || isMergeableCString() ||
142894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           isMergeableConst();
143894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
144894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
145894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isMergeableCString() const {
146894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return K == Mergeable1ByteCString || K == Mergeable2ByteCString ||
147894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           K == Mergeable4ByteCString;
148894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
149894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isMergeable1ByteCString() const { return K == Mergeable1ByteCString; }
150894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isMergeable2ByteCString() const { return K == Mergeable2ByteCString; }
151894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isMergeable4ByteCString() const { return K == Mergeable4ByteCString; }
152894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
153894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isMergeableConst() const {
154894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return K == MergeableConst || K == MergeableConst4 ||
155894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman           K == MergeableConst8 || K == MergeableConst16;
156894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
157894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isMergeableConst4() const { return K == MergeableConst4; }
158894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isMergeableConst8() const { return K == MergeableConst8; }
159894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isMergeableConst16() const { return K == MergeableConst16; }
160894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
161894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isWriteable() const {
162894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return isThreadLocal() || isGlobalWriteableData();
163894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
164894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
165894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isThreadLocal() const {
166894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return K == ThreadData || K == ThreadBSS;
167894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
168894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
169894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isThreadBSS() const { return K == ThreadBSS; }
170894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isThreadData() const { return K == ThreadData; }
171894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
172894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isGlobalWriteableData() const {
173894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return isBSS() || isCommon() || isDataRel() || isReadOnlyWithRel();
174894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
175894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
176894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isBSS() const { return K == BSS || K == BSSLocal || K == BSSExtern; }
177894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isBSSLocal() const { return K == BSSLocal; }
178894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isBSSExtern() const { return K == BSSExtern; }
179894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
180894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isCommon() const { return K == Common; }
181894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
182894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isDataRel() const {
183894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return K == DataRel || K == DataRelLocal || K == DataNoRel;
184894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
185894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
186894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isDataRelLocal() const {
187894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return K == DataRelLocal || K == DataNoRel;
188894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
189894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
190894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isDataNoRel() const { return K == DataNoRel; }
191894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
192894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isReadOnlyWithRel() const {
193894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return K == ReadOnlyWithRel || K == ReadOnlyWithRelLocal;
194894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
195894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
196894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  bool isReadOnlyWithRelLocal() const {
197894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return K == ReadOnlyWithRelLocal;
198894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
199894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanprivate:
200894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind get(Kind K) {
201894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    SectionKind Res;
202894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    Res.K = K;
203894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return Res;
204894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
205894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanpublic:
206894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
207894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getMetadata() { return get(Metadata); }
208894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getText() { return get(Text); }
209894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getReadOnly() { return get(ReadOnly); }
210894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getMergeable1ByteCString() {
211894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return get(Mergeable1ByteCString);
212894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
213894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getMergeable2ByteCString() {
214894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return get(Mergeable2ByteCString);
215894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
216894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getMergeable4ByteCString() {
217894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return get(Mergeable4ByteCString);
218894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
219894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getMergeableConst() { return get(MergeableConst); }
220894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getMergeableConst4() { return get(MergeableConst4); }
221894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getMergeableConst8() { return get(MergeableConst8); }
222894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getMergeableConst16() { return get(MergeableConst16); }
223894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getThreadBSS() { return get(ThreadBSS); }
224894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getThreadData() { return get(ThreadData); }
225894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getBSS() { return get(BSS); }
226894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getBSSLocal() { return get(BSSLocal); }
227894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getBSSExtern() { return get(BSSExtern); }
228894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getCommon() { return get(Common); }
229894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getDataRel() { return get(DataRel); }
230894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getDataRelLocal() { return get(DataRelLocal); }
231894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getDataNoRel() { return get(DataNoRel); }
232894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getReadOnlyWithRel() { return get(ReadOnlyWithRel); }
233894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  static SectionKind getReadOnlyWithRelLocal(){
234894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return get(ReadOnlyWithRelLocal);
235894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
236894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman};
237894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
238894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman} // end namespace llvm
239894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
240894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#endif
241