[project @ 2001-06-04 15:42:30 by qrczak]
[ghc-hetmet.git] / ghc / compiler / specialise / Rules.lhs
index 4e028e7..68cdeb7 100644 (file)
@@ -458,7 +458,7 @@ data RuleBase = RuleBase
                                -- Held as a set, so that it can simply be the initial
                                -- in-scope set in the simplifier
 
-                    IdSet      -- Ids (whether local or imported) mentioned on 
+                   IdSet       -- Ids (whether local or imported) mentioned on 
                                -- LHS of some rule; these should be black listed
 
        -- This representation is a bit cute, and I wonder if we should
@@ -483,7 +483,13 @@ extendRuleBase (RuleBase rule_ids rule_fvs) (id, rule)
             (rule_fvs `unionVarSet` extendVarSet lhs_fvs id)
   where
     new_id = setIdSpecialisation id (addRule old_rules id rule)
+
     old_rules = idSpecialisation (fromMaybe id (lookupVarSet rule_ids id))
+       -- Get the old rules from rule_ids if the Id is already there, but
+       -- if not, use the Id from the incoming rule.  If may be a PrimOpId,
+       -- in which case it may have rules in its belly already.  Seems
+       -- dreadfully hackoid.
+
     lhs_fvs = ruleLhsFreeIds rule
        -- Finds *all* the free Ids of the LHS, not just
        -- locally defined ones!!