From 1841b34f533f6553acd57b0dd92467c5fbf9fb2e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 4 Apr 2010 07:17:25 +0000 Subject: [PATCH] finish eliminating uses of O. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100321 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../PowerPC/AsmPrinter/PPCAsmPrinter.cpp | 51 ++++++++++++------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index 49ec0ca8b8e..e31e490e8d2 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -732,22 +732,31 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) { OutStreamer.EmitLabel(Stub); OutStreamer.EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol); // FIXME: MCize this. - O << "\tmflr r0\n"; - O << "\tbcl 20,31," << *AnonSymbol << '\n'; + OutStreamer.EmitRawText(StringRef("\tmflr r0")); + OutStreamer.EmitRawText("\tbcl 20,31," + Twine(AnonSymbol->getName())); OutStreamer.EmitLabel(AnonSymbol); - O << "\tmflr r11\n"; - O << "\taddis r11,r11,ha16(" << *LazyPtr << '-' << *AnonSymbol - << ")\n"; - O << "\tmtlr r0\n"; - O << (isPPC64 ? "\tldu" : "\tlwzu") << " r12,lo16(" << *LazyPtr - << '-' << *AnonSymbol << ")(r11)\n"; - O << "\tmtctr r12\n"; - O << "\tbctr\n"; + OutStreamer.EmitRawText(StringRef("\tmflr r11")); + OutStreamer.EmitRawText("\taddis r11,r11,ha16("+Twine(LazyPtr->getName())+ + "-" + AnonSymbol->getName() + ")"); + OutStreamer.EmitRawText(StringRef("\tmtlr r0")); + + if (isPPC64) + OutStreamer.EmitRawText("\tldu r12,lo16(" + Twine(LazyPtr->getName()) + + "-" + AnonSymbol->getName() + ")(r11)"); + else + OutStreamer.EmitRawText("\tlwzu r12,lo16(" + Twine(LazyPtr->getName()) + + "-" + AnonSymbol->getName() + ")(r11)"); + OutStreamer.EmitRawText(StringRef("\tmtctr r12")); + OutStreamer.EmitRawText(StringRef("\tbctr")); OutStreamer.SwitchSection(LSPSection); OutStreamer.EmitLabel(LazyPtr); OutStreamer.EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol); - O << (isPPC64 ? "\t.quad" : "\t.long") << " dyld_stub_binding_helper\n"; + + if (isPPC64) + OutStreamer.EmitRawText(StringRef("\t.quad dyld_stub_binding_helper")); + else + OutStreamer.EmitRawText(StringRef("\t.long dyld_stub_binding_helper")); } OutStreamer.AddBlankLine(); return; @@ -767,15 +776,23 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) { EmitAlignment(4); OutStreamer.EmitLabel(Stub); OutStreamer.EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol); - O << "\tlis r11,ha16(" << *LazyPtr << ")\n"; - O << (isPPC64 ? "\tldu" : "\tlwzu") << " r12,lo16(" << *LazyPtr - << ")(r11)\n"; - O << "\tmtctr r12\n"; - O << "\tbctr\n"; + OutStreamer.EmitRawText("\tlis r11,ha16(" + Twine(LazyPtr->getName()) +")"); + if (isPPC64) + OutStreamer.EmitRawText("\tldu r12,lo16(" + Twine(LazyPtr->getName()) + + ")(r11)"); + else + OutStreamer.EmitRawText("\tlwzu r12,lo16(" + Twine(LazyPtr->getName()) + + ")(r11)"); + OutStreamer.EmitRawText(StringRef("\tmtctr r12")); + OutStreamer.EmitRawText(StringRef("\tbctr")); OutStreamer.SwitchSection(LSPSection); OutStreamer.EmitLabel(LazyPtr); OutStreamer.EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol); - O << (isPPC64 ? "\t.quad" : "\t.long") << " dyld_stub_binding_helper\n"; + + if (isPPC64) + OutStreamer.EmitRawText(StringRef("\t.quad dyld_stub_binding_helper")); + else + OutStreamer.EmitRawText(StringRef("\t.long dyld_stub_binding_helper")); } OutStreamer.AddBlankLine(); -- 2.34.1