summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc/SparcRegisterInfo.h
diff options
context:
space:
mode:
authorVenkatraman Govindaraju <venkatra@cs.wisc.edu>2013-09-05 05:32:16 +0000
committerVenkatraman Govindaraju <venkatra@cs.wisc.edu>2013-09-05 05:32:16 +0000
commit55ecb10e995a3e5df9118c48c1b0643d639f6033 (patch)
tree6f3895889bd93e0cfe06fc31641d4c8c39ba0614 /llvm/lib/Target/Sparc/SparcRegisterInfo.h
parentef44edfde470d2f03f6cd808a139f2feafbedee4 (diff)
downloadbcm5719-llvm-55ecb10e995a3e5df9118c48c1b0643d639f6033.tar.gz
bcm5719-llvm-55ecb10e995a3e5df9118c48c1b0643d639f6033.zip
[Sparc] Correctly handle call to functions with ReturnsTwice attribute.
In sparc, setjmp stores only the registers %fp, %sp, %i7 and %o7. longjmp restores the stack, and the callee-saved registers (all local/in registers: %i0-%i7, %l0-%l7) using the stored %fp and register windows. However, this does not guarantee that the longjmp will restore the registers, as they were when the setjmp was called. This is because these registers may be clobbered after returning from setjmp, but before calling longjmp. This patch prevents the registers %i0-%i5, %l0-l7 to live across the setjmp call using the register mask. llvm-svn: 190033
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcRegisterInfo.h')
-rw-r--r--llvm/lib/Target/Sparc/SparcRegisterInfo.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/SparcRegisterInfo.h b/llvm/lib/Target/Sparc/SparcRegisterInfo.h
index ae056cdcf29..503229d9bd1 100644
--- a/llvm/lib/Target/Sparc/SparcRegisterInfo.h
+++ b/llvm/lib/Target/Sparc/SparcRegisterInfo.h
@@ -34,6 +34,8 @@ struct SparcRegisterInfo : public SparcGenRegisterInfo {
const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
const uint32_t* getCallPreservedMask(CallingConv::ID CC) const;
+ const uint32_t* getRTCallPreservedMask(CallingConv::ID CC) const;
+
BitVector getReservedRegs(const MachineFunction &MF) const;
const TargetRegisterClass *getPointerRegClass(const MachineFunction &MF,
OpenPOWER on IntegriCloud