diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-08-06 15:35:32 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-08-06 15:35:32 +0000 |
commit | 55e958746901ef8c04f370e746a7538137d0bcf8 (patch) | |
tree | 2d23220ec2267d39dbb9cdd9e23cb630ee35980c /include/llvm | |
parent | e52e9d60456073dddd691ae94c09b790f4bc26d5 (diff) | |
download | external_llvm-55e958746901ef8c04f370e746a7538137d0bcf8.zip external_llvm-55e958746901ef8c04f370e746a7538137d0bcf8.tar.gz external_llvm-55e958746901ef8c04f370e746a7538137d0bcf8.tar.bz2 |
Fix eabi calling convention when a 64 bit value shadows r3.
Without this what was happening was:
* R3 is not marked as "used"
* ARM backend thinks it has to save it to the stack because of vaarg
* Offset computation correctly ignores it
* Offsets are wrong
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/CallingConvLower.h | 6 | ||||
-rw-r--r-- | include/llvm/Target/TargetCallingConv.td | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/CallingConvLower.h b/include/llvm/CodeGen/CallingConvLower.h index 7911907..6fb8436 100644 --- a/include/llvm/CodeGen/CallingConvLower.h +++ b/include/llvm/CodeGen/CallingConvLower.h @@ -275,6 +275,12 @@ public: return Result; } + /// Version of AllocateStack with extra register to be shadowed. + unsigned AllocateStack(unsigned Size, unsigned Align, unsigned ShadowReg) { + MarkAllocated(ShadowReg); + return AllocateStack(Size, Align); + } + // HandleByVal - Allocate a stack slot large enough to pass an argument by // value. The size and alignment information of the argument is encoded in its // parameter attribute. diff --git a/include/llvm/Target/TargetCallingConv.td b/include/llvm/Target/TargetCallingConv.td index ceaeb0b..35b6482 100644 --- a/include/llvm/Target/TargetCallingConv.td +++ b/include/llvm/Target/TargetCallingConv.td @@ -89,6 +89,13 @@ class CCAssignToStack<int size, int align> : CCAction { int Align = align; } +/// CCAssignToStackWithShadow - Same as CCAssignToStack, but with a register +/// to be shadowed. +class CCAssignToStackWithShadow<int size, int align, Register reg> : + CCAssignToStack<size, align> { + Register ShadowReg = reg; +} + /// CCPassByVal - This action always matches: it assigns the value to a stack /// slot to implement ByVal aggregate parameter passing. Size and alignment /// specify the minimum size and alignment for the stack slot. |