aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/SectionKind.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-19 02:48:26 +0000
committerChris Lattner <sabre@nondot.org>2010-01-19 02:48:26 +0000
commita3839bc3714e6a84222f45cf4c0f1a20a88b10cd (patch)
tree63f5a4d489473d1124be4d1d1a4ba54dd8514e1c /include/llvm/MC/SectionKind.h
parent129e1872c276dc76f08862276bf7433b19643cab (diff)
downloadexternal_llvm-a3839bc3714e6a84222f45cf4c0f1a20a88b10cd.zip
external_llvm-a3839bc3714e6a84222f45cf4c0f1a20a88b10cd.tar.gz
external_llvm-a3839bc3714e6a84222f45cf4c0f1a20a88b10cd.tar.bz2
introduce a section kind for common linkage. Use this to slightly
simplify and commonize some of the asmprinter logic for globals. This also avoids printing the MCSection for .zerofill, which broke the llvm-gcc build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/SectionKind.h')
-rw-r--r--include/llvm/MC/SectionKind.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/MC/SectionKind.h b/include/llvm/MC/SectionKind.h
index 945cff7..f125d15 100644
--- a/include/llvm/MC/SectionKind.h
+++ b/include/llvm/MC/SectionKind.h
@@ -87,6 +87,11 @@ class SectionKind {
/// BSS - Zero initialized writeable data.
BSS,
+
+ /// Common - Data with common linkage. These represent tentative
+ /// definitions, which always have a zero initializer and are never
+ /// marked 'constant'.
+ Common,
/// DataRel - This is the most general form of data that is written
/// to by the program, it can have random relocations to arbitrary
@@ -158,10 +163,11 @@ public:
bool isThreadData() const { return K == ThreadData; }
bool isGlobalWriteableData() const {
- return isBSS() || isDataRel() || isReadOnlyWithRel();
+ return isBSS() || isCommon() || isDataRel() || isReadOnlyWithRel();
}
bool isBSS() const { return K == BSS; }
+ bool isCommon() const { return K == Common; }
bool isDataRel() const {
return K == DataRel || K == DataRelLocal || K == DataNoRel;
@@ -207,6 +213,7 @@ public:
static SectionKind getThreadBSS() { return get(ThreadBSS); }
static SectionKind getThreadData() { return get(ThreadData); }
static SectionKind getBSS() { return get(BSS); }
+ static SectionKind getCommon() { return get(Common); }
static SectionKind getDataRel() { return get(DataRel); }
static SectionKind getDataRelLocal() { return get(DataRelLocal); }
static SectionKind getDataNoRel() { return get(DataNoRel); }