cvs commit: fptools/ghc Makefile fptools/ghc/compiler Makefile
package.conf.in fptools/ghc/compiler/ghci Linker.lhs
fptools/ghc/compiler/main CmdLineOpts.lhs DriverFlags.hs
fptools/ghc/compiler/plugins Plugins.hs fptools/ghc/compiler/simplCore ...
sseefried at haskell.org
sseefried at haskell.org
Fri Dec 31 01:48:23 EST 2004
sseefried 2004/12/30 22:48:23 PST
Modified files: (Branch: pluggable-1-branch)
ghc Makefile
ghc/compiler Makefile package.conf.in
ghc/compiler/ghci Linker.lhs
ghc/compiler/main CmdLineOpts.lhs DriverFlags.hs
ghc/compiler/simplCore SimplCore.lhs SimplMonad.lhs
SimplUtils.lhs Simplify.lhs
Added files: (Branch: pluggable-1-branch)
ghc/compiler/plugins Plugins.hs
ghc/core-plugins CorePlugins.hs Makefile package.conf.in
Log:
Prototype of pluggable compiler. It is now possible to plug-in custom
Core-to-Core passes to the compiler. The plug-ins reside in a package
called `core-plugins' which should export a function called
corePasses :: [CorePass] where:
type CorePass = HscEnv -> UniqSupply -> RuleBase
-> ModGuts -> IO (SimplCount, RuleBase, ModGuts)
Previously in simplcore/SimplCore.lhs there existed a function called
doCorePass which took as on of its arguments a data structure called
CoreToDo (which was defined in main/CmdLineOpts.lhs). This data
structure existed so that passes could be scheduled on the command
line, however despite its existence there appeared to be no way to set
passes from the command line in GHC anymore. We have now removed
doCorePass and the CoreToDo data structure in favour of an approach in
which a list of functions of type CorePass are executed. buildCoreToDo
(oringally defined in main/CmdLineOpts.lhs but now in
simplCore/SimplCore.lhs) works much the same as it used to but now it
produces a [CorePass] instead of [CoreToDo].
Package ghc is no longer optionally built. It is always built in
stage 2. So is package core-plugins which resides in directory
fptools/ghc/core-plugins. The way that package core-plugins works is
curious. It is build by bring package ghc into scope but the
package.conf.in does *not* define package ghc as a dependency. The
simple reason for this is that the symbols are already in the compiled
ghc! However, as a result of this you *cannot* run strip on ghc and
expect core plugins to continue working. This will necessitate some
changes to the Makefiles which has not yet been done.
This version of GHC cannot yet be installed. It must be used in-place.
Revision Changes Path
1.26.4.1 +4 -2 fptools/ghc/Makefile
1.274.4.1 +9 -7 fptools/ghc/compiler/Makefile
1.5.4.1 +306 -43 fptools/ghc/compiler/package.conf.in
1.46.4.1 +1 -1 fptools/ghc/compiler/ghci/Linker.lhs
1.193.4.1 +7 -179 fptools/ghc/compiler/main/CmdLineOpts.lhs
1.142.4.1 +2 -1 fptools/ghc/compiler/main/DriverFlags.hs
1.125.4.1 +200 -27 fptools/ghc/compiler/simplCore/SimplCore.lhs
1.58.4.1 +15 -3 fptools/ghc/compiler/simplCore/SimplMonad.lhs
1.93.4.1 +1 -2 fptools/ghc/compiler/simplCore/SimplUtils.lhs
1.152.4.1 +2 -3 fptools/ghc/compiler/simplCore/Simplify.lhs
More information about the Cvs-ghc
mailing list