aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-05 02:51:36 +0000
committerChris Lattner <sabre@nondot.org>2006-10-05 02:51:36 +0000
commitedad2b783fe9ab20bdf0de2b3315559fb75f3a25 (patch)
treeadd9be3d7f613a588f0c2ca73cade85e3966ea42 /lib
parent6f6f69950f5a36d3ae7e4d1d5b96fda204beb79a (diff)
downloadexternal_llvm-edad2b783fe9ab20bdf0de2b3315559fb75f3a25.tar.gz
external_llvm-edad2b783fe9ab20bdf0de2b3315559fb75f3a25.tar.bz2
external_llvm-edad2b783fe9ab20bdf0de2b3315559fb75f3a25.zip
implement and use getSectionForFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/IA64/IA64AsmPrinter.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Target/IA64/IA64AsmPrinter.cpp b/lib/Target/IA64/IA64AsmPrinter.cpp
index 5fcc86f50e..fd85b8bc9b 100644
--- a/lib/Target/IA64/IA64AsmPrinter.cpp
+++ b/lib/Target/IA64/IA64AsmPrinter.cpp
@@ -105,6 +105,8 @@ namespace {
printOp(MI->getOperand(OpNo), true); // this is a br.call instruction
}
+ std::string getSectionForFunction(const Function &F) const;
+
void printMachineInstruction(const MachineInstr *MI);
void printOp(const MachineOperand &MO, bool isBRCALLinsn= false);
bool runOnMachineFunction(MachineFunction &F);
@@ -118,6 +120,11 @@ namespace {
#include "IA64GenAsmWriter.inc"
+std::string IA64AsmPrinter::getSectionForFunction(const Function &F) const {
+ // This means "Allocated instruXions in mem, initialized".
+ return "\n\t.section .text, \"ax\", \"progbits\"\n";
+}
+
/// runOnMachineFunction - This uses the printMachineInstruction()
/// method to print assembly for each instruction.
///
@@ -128,10 +135,10 @@ bool IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Print out constants referenced by the function
EmitConstantPool(MF.getConstantPool());
+ const Function *F = MF.getFunction();
+ SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+
// Print out labels for the function.
- SwitchToTextSection("\n\t.section .text, \"ax\", \"progbits\"\n",
- MF.getFunction());
- // ^^ means "Allocated instruXions in mem, initialized"
EmitAlignment(5);
O << "\t.global\t" << CurrentFnName << "\n";
O << "\t.type\t" << CurrentFnName << ", @function\n";