[project @ 2001-08-20 14:10:02 by simonmar]
[ghc-hetmet.git] / ghc / compiler / basicTypes / Var.lhs
index 062767a..2362229 100644 (file)
@@ -77,7 +77,7 @@ data Var
 
 data VarDetails
   = LocalId            -- Used for locally-defined Ids (see NOTE below)
-       LocalIdDetails  -- True <=> exported; don't discard even if dead
+       LocalIdDetails
 
   | GlobalId           -- Used for imported Ids, dict selectors etc
        GlobalIdDetails
@@ -104,6 +104,8 @@ LocalId and GlobalId
 A GlobalId is
   * always a constant (top-level)
   * imported, or data constructor, or primop, or record selector
+  * has a Unique that is globally unique across the whole
+    GHC invocation (a single invocation may compile multiple modules)
 
 A LocalId is 
   * bound within an expression (lambda, case, local let(rec))
@@ -353,10 +355,12 @@ isGlobalId var = case varDetails var of
                   GlobalId _ -> True
                   other      -> False
 
+-- isExportedId means "don't throw this away"
 isExportedId var = case varDetails var of
-                       LocalId Exported -> True
-                       GlobalId _       -> True
-                       other            -> False
+                       LocalId Exported   -> True
+                       LocalId SpecPragma -> True
+                       GlobalId _         -> True
+                       other              -> False
 
 isSpecPragmaId var = case varDetails var of
                        LocalId SpecPragma -> True