diff options
author | Duncan Coutts <duncan@well-typed.com> | 2009-06-09 10:44:03 +0000 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2009-06-09 10:44:03 +0000 |
commit | 71aa4a4723e95b4f27fccf93dcc0a33000010974 (patch) | |
tree | 50078c1808ad34d93559cb775c43936858814f5f /compiler | |
parent | bfd8d9ef58415debd7c5ae566902b8bfe1a92b74 (diff) | |
download | haskell-71aa4a4723e95b4f27fccf93dcc0a33000010974.tar.gz |
Add new FFI calling convention "prim"
First in a series of patches to add the feature.
This patch just adds PrimCallConv to the CCallConv type.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/prelude/ForeignCall.lhs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/prelude/ForeignCall.lhs b/compiler/prelude/ForeignCall.lhs index cae46be532..015b28e2fe 100644 --- a/compiler/prelude/ForeignCall.lhs +++ b/compiler/prelude/ForeignCall.lhs @@ -134,7 +134,7 @@ platforms. See: http://www.programmersheaven.com/2/Calling-conventions \begin{code} -data CCallConv = CCallConv | StdCallConv | CmmCallConv +data CCallConv = CCallConv | StdCallConv | CmmCallConv | PrimCallConv deriving (Eq) {-! derive: Binary !-} @@ -142,6 +142,7 @@ instance Outputable CCallConv where ppr StdCallConv = ptext (sLit "stdcall") ppr CCallConv = ptext (sLit "ccall") ppr CmmCallConv = ptext (sLit "C--") + ppr PrimCallConv = ptext (sLit "prim") defaultCCallConv :: CCallConv defaultCCallConv = CCallConv @@ -332,11 +333,14 @@ instance Binary CCallConv where putByte bh 0 put_ bh StdCallConv = do putByte bh 1 + put_ bh PrimCallConv = do + putByte bh 2 get bh = do h <- getByte bh case h of 0 -> do return CCallConv - _ -> do return StdCallConv + 1 -> do return StdCallConv + _ -> do return PrimCallConv instance Binary DNCallSpec where put_ bh (DNCallSpec isStatic kind ass nm _ _) = do |