[project @ 2001-12-11 11:47:00 by simonmar]
[ghc-hetmet.git] / ghc / compiler / basicTypes / Name.lhs
index 303e0c7..c47d480 100644 (file)
@@ -52,11 +52,15 @@ import Outputable
 \begin{code}
 data Name = Name {
                n_sort :: NameSort,     -- What sort of name it is
-               n_occ  :: OccName,      -- Its occurrence name
+               n_occ  :: !OccName,     -- Its occurrence name
                n_uniq :: Unique,
-               n_loc  :: SrcLoc        -- Definition site
+               n_loc  :: !SrcLoc       -- Definition site
            }
 
+-- NOTE: we make the n_loc field strict to eliminate some potential
+-- (and real!) space leaks, due to the fact that we don't look at
+-- the SrcLoc in a Name all that often.
+
 data NameSort
   = Global Module      -- (a) TyCon, Class, their derived Ids, dfun Id
                        -- (b) Imported Id
@@ -300,8 +304,8 @@ pprLocal sty uniq occ
 -- Like Local, except that we only omit the unique in Iface style
 pprSysLocal sty uniq occ
   | codeStyle sty  = pprUnique uniq
-  | ifaceStyle sty = pprOccName occ    -- The tidy phase has ensured that OccNames
-                                       -- are enough
+  | ifaceStyle sty = pprOccName occ    -- The tidy phase has ensured 
+                                       -- that OccNames are enough
   | otherwise     = pprOccName occ <> char '_' <> pprUnique uniq
                                -- If the tidy phase hasn't run, the OccName
                                -- is unlikely to be informative (like 's'),