Make TcUnify warning-free
[ghc-hetmet.git] / compiler / basicTypes / SrcLoc.lhs
index d2df86b..7e43251 100644 (file)
@@ -38,8 +38,6 @@ module SrcLoc (
         leftmost_smallest, leftmost_largest, rightmost, spans, isSubspanOf
     ) where
 
-#include "HsVersions.h"
-
 import Util
 import Outputable
 import FastString
@@ -57,8 +55,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
 
@@ -77,9 +75,9 @@ mkSrcLoc :: FastString -> Int -> Int -> SrcLoc
 mkSrcLoc x line col = SrcLoc x line col
 
 noSrcLoc, generatedSrcLoc, interactiveSrcLoc :: SrcLoc
-noSrcLoc         = UnhelpfulLoc FSLIT("<no location info>")
-generatedSrcLoc   = UnhelpfulLoc FSLIT("<compiler-generated code>")
-interactiveSrcLoc = UnhelpfulLoc FSLIT("<interactive session>")
+noSrcLoc         = UnhelpfulLoc (fsLit "<no location info>")
+generatedSrcLoc   = UnhelpfulLoc (fsLit "<compiler-generated code>")
+interactiveSrcLoc = UnhelpfulLoc (fsLit "<interactive session>")
 
 mkGeneralSrcLoc :: FastString -> SrcLoc
 mkGeneralSrcLoc = UnhelpfulLoc 
@@ -90,7 +88,7 @@ isGoodSrcLoc _other         = False
 
 srcLocFile :: SrcLoc -> FastString
 srcLocFile (SrcLoc fname _ _) = fname
-srcLocFile _other            = FSLIT("<unknown file")
+srcLocFile _other            = (fsLit "<unknown file")
 
 srcLocLine :: SrcLoc -> Int
 srcLocLine (SrcLoc _ l _) = l
@@ -167,27 +165,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
@@ -204,8 +202,8 @@ instance Ord SrcSpan where
      (srcSpanEnd   a `compare` srcSpanEnd   b)
 
 noSrcSpan, wiredInSrcSpan :: SrcSpan
-noSrcSpan      = UnhelpfulSpan FSLIT("<no location info>")
-wiredInSrcSpan = UnhelpfulSpan FSLIT("<wired into compiler>")
+noSrcSpan      = UnhelpfulSpan (fsLit "<no location info>")
+wiredInSrcSpan = UnhelpfulSpan (fsLit "<wired into compiler>")
 
 mkGeneralSrcSpan :: FastString -> SrcSpan
 mkGeneralSrcSpan = UnhelpfulSpan
@@ -313,7 +311,7 @@ combineSrcSpans     start end
 pprDefnLoc :: SrcSpan -> SDoc
 -- "defined at ..."
 pprDefnLoc loc
-  | isGoodSrcSpan loc = ptext SLIT("Defined at") <+> ppr loc
+  | isGoodSrcSpan loc = ptext (sLit "Defined at") <+> ppr loc
   | otherwise        = ppr loc
 
 instance Outputable SrcSpan where