diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2022-02-23 17:37:57 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-25 21:15:24 -0500 |
commit | 929c280f991ee80ccf4fc1f451aa4c8a19113268 (patch) | |
tree | a9c6388fffb537453c7a07c046adb6b009338fd9 | |
parent | ad04953b0d28610c516ca897a0a9ee14577c3206 (diff) | |
download | haskell-929c280f991ee80ccf4fc1f451aa4c8a19113268.tar.gz |
Derive Enum instances for CCallConv and Safety
This is used by the JS backend for serialization.
-rw-r--r-- | compiler/GHC/Types/ForeignCall.hs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/GHC/Types/ForeignCall.hs b/compiler/GHC/Types/ForeignCall.hs index 1ad35af232..9ea0917fc5 100644 --- a/compiler/GHC/Types/ForeignCall.hs +++ b/compiler/GHC/Types/ForeignCall.hs @@ -71,7 +71,7 @@ data Safety -- * No blocking -- * No precise exceptions -- - deriving ( Eq, Show, Data ) + deriving ( Eq, Show, Data, Enum ) -- Show used just for Show Lex.Token, I think instance Outputable Safety where @@ -153,9 +153,14 @@ stdcall: Caller allocates parameters, callee deallocates. See: http://www.programmersheaven.com/2/Calling-conventions -} --- any changes here should be replicated in the CallConv type in template haskell -data CCallConv = CCallConv | CApiConv | StdCallConv | PrimCallConv | JavaScriptCallConv - deriving (Eq, Data) +-- any changes here should be replicated in the CallConv type in template haskell +data CCallConv + = CCallConv + | CApiConv + | StdCallConv + | PrimCallConv + | JavaScriptCallConv + deriving (Eq, Data, Enum) instance Outputable CCallConv where ppr StdCallConv = text "stdcall" |