summaryrefslogtreecommitdiff
path: root/compiler/main/DriverPhases.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-07-21 16:51:51 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-07-22 13:04:04 -0700
commit0b12aca09efd4c151a8c2682b7534bda9bdc99ad (patch)
treef8620d05c2285898ff35b03e218caf6e27fc36cc /compiler/main/DriverPhases.hs
parentcf57f8f9e9a649d7ffdfe0be09e503f6ed468a5d (diff)
downloadhaskell-0b12aca09efd4c151a8c2682b7534bda9bdc99ad.tar.gz
Switch from recording IsBootInterface to recording full HscSource.
Note: ModIface format change is BC, no need to recompile. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'compiler/main/DriverPhases.hs')
-rw-r--r--compiler/main/DriverPhases.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/main/DriverPhases.hs b/compiler/main/DriverPhases.hs
index 9d1199339a..ff6f8b8ab1 100644
--- a/compiler/main/DriverPhases.hs
+++ b/compiler/main/DriverPhases.hs
@@ -41,6 +41,7 @@ import {-# SOURCE #-} DynFlags
import Outputable
import Platform
import System.FilePath
+import Binary
-----------------------------------------------------------------------------
-- Phases
@@ -95,6 +96,17 @@ data HscSource
deriving( Eq, Ord, Show )
-- Ord needed for the finite maps we build in CompManager
+instance Binary HscSource where
+ put_ bh HsSrcFile = putByte bh 0
+ put_ bh HsBootFile = putByte bh 1
+ put_ bh HsigFile = putByte bh 2
+ get bh = do
+ h <- getByte bh
+ case h of
+ 0 -> return HsSrcFile
+ 1 -> return HsBootFile
+ _ -> return HsigFile
+
hscSourceString :: HscSource -> String
hscSourceString HsSrcFile = ""
hscSourceString HsBootFile = "[boot]"