[commit: ghc] master: Add dynamically-linked plugins (see Trac #3843) (592def0)
Simon Peyton Jones
simonpj at microsoft.com
Thu Jun 16 18:25:21 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/592def09c4f87f517b31aa4c4cec51fc8764a859
>---------------------------------------------------------------
commit 592def09c4f87f517b31aa4c4cec51fc8764a859
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Jun 16 17:22:47 2011 +0100
Add dynamically-linked plugins (see Trac #3843)
This patch was originally developed by Max Bolingbroke, and worked on
further by Austin Seipp. It allows you to write a Core-to-Core pass
and have it dynamically linked into an otherwise-unmodified GHC, and
run at a place you specify in the Core optimisation pipeline.
Main components:
- CoreMonad: new types Plugin, PluginPass
plus a new constructor CoreDoPluginPass in CoreToDo
- SimplCore: stuff to dynamically load any plugins, splice
them into the core-to-core pipeline, and invoke them
- Move "getCoreToDo :: DynFlags -> [CoreToDo]"
which constructs the main core-to-core pipeline
from CoreMonad to SimplCore
SimplCore is the driver for the optimisation pipeline, and it
makes more sense to have the pipeline construction in the driver
not in the infrastructure module.
- New module DynamicLoading: invoked by SimplCore to load any plugins
Some consequential changes in Linker.
- New module GhcPlugins: this should be imported by plugin modules; it
it not used by GHC itself.
compiler/basicTypes/Module.lhs | 4 +-
compiler/ghc.cabal.in | 2 +
compiler/ghci/Linker.lhs | 41 +++++-
compiler/main/DynFlags.hs | 23 +++
compiler/main/DynamicLoading.hs | 150 +++++++++++++++++++
compiler/main/GhcPlugins.hs | 83 +++++++++++
compiler/prelude/PrelNames.lhs | 18 +++
compiler/simplCore/CoreMonad.lhs | 261 +++++++++-------------------------
compiler/simplCore/SimplCore.lhs | 294 ++++++++++++++++++++++++++++++++++++--
9 files changed, 665 insertions(+), 211 deletions(-)
Diff suppressed because of size. To see it, use:
git show 592def09c4f87f517b31aa4c4cec51fc8764a859
More information about the Cvs-ghc
mailing list