diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-04-23 20:53:06 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-04-24 01:06:33 +0100 |
commit | be0b1dffb0a3aa73720b4de8887b837430bffcce (patch) | |
tree | d771a3eac2881c71eea1e687f4b4e4e38e1b3b9f /compiler/codeGen/StgCmmUtils.hs | |
parent | dbd964513941f1247ff6cbf28ad3154b229ecb00 (diff) | |
download | haskell-be0b1dffb0a3aa73720b4de8887b837430bffcce.tar.gz |
In CMM, only allow foreign calls to labels, not arbitrary expressions
I'm not sure if we want to make this change permanently, but for now it
fixes the unreg build.
I've also removed some redundant special-case code that generated
prototypes for foreign functions. The standard pprTempAndExternDecls
now generates them.
Diffstat (limited to 'compiler/codeGen/StgCmmUtils.hs')
-rw-r--r-- | compiler/codeGen/StgCmmUtils.hs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/codeGen/StgCmmUtils.hs b/compiler/codeGen/StgCmmUtils.hs index 3df75ceaa2..45b0f0c785 100644 --- a/compiler/codeGen/StgCmmUtils.hs +++ b/compiler/codeGen/StgCmmUtils.hs @@ -173,22 +173,21 @@ tagToClosure dflags tycon tag ------------------------------------------------------------------------- emitRtsCall :: PackageId -> FastString -> [(CmmExpr,ForeignHint)] -> Bool -> FCode () -emitRtsCall pkg fun args safe = emitRtsCallGen [] pkg fun args safe +emitRtsCall pkg fun args safe = emitRtsCallGen [] (mkCmmCodeLabel pkg fun) args safe emitRtsCallWithResult :: LocalReg -> ForeignHint -> PackageId -> FastString -> [(CmmExpr,ForeignHint)] -> Bool -> FCode () emitRtsCallWithResult res hint pkg fun args safe - = emitRtsCallGen [(res,hint)] pkg fun args safe + = emitRtsCallGen [(res,hint)] (mkCmmCodeLabel pkg fun) args safe -- Make a call to an RTS C procedure emitRtsCallGen :: [(LocalReg,ForeignHint)] - -> PackageId - -> FastString + -> CLabel -> [(CmmExpr,ForeignHint)] -> Bool -- True <=> CmmSafe call -> FCode () -emitRtsCallGen res pkg fun args safe +emitRtsCallGen res lbl args safe = do { dflags <- getDynFlags ; updfr_off <- getUpdFrameOff ; let (caller_save, caller_load) = callerSaveVolatileRegs dflags @@ -204,7 +203,7 @@ emitRtsCallGen res pkg fun args safe emit $ mkUnsafeCall (ForeignTarget fun_expr conv) res' args' (args', arg_hints) = unzip args (res', res_hints) = unzip res - fun_expr = mkLblExpr (mkCmmCodeLabel pkg fun) + fun_expr = mkLblExpr lbl ----------------------------------------------------------------------------- |