summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CgForeignCall.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-08-07 02:37:46 +0100
committerIan Lynagh <ian@well-typed.com>2012-08-07 02:37:46 +0100
commit46b5c197f9f2c8ed012251289400fbc7189b1acb (patch)
tree2c7dff6a0683de10b48bbb11e9eda60ec6c1e227 /compiler/codeGen/CgForeignCall.hs
parentf917eeb824cfb7143dde9b12e501d4ddb0049b65 (diff)
downloadhaskell-46b5c197f9f2c8ed012251289400fbc7189b1acb.tar.gz
Define callerSaves for all platforms
This means that we now generate the same code whatever platform we are on, which should help avoid changes on one platform breaking the build on another. It's also another step towards full cross-compilation.
Diffstat (limited to 'compiler/codeGen/CgForeignCall.hs')
-rw-r--r--compiler/codeGen/CgForeignCall.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/codeGen/CgForeignCall.hs b/compiler/codeGen/CgForeignCall.hs
index 4a83d86592..a37245ea01 100644
--- a/compiler/codeGen/CgForeignCall.hs
+++ b/compiler/codeGen/CgForeignCall.hs
@@ -125,21 +125,23 @@ emitForeignCall'
-> Code
emitForeignCall' safety results target args vols _srt ret
| not (playSafe safety) = do
+ dflags <- getDynFlags
temp_args <- load_args_into_temps args
- let (caller_save, caller_load) = callerSaveVolatileRegs vols
+ let (caller_save, caller_load) = callerSaveVolatileRegs dflags vols
let caller_load' = if ret == CmmNeverReturns then [] else caller_load
stmtsC caller_save
stmtC (CmmCall target results temp_args ret)
stmtsC caller_load'
| otherwise = do
+ dflags <- getDynFlags
-- Both 'id' and 'new_base' are GCKindNonPtr because they're
-- RTS only objects and are not subject to garbage collection
id <- newTemp bWord
new_base <- newTemp (cmmRegType (CmmGlobal BaseReg))
temp_args <- load_args_into_temps args
temp_target <- load_target_into_temp target
- let (caller_save, caller_load) = callerSaveVolatileRegs vols
+ let (caller_save, caller_load) = callerSaveVolatileRegs dflags vols
emitSaveThreadState
stmtsC caller_save
-- The CmmUnsafe arguments are only correct because this part