summaryrefslogtreecommitdiff
path: root/libraries/template-haskell
diff options
context:
space:
mode:
authorLuite Stegeman <stegeman@gmail.com>2014-11-19 18:38:58 -0600
committerAustin Seipp <austin@well-typed.com>2014-11-19 19:49:42 -0600
commitc6e12e69fa348328d58540a1ea8abed35d0dda32 (patch)
treebbfb1d10d6dc70e339b01370ff08dbfd04d06de9 /libraries/template-haskell
parentbc2289e13d9586be087bd8136943dc35a0130c88 (diff)
downloadhaskell-c6e12e69fa348328d58540a1ea8abed35d0dda32.tar.gz
Make calling conventions in template haskell Syntax.hs consistent with those in ghc ForeignCall.hs
this impliments #9703 from ghc trac Test Plan: still needs tests Reviewers: cmsaperstein, ekmett, goldfire, austin Reviewed By: goldfire, austin Subscribers: goldfire, thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D353 GHC Trac Issues: #9703
Diffstat (limited to 'libraries/template-haskell')
-rw-r--r--libraries/template-haskell/Language/Haskell/TH.hs3
-rw-r--r--libraries/template-haskell/Language/Haskell/TH/Lib.hs9
-rw-r--r--libraries/template-haskell/Language/Haskell/TH/Syntax.hs3
3 files changed, 10 insertions, 5 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs
index e038a3ba6b..050ac85272 100644
--- a/libraries/template-haskell/Language/Haskell/TH.hs
+++ b/libraries/template-haskell/Language/Haskell/TH.hs
@@ -133,7 +133,8 @@ module Language.Haskell.TH(
newtypeInstD, tySynInstD,
typeFam, dataFam, tySynEqn,
-- **** Foreign Function Interface (FFI)
- cCall, stdCall, unsafe, safe, forImpD,
+ cCall, stdCall, cApi, prim, javaScript,
+ unsafe, safe, forImpD,
-- **** Pragmas
ruleVar, typedRuleVar,
pragInlD, pragSpecD, pragSpecInlD, pragSpecInstD, pragRuleD, pragAnnD,
diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib.hs b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
index efe597275b..bfba99a487 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Lib.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
@@ -638,9 +638,12 @@ inferR = InferR
-------------------------------------------------------------------------------
-- * Callconv
-cCall, stdCall :: Callconv
-cCall = CCall
-stdCall = StdCall
+cCall, stdCall, cApi, prim, javaScript :: Callconv
+cCall = CCall
+stdCall = StdCall
+cApi = CApi
+prim = Prim
+javaScript = JavaScript
-------------------------------------------------------------------------------
-- * Safety
diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
index 8c95045539..0e5ced9152 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -1250,7 +1250,8 @@ data Foreign = ImportF Callconv Safety String Name Type
| ExportF Callconv String Name Type
deriving( Show, Eq, Data, Typeable, Generic )
-data Callconv = CCall | StdCall
+-- keep Callconv in sync with module ForeignCall in ghc/compiler/prelude/ForeignCall.hs
+data Callconv = CCall | StdCall | CApi | Prim | JavaScript
deriving( Show, Eq, Data, Typeable, Generic )
data Safety = Unsafe | Safe | Interruptible