diff options
author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-04-08 05:38:48 +0000 |
---|---|---|
committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-04-08 05:38:48 +0000 |
commit | 4b489c75c24b31f7310501dde48ca7ea3676e0af (patch) | |
tree | ebc8411aee8a110e640f630d981a15b29fb08555 /llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp | |
parent | 3b358a3d830c6f3587813359eba62e81ee215303 (diff) | |
download | bcm5719-llvm-4b489c75c24b31f7310501dde48ca7ea3676e0af.tar.gz bcm5719-llvm-4b489c75c24b31f7310501dde48ca7ea3676e0af.zip |
Handle indirect function calls.
Every function has the address of its frame in the beginning of code section.
The frame address is retrieved and used to pass arguments.
llvm-svn: 68597
Diffstat (limited to 'llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp index c0b1f6e8607..109504ec68a 100644 --- a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp +++ b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp @@ -113,6 +113,10 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) { SectionFlags::Code); O << "\n"; SwitchToSection (fCodeSection); + O << CurrentFnName << ":\n"; + O << " retlw low(" << CurrentFnName << ".frame)\n"; + O << " retlw high(" << CurrentFnName << ".frame)\n"; + // Print out code for the function. for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); @@ -122,8 +126,6 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) { printBasicBlockLabel(I, true); O << '\n'; } - else - O << CurrentFnName << ":\n"; CurBank = ""; for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); II != E; ++II) { |