summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
af62173)
Take the timestamp of an interpreted linkable from the timestamp of
the source file. This works better when the local clock is out of
sync with the filesystem, and it's just as accurate.
| otherwise = False
compresult <- compile hsc_env_strictDC this_mod location
| otherwise = False
compresult <- compile hsc_env_strictDC this_mod location
- source_unchanged have_object mb_old_iface
+ (ms_hs_date summary1)
+ source_unchanged have_object mb_old_iface
import EXCEPTION
import DATA_IOREF ( readIORef, writeIORef )
import EXCEPTION
import DATA_IOREF ( readIORef, writeIORef )
-#ifdef GHCI
-import Time ( getClockTime )
-#endif
+import Time ( ClockTime )
import Directory
import System
import IO
import Directory
import System
import IO
compile :: HscEnv
-> Module
-> ModLocation
compile :: HscEnv
-> Module
-> ModLocation
+ -> ClockTime -- timestamp of original source file
-> Bool -- True <=> source unchanged
-> Bool -- True <=> have object
-> Maybe ModIface -- old interface, if available
-> Bool -- True <=> source unchanged
-> Bool -- True <=> have object
-> Maybe ModIface -- old interface, if available
-compile hsc_env this_mod location
+compile hsc_env this_mod location src_timestamp
source_unchanged have_object
old_iface = do
source_unchanged have_object
old_iface = do
HscInterpreted ->
case maybe_interpreted_code of
#ifdef GHCI
HscInterpreted ->
case maybe_interpreted_code of
#ifdef GHCI
- Just comp_bc -> do tm <- getClockTime
- return ([BCOs comp_bc], tm)
+ Just comp_bc -> return ([BCOs comp_bc], src_timestamp)
+ -- Why do we use the timestamp of the source file here,
+ -- rather than the current time? This works better in
+ -- the case where the local clock is out of sync
+ -- with the filesystem's clock. It's just as accurate:
+ -- if the source is modified, then the linkable will
+ -- be out of date.
#endif
Nothing -> panic "compile: no interpreted code"
#endif
Nothing -> panic "compile: no interpreted code"