aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-18 01:21:08 +0000
committerChris Lattner <sabre@nondot.org>2010-01-18 01:21:08 +0000
commitaad30363fb410c3e5e08756d972be77833593791 (patch)
tree460c09ec974e2dfb6af880783df85d7b1bcd8102 /lib
parent5957c84e09b177aecf8b430c33fd75a36575fb57 (diff)
switch x86 zerofill emission over to use MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
index 10d2e3039a..a24a4f1746 100644
--- a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
@@ -685,10 +685,19 @@ void X86AsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
// Don't put things that should go in the cstring section into "comm".
!TheSection->getKind().isMergeableCString()) {
if (GVar->hasExternalLinkage()) {
- if (const char *Directive = MAI->getZeroFillDirective()) {
+ if (MAI->hasZeroFillDirective()) {
+ // .globl _foo
OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::Global);
- O << Directive << "__DATA, __common, " << *GVSym;
- O << ", " << Size << ", " << Align << '\n';
+ // .zerofill __DATA, __common, _foo, 400, 5
+ TargetLoweringObjectFileMachO &TLOFMacho =
+ static_cast<TargetLoweringObjectFileMachO &>(getObjFileLowering());
+ // FIXME: This stuff should already be handled by SectionForGlobal!
+ const MCSection *TheSection =
+ TLOFMacho.getMachOSection("__DATA", "__common",
+ MCSectionMachO::S_ZEROFILL,
+ SectionKind::getBSS());
+
+ OutStreamer.EmitZerofill(TheSection, GVSym, Size, 1 << Align);
return;
}
}