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
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))
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