diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-19 06:25:51 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-19 06:25:51 +0000 |
| commit | cd2915e46769317c8e2393bb6d2a2aed58036f45 (patch) | |
| tree | 507ecc4dfeadbe722963d069da86989b0ac3ab92 /llvm/lib/CodeGen | |
| parent | ab9cd3e132a86f99c8784c6025c6f55bb5cf2612 (diff) | |
| download | bcm5719-llvm-cd2915e46769317c8e2393bb6d2a2aed58036f45.tar.gz bcm5719-llvm-cd2915e46769317c8e2393bb6d2a2aed58036f45.zip | |
stop using the .lcomm pseudoop on darwin, instead, directly use the
.zerofill directive. Streamerize its generation.
llvm-svn: 93868
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 411a0f05fcb..fbbcc27a580 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -171,21 +171,34 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) { WriteAsOperand(O, GV, /*PrintType=*/false, GV->getParent()); O << '\n'; } + + // Handle common symbols. if (GVKind.isCommon()) { // .comm _foo, 42, 4 OutStreamer.EmitCommonSymbol(GVSym, Size, 1 << AlignLog); - } else if (const char *LComm = MAI->getLCOMMDirective()) { - // .lcomm _foo, 42, 4 + return; + } + + // Handle local BSS symbols. + if (MAI->hasMachoZeroFillDirective()) { + const MCSection *TheSection = + getObjFileLowering().SectionForGlobal(GV, GVKind, Mang, TM); + // .zerofill __DATA, __bss, _foo, 400, 5 + OutStreamer.EmitZerofill(TheSection, GVSym, Size, 1 << AlignLog); + return; + } + + if (const char *LComm = MAI->getLCOMMDirective()) { + // .lcomm _foo, 42 O << LComm << *GVSym << ',' << Size; - if (MAI->getLCOMMDirectiveTakesAlignment()) - O << ',' << AlignLog; O << '\n'; - } else { - // .local _foo - O << "\t.local\t" << *GVSym << '\n'; - // .comm _foo, 42, 4 - OutStreamer.EmitCommonSymbol(GVSym, Size, 1 << AlignLog); + return; } + + // .local _foo + O << "\t.local\t" << *GVSym << '\n'; + // .comm _foo, 42, 4 + OutStreamer.EmitCommonSymbol(GVSym, Size, 1 << AlignLog); return; } |

