mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Use .zerofill on x86/darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26196 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -96,24 +96,31 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
|
|||||||
|
|
||||||
if (C->isNullValue() && /* FIXME: Verify correct */
|
if (C->isNullValue() && /* FIXME: Verify correct */
|
||||||
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
|
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
|
||||||
I->hasLinkOnceLinkage())) {
|
I->hasLinkOnceLinkage() ||
|
||||||
|
(forDarwin && I->hasExternalLinkage() && !I->hasSection()))) {
|
||||||
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
|
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
|
||||||
SwitchSection(".data", I);
|
if (I->hasExternalLinkage()) {
|
||||||
if (LCOMMDirective != NULL) {
|
O << "\t.global\t" << name << "\n";
|
||||||
if (I->hasInternalLinkage()) {
|
O << "\t.zerofill __DATA__, __common, " << name << ", "
|
||||||
O << LCOMMDirective << name << "," << Size;
|
<< Size << ", " << Align;
|
||||||
if (forDarwin)
|
|
||||||
O << "," << (AlignmentIsInBytes ? (1 << Align) : Align);
|
|
||||||
} else
|
|
||||||
O << COMMDirective << name << "," << Size;
|
|
||||||
} else {
|
} else {
|
||||||
if (I->hasInternalLinkage())
|
SwitchSection(".data", I);
|
||||||
O <<"\t.local\t" << name << "\n";
|
if (LCOMMDirective != NULL) {
|
||||||
O << COMMDirective << name << "," << Size;
|
if (I->hasInternalLinkage()) {
|
||||||
if (COMMDirectiveTakesAlignment)
|
O << LCOMMDirective << name << "," << Size;
|
||||||
O << "," << (AlignmentIsInBytes ? (1 << Align) : Align);
|
if (forDarwin)
|
||||||
|
O << "," << (AlignmentIsInBytes ? (1 << Align) : Align);
|
||||||
|
} else
|
||||||
|
O << COMMDirective << name << "," << Size;
|
||||||
|
} else {
|
||||||
|
if (I->hasInternalLinkage())
|
||||||
|
O << "\t.local\t" << name << "\n";
|
||||||
|
O << COMMDirective << name << "," << Size;
|
||||||
|
if (COMMDirectiveTakesAlignment)
|
||||||
|
O << "," << (AlignmentIsInBytes ? (1 << Align) : Align);
|
||||||
|
}
|
||||||
|
O << "\t\t" << CommentString << " " << I->getName() << "\n";
|
||||||
}
|
}
|
||||||
O << "\t\t" << CommentString << " " << I->getName() << "\n";
|
|
||||||
} else {
|
} else {
|
||||||
switch (I->getLinkage()) {
|
switch (I->getLinkage()) {
|
||||||
case GlobalValue::LinkOnceLinkage:
|
case GlobalValue::LinkOnceLinkage:
|
||||||
|
Reference in New Issue
Block a user