aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-09-24 22:14:23 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-09-24 22:14:23 +0000
commitc25e1ea5e9aa54952b6736a9579e25a5c2d8139f (patch)
treed82adcff4e4317e4abcb578ae1fdf33e10864174 /lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
parent0c8e80607bc3296a4775f05c02f0d11df8e5cb04 (diff)
downloadexternal_llvm-c25e1ea5e9aa54952b6736a9579e25a5c2d8139f.zip
external_llvm-c25e1ea5e9aa54952b6736a9579e25a5c2d8139f.tar.gz
external_llvm-c25e1ea5e9aa54952b6736a9579e25a5c2d8139f.tar.bz2
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
Diffstat (limited to 'lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp')
-rw-r--r--lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index 61c8f12..01fda9f 100644
--- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
@@ -148,11 +148,10 @@ void X86ATTAsmPrinter::decorateName(std::string &Name,
void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
const Function *F = MF.getFunction();
- std::string SectionName = TAI->SectionForGlobal(F);
decorateName(CurrentFnName, F);
- SwitchToTextSection(SectionName.c_str());
+ SwitchToSection(TAI->SectionForGlobal(F));
unsigned FnAlign = OptimizeForSize ? 1 : 4;
if (!F->isDeclaration() && F->hasNote(FnAttr::OptimizeForSize))
@@ -766,7 +765,6 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
return;
}
- std::string SectionName = TAI->SectionForGlobal(GVar);
std::string name = Mang->getValueName(GVar);
Constant *C = GVar->getInitializer();
const Type *Type = C->getType();
@@ -778,7 +776,7 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
if (Subtarget->isTargetELF())
O << "\t.type\t" << name << ",@object\n";
- SwitchToDataSection(SectionName.c_str());
+ SwitchToSection(TAI->SectionForGlobal(GVar));
if (C->isNullValue() && !GVar->hasSection()) {
// FIXME: This seems to be pretty darwin-specific