diff options
author | Austin Seipp <austin@well-typed.com> | 2013-09-22 18:47:35 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2013-09-22 18:47:38 -0500 |
commit | 6f799899aa7cd9c59c9ebf9c9709f9423d93d307 (patch) | |
tree | bed11393db25e594d9525471a01c69dd98a9b355 /compiler/iface | |
parent | ea2af9b21d6e772e3adc8806044557b504b84795 (diff) | |
download | haskell-6f799899aa7cd9c59c9ebf9c9709f9423d93d307.tar.gz |
Restructure compilation pipeline to allow hooks
This commit exposes GHC's internal compiler pipeline through a `Hooks`
module in the GHC API. It currently allows you to hook:
* Foreign import/exports declarations
* The frontend up to type checking
* The one shot compilation mode
* Core compilation, and the module iface
* Linking and the phases in DriverPhases.hs
* Quasiquotation
Authored-by: Luite Stegeman <stegeman@gmail.com>
Authored-by: Edsko de Vries <edsko@well-typed.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/iface')
-rw-r--r-- | compiler/iface/LoadIface.lhs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs index ac0b09c572..0fc8e68901 100644 --- a/compiler/iface/LoadIface.lhs +++ b/compiler/iface/LoadIface.lhs @@ -59,6 +59,7 @@ import Panic import Util import FastString import Fingerprint +import Hooks import Control.Monad import Data.IORef @@ -516,7 +517,9 @@ findAndReadIface doc_str mod hi_boot_file -- Check for GHC.Prim, and return its static interface if mod == gHC_PRIM - then return (Succeeded (ghcPrimIface, + then do + iface <- getHooked ghcPrimIfaceHook ghcPrimIface + return (Succeeded (iface, "<built in interface for GHC.Prim>")) else do dflags <- getDynFlags |