summaryrefslogtreecommitdiff
path: root/compiler/iface
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-06-11 15:24:27 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-06-11 15:37:04 -0700
commitbac927b9770ff769128b66d13a3e72bf5a9bc514 (patch)
treedab91026af349d00b0ff352304091d17359c8d70 /compiler/iface
parent28e04de37151f05c35377ec74ac214d0cfa2f521 (diff)
downloadhaskell-bac927b9770ff769128b66d13a3e72bf5a9bc514.tar.gz
Revert "Support for multiple signature files in scope."
This reverts commit a7524eaed33324e2155c47d4a705bef1d70a2b5b.
Diffstat (limited to 'compiler/iface')
-rw-r--r--compiler/iface/LoadIface.hs18
-rw-r--r--compiler/iface/MkIface.hs18
2 files changed, 10 insertions, 26 deletions
diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs
index defaa91c14..c88ad143d4 100644
--- a/compiler/iface/LoadIface.hs
+++ b/compiler/iface/LoadIface.hs
@@ -297,17 +297,12 @@ loadSrcInterface_maybe doc mod want_boot maybe_pkg
-- interface; it will call the Finder again, but the ModLocation will be
-- cached from the first search.
= do { hsc_env <- getTopEnv
+ -- ToDo: findImportedModule should return a list of interfaces
; res <- liftIO $ findImportedModule hsc_env mod maybe_pkg
; case res of
- FoundModule (FoundHs { fr_mod = mod })
- -> fmap (fmap (:[]))
- . initIfaceTcRn
- $ loadInterface doc mod (ImportByUser want_boot)
- FoundSigs mods _backing
- -> initIfaceTcRn $ do
- ms <- forM mods $ \(FoundHs { fr_mod = mod }) ->
- loadInterface doc mod (ImportByUser want_boot)
- return (sequence ms)
+ Found _ mod -> fmap (fmap (:[]))
+ . initIfaceTcRn
+ $ loadInterface doc mod (ImportByUser want_boot)
err -> return (Failed (cannotFindInterface (hsc_dflags hsc_env) mod err)) }
-- | Load interface directly for a fully qualified 'Module'. (This is a fairly
@@ -772,7 +767,7 @@ findAndReadIface doc_str mod hi_boot_file
hsc_env <- getTopEnv
mb_found <- liftIO (findExactModule hsc_env mod)
case mb_found of
- FoundExact loc mod -> do
+ Found loc mod -> do
-- Found file, so read it
let file_path = addBootSuffix_maybe hi_boot_file
@@ -789,8 +784,7 @@ findAndReadIface doc_str mod hi_boot_file
traceIf (ptext (sLit "...not found"))
dflags <- getDynFlags
return (Failed (cannotFindInterface dflags
- (moduleName mod)
- (convFindExactResult err)))
+ (moduleName mod) err))
where read_file file_path = do
traceIf (ptext (sLit "readIFace") <+> text file_path)
read_result <- readIface mod file_path
diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs
index e897daa3b6..c1a9d2523f 100644
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -1335,20 +1335,9 @@ checkDependencies hsc_env summary iface
find_res <- liftIO $ findImportedModule hsc_env mod (fmap snd pkg)
let reason = moduleNameString mod ++ " changed"
case find_res of
- FoundModule h -> check_mod reason (fr_mod h)
- FoundSigs hs _backing -> check_mods reason (map fr_mod hs)
- _otherwise -> return (RecompBecause reason)
-
- check_mods _ [] = return UpToDate
- check_mods reason (m:ms) = do
- r <- check_mod reason m
- case r of
- UpToDate -> check_mods reason ms
- _otherwise -> return r
-
- check_mod reason mod
+ Found _ mod
| pkg == this_pkg
- = if moduleName mod `notElem` map fst prev_dep_mods
+ -> if moduleName mod `notElem` map fst prev_dep_mods
then do traceHiDiffs $
text "imported module " <> quotes (ppr mod) <>
text " not among previous dependencies"
@@ -1356,7 +1345,7 @@ checkDependencies hsc_env summary iface
else
return UpToDate
| otherwise
- = if pkg `notElem` (map fst prev_dep_pkgs)
+ -> if pkg `notElem` (map fst prev_dep_pkgs)
then do traceHiDiffs $
text "imported module " <> quotes (ppr mod) <>
text " is from package " <> quotes (ppr pkg) <>
@@ -1365,6 +1354,7 @@ checkDependencies hsc_env summary iface
else
return UpToDate
where pkg = modulePackageKey mod
+ _otherwise -> return (RecompBecause reason)
needInterface :: Module -> (ModIface -> IfG RecompileRequired)
-> IfG RecompileRequired