[llvm-commits] [llvm] r100322 - /llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 4 00:23:01 PDT 2010
Author: lattner
Date: Sun Apr 4 02:23:00 2010
New Revision: 100322
URL: http://llvm.org/viewvc/llvm-project?rev=100322&view=rev
Log:
mc'ize the remaining uses of O.
Modified:
llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp?rev=100322&r1=100321&r2=100322&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp Sun Apr 4 02:23:00 2010
@@ -104,12 +104,14 @@
if (const ArrayType *ATy = dyn_cast<ArrayType>(
cast<PointerType>(GV->getType())->getElementType())) {
OutStreamer.EmitSymbolAttribute(Sym, MCSA_Global);
- O << ".globound" << "\n";
- O << "\t.set\t" << *Sym;
- O << ".globound" << "," << ATy->getNumElements() << "\n";
+ // FIXME: MCStreamerize.
+ OutStreamer.EmitRawText(StringRef(".globound"));
+ OutStreamer.EmitRawText("\t.set\t" + Twine(Sym->getName()));
+ OutStreamer.EmitRawText(".globound," + Twine(ATy->getNumElements()));
if (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()) {
// TODO Use COMDAT groups for LinkOnceLinkage
- O << MAI->getWeakDefDirective() << *Sym << ".globound" << "\n";
+ OutStreamer.EmitRawText(MAI->getWeakDefDirective() +Twine(Sym->getName())+
+ ".globound");
}
}
}
@@ -129,7 +131,8 @@
unsigned Align = (unsigned)TD->getPreferredTypeAlignmentShift(C->getType());
// Mark the start of the global
- O << "\t.cc_top " << *GVSym << ".data," << *GVSym << "\n";
+ OutStreamer.EmitRawText("\t.cc_top " + Twine(GVSym->getName()) + ".data," +
+ GVSym->getName());
switch (GV->getLinkage()) {
case GlobalValue::AppendingLinkage:
@@ -144,7 +147,7 @@
// TODO Use COMDAT groups for LinkOnceLinkage
if (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage())
- O << MAI->getWeakDefDirective() << *GVSym << "\n";
+ OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Weak);
// FALL THROUGH
case GlobalValue::InternalLinkage:
case GlobalValue::PrivateLinkage:
@@ -165,10 +168,11 @@
Size *= MaxThreads;
}
if (MAI->hasDotTypeDotSizeDirective()) {
- O << "\t.type " << *GVSym << ", at object\n";
- O << "\t.size " << *GVSym << "," << Size << "\n";
+ OutStreamer.EmitSymbolAttribute(GVSym, MCSA_ELF_TypeObject);
+ OutStreamer.EmitRawText("\t.size " + Twine(GVSym->getName()) + "," +
+ Twine(Size));
}
- O << *GVSym << ":\n";
+ OutStreamer.EmitLabel(GVSym);
EmitGlobalConstant(C);
if (GV->isThreadLocal()) {
@@ -181,7 +185,7 @@
OutStreamer.EmitZeros(4 - Size, 0);
// Mark the end of the global
- O << "\t.cc_bottom " << *GVSym << ".data\n";
+ OutStreamer.EmitRawText("\t.cc_bottom " + Twine(GVSym->getName()) + ".data");
}
/// Emit the directives on the start of functions
@@ -192,7 +196,8 @@
OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM));
// Mark the start of the function
- O << "\t.cc_top " << *CurrentFnSym << ".function," << *CurrentFnSym << "\n";
+ OutStreamer.EmitRawText("\t.cc_top " + Twine(CurrentFnSym->getName()) +
+ ".function," + CurrentFnSym->getName());
switch (F->getLinkage()) {
default: llvm_unreachable("Unknown linkage type!");
@@ -209,13 +214,13 @@
case Function::WeakODRLinkage:
// TODO Use COMDAT groups for LinkOnceLinkage
OutStreamer.EmitSymbolAttribute(CurrentFnSym, MCSA_Global);
- O << MAI->getWeakDefDirective() << *CurrentFnSym << "\n";
+ OutStreamer.EmitSymbolAttribute(CurrentFnSym, MCSA_Weak);
break;
}
// (1 << 1) byte aligned
EmitAlignment(MF.getAlignment(), F, 1);
if (MAI->hasDotTypeDotSizeDirective())
- O << "\t.type " << *CurrentFnSym << ", at function\n";
+ OutStreamer.EmitSymbolAttribute(CurrentFnSym, MCSA_ELF_TypeFunction);
OutStreamer.EmitLabel(CurrentFnSym);
}
More information about the llvm-commits
mailing list