From c25e1ea5e9aa54952b6736a9579e25a5c2d8139f Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Wed, 24 Sep 2008 22:14:23 +0000 Subject: Move actual section printing stuff to AsmPrinter from TAI reducing heap traffic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56573 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/SparcAsmPrinter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/Target/Sparc') diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp index bb4d6ae..424adaa 100644 --- a/lib/Target/Sparc/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/SparcAsmPrinter.cpp @@ -99,7 +99,7 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Print out the label for the function. const Function *F = MF.getFunction(); - SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F); + SwitchToSection(TAI->SectionForGlobal(F)); EmitAlignment(4, F); O << "\t.globl\t" << CurrentFnName << '\n'; @@ -242,7 +242,6 @@ void SparcAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) { return; O << "\n\n"; - std::string SectionName = TAI->SectionForGlobal(GVar); std::string name = Mang->getValueName(GVar); Constant *C = GVar->getInitializer(); unsigned Size = TD->getABITypeSize(C->getType()); @@ -250,7 +249,7 @@ void SparcAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) { printVisibility(name, GVar->getVisibility()); - SwitchToDataSection(SectionName.c_str()); + SwitchToSection(TAI->SectionForGlobal(GVar)); if (C->isNullValue() && !GVar->hasSection()) { if (!GVar->isThreadLocal() && -- cgit v1.1