diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:01:41 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:01:41 +0000 |
commit | c942782b3bf68409992deb52f1cfe58e4fbabc39 (patch) | |
tree | 4412cd81a4714e8331878337d52549032938b432 /llvm/lib | |
parent | ef811d8e058f321ce639c3a3d105f3f043cea8a3 (diff) | |
download | bcm5719-llvm-c942782b3bf68409992deb52f1cfe58e4fbabc39.tar.gz bcm5719-llvm-c942782b3bf68409992deb52f1cfe58e4fbabc39.zip |
Add function body printing routine
llvm-svn: 70709
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp b/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp index a9e119f6eae..6b0f5100c30 100644 --- a/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp +++ b/llvm/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; } |