[llvm-commits] [llvm] r93870 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Mon Jan 18 22:41:24 PST 2010
Author: lattner
Date: Tue Jan 19 00:41:24 2010
New Revision: 93870
URL: http://llvm.org/viewvc/llvm-project?rev=93870&view=rev
Log:
mcstreamer'ize the rest of EmitGlobalVariable that is used on
darwin. The next big piece to get global variables streamerized
is EmitGlobalConstant.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=93870&r1=93869&r2=93870&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Jan 19 00:41:24 2010
@@ -226,18 +226,20 @@
case GlobalValue::WeakAnyLinkage:
case GlobalValue::WeakODRLinkage:
case GlobalValue::LinkerPrivateLinkage:
- if (const char *WeakDef = MAI->getWeakDefDirective()) {
+ if (MAI->getWeakDefDirective() != 0) {
// .globl _foo
OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::Global);
// .weak_definition _foo
- O << WeakDef << *GVSym << '\n';
+ OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::WeakDefinition);
} else if (const char *LinkOnce = MAI->getLinkOnceDirective()) {
// .globl _foo
OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::Global);
// .linkonce same_size
O << LinkOnce;
- } else
- O << "\t.weak\t" << *GVSym << '\n';
+ } else {
+ // .weak _foo
+ OutStreamer.EmitSymbolAttribute(GVSym, MCStreamer::Weak);
+ }
break;
case GlobalValue::DLLExportLinkage:
case GlobalValue::AppendingLinkage:
@@ -256,13 +258,13 @@
}
EmitAlignment(AlignLog, GV);
- O << *GVSym << ":";
if (VerboseAsm) {
O.PadToColumn(MAI->getCommentColumn());
O << MAI->getCommentString() << ' ';
WriteAsOperand(O, GV, /*PrintType=*/false, GV->getParent());
+ O << '\n';
}
- O << '\n';
+ OutStreamer.EmitLabel(GVSym);
EmitGlobalConstant(GV->getInitializer());
More information about the llvm-commits
mailing list