mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
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
This commit is contained in:
parent
5957c84e09
commit
aad30363fb
@ -316,6 +316,8 @@ namespace llvm {
|
||||
const char *getZeroFillDirective() const {
|
||||
return ZeroFillDirective;
|
||||
}
|
||||
bool hasZeroFillDirective() const { return ZeroFillDirective != 0; }
|
||||
|
||||
const char *getNonexecutableStackDirective() const {
|
||||
return NonexecutableStackDirective;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user