-----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.32 2000/11/20 13:39:26 sewardj Exp $
+-- $Id: DriverPipeline.hs,v 1.33 2000/11/20 17:42:00 sewardj Exp $
--
-- GHC Driver
--
HscFail pcs -> throwDyn (PhaseFailed "hsc" (ExitFailure 1));
- HscOK details maybe_iface maybe_stub_h maybe_stub_c
- _maybe_interpreted_code pcs -> do
+ HscNoRecomp pcs details iface -> return False;
+
+ HscRecomp pcs details iface maybe_stub_h maybe_stub_c
+ _maybe_interpreted_code -> do
-- deal with stubs
maybe_stub_o <- dealWithStubs basename maybe_stub_h maybe_stub_c
Nothing -> return ()
Just stub_o -> add v_Ld_inputs stub_o
- let keep_going = case maybe_iface of Just _ -> True; Nothing -> False
- return keep_going
+ return True
}
-----------------------------------------------------------------------------
-> IO CompResult
data CompResult
- = CompOK ModDetails -- new details (HST additions)
- (Maybe (ModIface, Linkable))
- -- summary and code; Nothing => compilation not reqd
- -- (old summary and code are still valid)
- PersistentCompilerState -- updated PCS
+ = CompOK PersistentCompilerState -- updated PCS
+ ModDetails -- new details (HST additions)
+ ModIface -- new iface (HIT additions)
+ (Maybe Linkable)
+ -- new code; Nothing => compilation was not reqd
+ -- (old code is still valid)
| CompErrs PersistentCompilerState -- updated PCS
source_unchanged
location old_iface hst hit pcs
- case hsc_result of {
- HscFail pcs -> return (CompErrs pcs);
+ case hsc_result of
+ HscFail pcs -> return (CompErrs pcs)
- HscOK details maybe_iface
- maybe_stub_h maybe_stub_c maybe_interpreted_code pcs -> do
-
- -- if no compilation happened, bail out early
- case maybe_iface of {
- Nothing -> return (CompOK details Nothing pcs);
- Just iface -> do
+ HscNoRecomp pcs details iface -> return (CompOK pcs details iface Nothing)
+ HscRecomp pcs details iface
+ maybe_stub_h maybe_stub_c maybe_interpreted_code -> do
+
let (basename, _) = splitFilename input_fn
maybe_stub_o <- dealWithStubs basename maybe_stub_h maybe_stub_c
let stub_unlinked = case maybe_stub_o of
let linkable = LM unlinked_time (moduleName (ms_mod summary))
(hs_unlinked ++ stub_unlinked)
- return (CompOK details (Just (iface, linkable)) pcs)
- }
- }
+ return (CompOK pcs details iface (Just linkable))
+
-----------------------------------------------------------------------------
-- stub .h and .c files (for foreign export support)