Strictness tweaks
authorIan Lynagh <igloo@earth.li>
Fri, 25 Jan 2008 17:43:47 +0000 (17:43 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 25 Jan 2008 17:43:47 +0000 (17:43 +0000)
compiler/Makefile
compiler/basicTypes/SrcLoc.lhs

index a7d8452..0d866f6 100644 (file)
@@ -597,7 +597,7 @@ endif
 
 utils/Digraph_HC_OPTS          = -fglasgow-exts 
 
-basicTypes/SrcLoc_HC_OPTS      = -funbox-strict-fields
+# basicTypes/SrcLoc_HC_OPTS    = -funbox-strict-fields
 
 # We always optimise some low-level modules, otherwise performance of
 # a non-optimised compiler is severely affected.
index d2df86b..cf68b79 100644 (file)
@@ -57,8 +57,8 @@ this is the obvious stuff:
 \begin{code}
 data SrcLoc
   = SrcLoc     FastString      -- A precise location (file name)
-               !Int            -- line number, begins at 1
-               !Int            -- column number, begins at 0
+               {-# UNPACK #-} !Int             -- line number, begins at 1
+               {-# UNPACK #-} !Int             -- column number, begins at 0
                -- Don't ask me why lines start at 1 and columns start at
                -- zero.  That's just the way it is, so there.  --SDM
 
@@ -167,27 +167,27 @@ span of (1,1)-(1,1) is zero characters long.
 -}
 data SrcSpan
   = SrcSpanOneLine             -- a common case: a single line
-       { srcSpanFile     :: FastString,
-         srcSpanLine     :: !Int,
-         srcSpanSCol     :: !Int,
-         srcSpanECol     :: !Int
+       { srcSpanFile     :: !FastString,
+         srcSpanLine     :: {-# UNPACK #-} !Int,
+         srcSpanSCol     :: {-# UNPACK #-} !Int,
+         srcSpanECol     :: {-# UNPACK #-} !Int
        }
 
   | SrcSpanMultiLine
-       { srcSpanFile     :: FastString,
-         srcSpanSLine    :: !Int,
-         srcSpanSCol     :: !Int,
-         srcSpanELine    :: !Int,
-         srcSpanECol     :: !Int
+       { srcSpanFile     :: !FastString,
+         srcSpanSLine    :: {-# UNPACK #-} !Int,
+         srcSpanSCol     :: {-# UNPACK #-} !Int,
+         srcSpanELine    :: {-# UNPACK #-} !Int,
+         srcSpanECol     :: {-# UNPACK #-} !Int
        }
 
   | SrcSpanPoint
-       { srcSpanFile     :: FastString,
-         srcSpanLine     :: !Int,
-         srcSpanCol      :: !Int
+       { srcSpanFile     :: !FastString,
+         srcSpanLine     :: {-# UNPACK #-} !Int,
+         srcSpanCol      :: {-# UNPACK #-} !Int
        }
 
-  | UnhelpfulSpan FastString   -- Just a general indication
+  | UnhelpfulSpan !FastString  -- Just a general indication
                                -- also used to indicate an empty span
 
 #ifdef DEBUG