From 0541722de4beb2e53058dbf4ed1ebf0d96ddd6cb Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Wed, 17 Jul 2013 23:50:51 +0000 Subject: PPC: Add base-pointer support to builtin setjmp/longjmp First, this changes the base-pointer implementation to remove an unnecessary complication (and one that is incompatible with how builtin SjLj is implemented): instead of using r31 as the base pointer when it is not needed as a frame pointer, now the base pointer will always be r30 when needed. Second, we introduce another pseudo register, BP, which is used just like the FP pseudo register to refer to the base register before we know for certain what register it will be. Third, we now save BP into the jmp_buf, and restore r30 from that slot in longjmp. If the function that called setjmp did not use a base pointer, then r30 will be overwritten by the setjmp-calling-function's restore code. FP restoration (which is restored into r31) works the same way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186545 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCFrameLowering.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/Target/PowerPC/PPCFrameLowering.h') diff --git a/lib/Target/PowerPC/PPCFrameLowering.h b/lib/Target/PowerPC/PPCFrameLowering.h index 9acf129..7aab37e 100644 --- a/lib/Target/PowerPC/PPCFrameLowering.h +++ b/lib/Target/PowerPC/PPCFrameLowering.h @@ -96,11 +96,7 @@ public: /// getBasePointerSaveOffset - Return the previous frame offset to save the /// base pointer. - static unsigned getBasePointerSaveOffset(bool isPPC64, bool isDarwinABI, - bool hasFP) { - if (!hasFP) - return getFramePointerSaveOffset(isPPC64, isDarwinABI); - + static unsigned getBasePointerSaveOffset(bool isPPC64, bool isDarwinABI) { if (isDarwinABI) return isPPC64 ? -16U : -8U; -- cgit v1.1