aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/AsmPrinter
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
commit1a9edae76b2e7cf15c5f7c36928b3701ac2ef47b (patch)
treed82adcff4e4317e4abcb578ae1fdf33e10864174 /lib/Target/PowerPC/AsmPrinter
parentcf87a3dd015c7e2acfc0b4feff48fc7fc2a16f01 (diff)
downloadexternal_llvm-1a9edae76b2e7cf15c5f7c36928b3701ac2ef47b.zip
external_llvm-1a9edae76b2e7cf15c5f7c36928b3701ac2ef47b.tar.gz
external_llvm-1a9edae76b2e7cf15c5f7c36928b3701ac2ef47b.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/PowerPC/AsmPrinter')
-rw-r--r--lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
index a8127f6..2d9ecbd 100644
--- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
@@ -571,7 +571,7 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Print out labels for the function.
const Function *F = MF.getFunction();
- SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
+ SwitchToSection(TAI->SectionForGlobal(F));
switch (F->getLinkage()) {
default: assert(0 && "Unknown linkage type!");
@@ -662,7 +662,6 @@ void PPCLinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
return;
std::string name = Mang->getValueName(GVar);
- std::string SectionName = TAI->SectionForGlobal(GVar);
printVisibility(name, GVar->getVisibility());
@@ -671,7 +670,7 @@ void PPCLinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
unsigned Size = TD->getABITypeSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(GVar);
- SwitchToDataSection(SectionName.c_str());
+ SwitchToSection(TAI->SectionForGlobal(GVar));
if (C->isNullValue() && /* FIXME: Verify correct */
!GVar->hasSection() &&
@@ -759,7 +758,7 @@ bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Print out labels for the function.
const Function *F = MF.getFunction();
- SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
+ SwitchToSection(TAI->SectionForGlobal(F));
switch (F->getLinkage()) {
default: assert(0 && "Unknown linkage type!");
@@ -888,7 +887,6 @@ void PPCDarwinAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
}
std::string name = Mang->getValueName(GVar);
- std::string SectionName = TAI->SectionForGlobal(GVar);
printVisibility(name, GVar->getVisibility());
@@ -897,7 +895,7 @@ void PPCDarwinAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
unsigned Size = TD->getABITypeSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(GVar);
- SwitchToDataSection(SectionName.c_str());
+ SwitchToSection(TAI->SectionForGlobal(GVar));
if (C->isNullValue() && /* FIXME: Verify correct */
!GVar->hasSection() &&