-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support ghc 9.10.1 (tested with alpha3)
- Loading branch information
Showing
9 changed files
with
165 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import: cabal.project | ||
|
||
-- ghc 9.10.1-alpha3 | ||
package * | ||
ghc-options: | ||
-package-db=/tmp/cabal-plugin-store/ghc-9.10.0.20240413/package.db | ||
-fplugin-trustworthy | ||
-plugin-package=trace-foreign-calls | ||
-fplugin=Plugin.TraceForeignCalls | ||
|
||
store-dir: /tmp/cabal-plugin-store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
trace-foreign-calls/src/Plugin/TraceForeignCalls/Util/Shim.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{-# LANGUAGE CPP #-} | ||
|
||
-- | GHC shim | ||
-- | ||
-- All CPP should live in this module. | ||
module Plugin.TraceForeignCalls.Util.Shim ( | ||
-- * Constructing the AST | ||
noAnnotation | ||
, originGenerated | ||
-- * Name resolution | ||
, modlCallStack | ||
, modlEvaluate | ||
, modlHasCallStack | ||
, modlPrettyCallStack | ||
, modlTraceEventIO | ||
, modlUnsafePerformIO | ||
) where | ||
|
||
import GHC | ||
import GHC.Plugins | ||
|
||
{------------------------------------------------------------------------------- | ||
Annotations | ||
-------------------------------------------------------------------------------} | ||
|
||
#if __GLASGOW_HASKELL__ >= 910 | ||
|
||
noAnnotation :: NoAnn a => a | ||
noAnnotation = noAnn | ||
|
||
#else | ||
|
||
class NoAnnotation a where | ||
noAnnotation :: a | ||
|
||
instance NoAnnotation (EpAnn a) where | ||
noAnnotation = EpAnnNotUsed | ||
|
||
#endif | ||
|
||
{------------------------------------------------------------------------------- | ||
Origin | ||
-------------------------------------------------------------------------------} | ||
|
||
originGenerated :: Origin | ||
#if __GLASGOW_HASKELL__ == 906 | ||
originGenerated = Generated | ||
#endif | ||
#if __GLASGOW_HASKELL__ == 908 | ||
originGenerated = Generated SkipPmc | ||
#endif | ||
#if __GLASGOW_HASKELL__ >= 910 | ||
originGenerated = Generated OtherExpansion SkipPmc | ||
#endif | ||
|
||
{------------------------------------------------------------------------------- | ||
Defining modules for various symbols | ||
-------------------------------------------------------------------------------} | ||
|
||
modlTraceEventIO :: Module | ||
modlTraceEventIO = | ||
#if __GLASGOW_HASKELL__ < 910 | ||
mkModule baseUnit $ mkModuleName "Debug.Trace" | ||
#else | ||
mkModule ghcInternalUnit $ mkModuleName "GHC.Internal.Debug.Trace" | ||
#endif | ||
|
||
modlEvaluate :: Module | ||
modlEvaluate = | ||
#if __GLASGOW_HASKELL__ < 910 | ||
mkModule baseUnit $ mkModuleName "GHC.IO" | ||
#else | ||
mkModule ghcInternalUnit $ mkModuleName "GHC.Internal.IO" | ||
#endif | ||
|
||
modlUnsafePerformIO :: Module | ||
modlUnsafePerformIO = | ||
#if __GLASGOW_HASKELL__ < 910 | ||
mkModule baseUnit $ mkModuleName "GHC.IO.Unsafe" | ||
#else | ||
mkModule ghcInternalUnit $ mkModuleName "GHC.Internal.IO.Unsafe" | ||
#endif | ||
|
||
modlHasCallStack :: Module | ||
modlHasCallStack = | ||
#if __GLASGOW_HASKELL__ < 910 | ||
mkModule baseUnit $ mkModuleName "GHC.Stack.Types" | ||
#else | ||
mkModule ghcInternalUnit $ mkModuleName "GHC.Internal.Stack.Types" | ||
#endif | ||
|
||
modlCallStack :: Module | ||
modlCallStack = | ||
#if __GLASGOW_HASKELL__ < 910 | ||
mkModule baseUnit $ mkModuleName "GHC.Stack" | ||
#else | ||
mkModule ghcInternalUnit $ mkModuleName "GHC.Internal.Stack" | ||
#endif | ||
|
||
modlPrettyCallStack :: Module | ||
modlPrettyCallStack = | ||
#if __GLASGOW_HASKELL__ < 910 | ||
mkModule baseUnit $ mkModuleName "GHC.Exception" | ||
#else | ||
mkModule ghcInternalUnit $ mkModuleName "GHC.Internal.Stack" | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters