[llvm-commits] CVS: llvm/lib/Target/IA64/IA64AsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Wed Oct 4 19:51:51 PDT 2006
Changes in directory llvm/lib/Target/IA64:
IA64AsmPrinter.cpp updated: 1.36 -> 1.37
---
Log message:
implement and use getSectionForFunction
---
Diffs of the changes: (+10 -3)
IA64AsmPrinter.cpp | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
Index: llvm/lib/Target/IA64/IA64AsmPrinter.cpp
diff -u llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.36 llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.37
--- llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.36 Thu Sep 14 13:23:27 2006
+++ llvm/lib/Target/IA64/IA64AsmPrinter.cpp Wed Oct 4 21:51:36 2006
@@ -105,6 +105,8 @@
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 @@
#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 @@
// 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";
More information about the llvm-commits
mailing list