mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
mcstreamer'ize the rest of EmitGlobalVariable that is used on
darwin. The next big piece to get global variables streamerized is EmitGlobalConstant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93870 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -226,18 +226,20 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
case GlobalValue::WeakAnyLinkage:
|
case GlobalValue::WeakAnyLinkage:
|
||||||
case GlobalValue::WeakODRLinkage:
|
case GlobalValue::WeakODRLinkage:
|
||||||
case GlobalValue::LinkerPrivateLinkage:
|
case GlobalValue::LinkerPrivateLinkage:
|
||||||
if (const char *WeakDef = MAI->getWeakDefDirective()) {
|
if (MAI->getWeakDefDirective() != 0) {
|
||||||
// .globl _foo
|
// .globl _foo
|
||||||
OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::Global);
|
OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::Global);
|
||||||
// .weak_definition _foo
|
// .weak_definition _foo
|
||||||
O << WeakDef << *GVSym << '\n';
|
OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::WeakDefinition);
|
||||||
} else if (const char *LinkOnce = MAI->getLinkOnceDirective()) {
|
} else if (const char *LinkOnce = MAI->getLinkOnceDirective()) {
|
||||||
// .globl _foo
|
// .globl _foo
|
||||||
OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::Global);
|
OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::Global);
|
||||||
// .linkonce same_size
|
// .linkonce same_size
|
||||||
O << LinkOnce;
|
O << LinkOnce;
|
||||||
} else
|
} else {
|
||||||
O << "\t.weak\t" << *GVSym << '\n';
|
// .weak _foo
|
||||||
|
OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::Weak);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GlobalValue::DLLExportLinkage:
|
case GlobalValue::DLLExportLinkage:
|
||||||
case GlobalValue::AppendingLinkage:
|
case GlobalValue::AppendingLinkage:
|
||||||
@@ -256,13 +258,13 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EmitAlignment(AlignLog, GV);
|
EmitAlignment(AlignLog, GV);
|
||||||
O << *GVSym << ":";
|
|
||||||
if (VerboseAsm) {
|
if (VerboseAsm) {
|
||||||
O.PadToColumn(MAI->getCommentColumn());
|
O.PadToColumn(MAI->getCommentColumn());
|
||||||
O << MAI->getCommentString() << ' ';
|
O << MAI->getCommentString() << ' ';
|
||||||
WriteAsOperand(O, GV, /*PrintType=*/false, GV->getParent());
|
WriteAsOperand(O, GV, /*PrintType=*/false, GV->getParent());
|
||||||
|
O << '\n';
|
||||||
}
|
}
|
||||||
O << '\n';
|
OutStreamer.EmitLabel(GVSym);
|
||||||
|
|
||||||
EmitGlobalConstant(GV->getInitializer());
|
EmitGlobalConstant(GV->getInitializer());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user