diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2016-11-29 16:50:32 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-11-29 16:50:33 -0500 |
commit | 6f7ed1e51bf360621a3c2a447045ab3012f68575 (patch) | |
tree | f6e047df820dce2a049ead7927c1b36e95b2bfdd /docs/users_guide/extending_ghc.rst | |
parent | 795f8bd460d604c792a5df8cfec937b2a74c3956 (diff) | |
download | haskell-6f7ed1e51bf360621a3c2a447045ab3012f68575.tar.gz |
Make globals use sharedCAF
The use of globals is quite painful when multiple rts are loaded, e.g.
when plugins are loaded, which bring in a second rts. The sharedCAF
appraoch was employed for the FastStringTable; I've taken the libery
to extend this to the other globals I could find.
Reviewers: rwbarton, simonmar, austin, hvr, erikd, bgamari
Reviewed By: simonmar, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2575
Diffstat (limited to 'docs/users_guide/extending_ghc.rst')
-rw-r--r-- | docs/users_guide/extending_ghc.rst | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst index 17d061ec3e..c02c93fac1 100644 --- a/docs/users_guide/extending_ghc.rst +++ b/docs/users_guide/extending_ghc.rst @@ -305,7 +305,6 @@ just returns the original compilation pipeline, unmodified, and says install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo] install _ todo = do - reinitializeGlobals putMsgS "Hello!" return todo @@ -314,16 +313,6 @@ cabal for instance,) you can then use it by just specifying ``-fplugin=DoNothing.Plugin`` on the command line, and during the compilation you should see GHC say 'Hello'. -Note carefully the ``reinitializeGlobals`` call at the beginning of the -installation function. Due to bugs in the windows linker dealing with -``libghc``, this call is necessary to properly ensure compiler plugins -have the same global state as GHC at the time of invocation. Without -``reinitializeGlobals``, compiler plugins can crash at runtime because -they may require state that hasn't otherwise been initialized. - -In the future, when the linking bugs are fixed, ``reinitializeGlobals`` -will be deprecated with a warning, and changed to do nothing. - .. _core-plugins-in-more-detail: Core plugins in more detail @@ -396,7 +385,6 @@ in a module it compiles: install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo] install _ todo = do - reinitializeGlobals return (CoreDoPluginPass "Say name" pass : todo) pass :: ModGuts -> CoreM ModGuts @@ -446,7 +434,6 @@ will print out the name of any top-level non-recursive binding with the install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo] install _ todo = do - reinitializeGlobals return (CoreDoPluginPass "Say name" pass : todo) pass :: ModGuts -> CoreM ModGuts |