summaryrefslogtreecommitdiff
path: root/lib/Target/MSP430/MSP430AsmPrinter.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-05-03 13:01:41 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-05-03 13:01:41 +0000
commit09c42f509a10e1725f52ebac36d38deee194b526 (patch)
tree2183107f2b93b83992b9f900fc96021dafef7615 /lib/Target/MSP430/MSP430AsmPrinter.cpp
parentf3085ac973da76bd737d9b88652c0fd0a6097bb2 (diff)
downloadllvm-09c42f509a10e1725f52ebac36d38deee194b526.tar.gz
llvm-09c42f509a10e1725f52ebac36d38deee194b526.tar.bz2
llvm-09c42f509a10e1725f52ebac36d38deee194b526.tar.xz
Add function body printing routine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MSP430/MSP430AsmPrinter.cpp')
-rw-r--r--lib/Target/MSP430/MSP430AsmPrinter.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/Target/MSP430/MSP430AsmPrinter.cpp b/lib/Target/MSP430/MSP430AsmPrinter.cpp
index a9e119f6ea..6b0f5100c3 100644
--- a/lib/Target/MSP430/MSP430AsmPrinter.cpp
+++ b/lib/Target/MSP430/MSP430AsmPrinter.cpp
@@ -83,7 +83,27 @@ bool MSP430AsmPrinter::doFinalization(Module &M) {
return AsmPrinter::doFinalization(M);
}
-bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &F) {
+bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ // Print out code for the function.
+ for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
+ I != E; ++I) {
+ // Print a label for the basic block.
+ if (I != MF.begin()) {
+ printBasicBlockLabel(I, true , true);
+ O << '\n';
+ }
+
+ for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
+ II != E; ++II) {
+ // Print the assembly for the instruction.
+ O << "\t";
+ printMachineInstruction(II);
+ }
+
+ // Each Basic Block is separated by a newline
+ O << '\n';
+ }
+
// We didn't modify anything
return false;
}