aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/ARMBaseRegisterInfo.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-08-03 00:05:53 +0000
committerEric Christopher <echristo@apple.com>2012-08-03 00:05:53 +0000
commite94ac8871a1ac79bece57335d2abece0feed9c02 (patch)
tree94ce9ea1213cfeeef7e972cfc1367a0aafcc576c /lib/Target/ARM/ARMBaseRegisterInfo.cpp
parent7b07d69958b865bb83500f0a8dc348a62969e7a8 (diff)
downloadexternal_llvm-e94ac8871a1ac79bece57335d2abece0feed9c02.zip
external_llvm-e94ac8871a1ac79bece57335d2abece0feed9c02.tar.gz
external_llvm-e94ac8871a1ac79bece57335d2abece0feed9c02.tar.bz2
Add support for the ARM GHC calling convention, this patch was in 3.0,
but somehow managed to be dropped later. Patch by Karel Gardas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161226 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMBaseRegisterInfo.cpp')
-rw-r--r--lib/Target/ARM/ARMBaseRegisterInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index 231bd26..9deb96e 100644
--- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -62,8 +62,20 @@ ARMBaseRegisterInfo::ARMBaseRegisterInfo(const ARMBaseInstrInfo &tii,
const uint16_t*
ARMBaseRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
+ bool ghcCall = false;
+
+ if (MF) {
+ const Function *F = MF->getFunction();
+ ghcCall = (F ? F->getCallingConv() == CallingConv::GHC : false);
+ }
+
+ if (ghcCall) {
+ return CSR_GHC_SaveList;
+ }
+ else {
return (STI.isTargetIOS() && !STI.isAAPCS_ABI())
? CSR_iOS_SaveList : CSR_AAPCS_SaveList;
+ }
}
const uint32_t*