aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-19 02:09:44 +0000
committerChris Lattner <sabre@nondot.org>2010-01-19 02:09:44 +0000
commitaac138e84dee1cb3ffc1035b2a1e4361fe0b4f80 (patch)
treef62498c8c571448790a13d39837f8691fd77e21f /include
parent60a17740b845565f664e81a91b7019a520af88d7 (diff)
downloadexternal_llvm-aac138e84dee1cb3ffc1035b2a1e4361fe0b4f80.zip
external_llvm-aac138e84dee1cb3ffc1035b2a1e4361fe0b4f80.tar.gz
external_llvm-aac138e84dee1cb3ffc1035b2a1e4361fe0b4f80.tar.bz2
Cleanup handling of .zerofill on darwin:
1. TargetLoweringObjectFileMachO should decide if something goes in zerofill instead of having every target do it. 2. TargetLoweringObjectFileMachO should assign said symbols to the right MCSection, the asmprinters should just emit to the right section. 3. Since all zerofill stuff goes through mcstreamer anymore, MAI can have a bool "haszerofill" instead of having the textual directive to emit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93838 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCAsmInfo.h13
-rw-r--r--include/llvm/Target/TargetLoweringObjectFile.h7
2 files changed, 12 insertions, 8 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index 1d90feb..6d01278 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -29,15 +29,15 @@ namespace llvm {
// Properties to be set by the target writer, used to configure asm printer.
//
- /// ZeroFillDirective - Directive for emitting a global to the ZeroFill
- /// section on this target. Null if this target doesn't support zerofill.
- const char *ZeroFillDirective; // Default is null.
-
/// NonexecutableStackDirective - Directive for declaring to the
/// linker and beyond that the emitted code does not require stack
/// memory to be executable.
const char *NonexecutableStackDirective; // Default is null.
+ /// HasMachoZeroFillDirective - True if this is a MachO target that supports
+ /// the macho-specific .zerofill directive for emitting BSS Symbols.
+ bool HasMachoZeroFillDirective; // Default is false.
+
/// NeedsSet - True if target asm treats expressions in data directives
/// as linktime-relocatable. For assembly-time computation, we need to
/// use a .set. Thus:
@@ -313,10 +313,7 @@ namespace llvm {
// Accessors.
//
- const char *getZeroFillDirective() const {
- return ZeroFillDirective;
- }
- bool hasZeroFillDirective() const { return ZeroFillDirective != 0; }
+ bool hasMachoZeroFillDirective() const { return HasMachoZeroFillDirective; }
const char *getNonexecutableStackDirective() const {
return NonexecutableStackDirective;
diff --git a/include/llvm/Target/TargetLoweringObjectFile.h b/include/llvm/Target/TargetLoweringObjectFile.h
index 3dd7471..fec56fa 100644
--- a/include/llvm/Target/TargetLoweringObjectFile.h
+++ b/include/llvm/Target/TargetLoweringObjectFile.h
@@ -258,6 +258,7 @@ class TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
const MCSection *ConstDataCoalSection;
const MCSection *ConstDataSection;
const MCSection *DataCoalSection;
+ const MCSection *DataCommonSection;
const MCSection *FourByteConstantSection;
const MCSection *EightByteConstantSection;
const MCSection *SixteenByteConstantSection;
@@ -312,6 +313,12 @@ public:
return ConstTextCoalSection;
}
+ /// getDataCommonSection - Return the "__DATA,__common" section we put
+ /// zerofill (aka bss) data into.
+ const MCSection *getDataCommonSection() const {
+ return DataCommonSection;
+ }
+
/// getLazySymbolPointerSection - Return the section corresponding to
/// the .lazy_symbol_pointer directive.
const MCSection *getLazySymbolPointerSection() const {