X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FFinder.lhs;h=56929ce24b2bf73e1b2c299ffb807847483274e5;hb=8a2809c29de9f23eba7ca682b48390033a9d40f6;hp=1f047fa8d01bf42ea913caeb350f6b1c9f04bd4e;hpb=26637fd8651f55fd424f3f6190220335ab5b80e9;p=ghc-hetmet.git diff --git a/compiler/main/Finder.lhs b/compiler/main/Finder.lhs index 1f047fa..56929ce 100644 --- a/compiler/main/Finder.lhs +++ b/compiler/main/Finder.lhs @@ -37,13 +37,12 @@ import FiniteMap import UniqFM import Maybes ( expectJust ) -import DATA_IOREF ( IORef, writeIORef, readIORef, modifyIORef ) - +import Data.IORef ( IORef, writeIORef, readIORef, modifyIORef ) import Data.List import System.Directory import System.IO import Control.Monad -import Time ( ClockTime ) +import System.Time ( ClockTime ) type FileExt = String -- Filename extension @@ -244,6 +243,14 @@ findHomeModule hsc_env mod_name = exts | isOneShot (ghcMode dflags) = hi_exts | otherwise = source_exts in + + -- special case for GHC.Prim; we won't find it in the filesystem. + -- This is important only when compiling the base package (where GHC.Prim + -- is a home module). + if mod == gHC_PRIM + then return (Found (error "GHC.Prim ModLocation") mod) + else + searchPathExts home_path mod exts