1. 02 Jul, 2006 1 commit
    • Jan Rochel's avatar
      Add %local-tag to external core output · 99bab7d8
      Jan Rochel authored
      Hello, this is my first patch contributed to GHC. If there are any
      inadequacies about it (maybe like this introductory disclaimer), please
      let me know about it.
      
      So, the need for this patch arose, while I was involved with processing
      hcr files (external core output) and I noticed, that the output didn't
      fully conform to the specification [1].
      No %local-tags were used, which turned out to be a real nuisance as it
      was not possible to determine which VDEFs can be erased in a further
      optimization process and which ones are exported by the module.
      
      Since the specification does not define the meaning of the %local-tag, I
      assume, it makes sense, that it tags all functions, that are not
      exported by the module.
      
      The patch does not fully comply to the specification, as in my
      implementation a local tag may appear before a VDEF but not before a
      VDEFG.
      
      [1] An External Representation for the GHC Core Language
          (DRAFT for GHC5.02), page 3, line 1
      
      Greetings
      Jan
      99bab7d8
  2. 03 Jul, 2006 1 commit
  3. 04 Jul, 2006 1 commit
  4. 03 Jul, 2006 1 commit
    • simonpj@microsoft.com's avatar
      The dict-bindings in an IPBinds need not be in dependency order · 5c9c3660
      simonpj@microsoft.com authored
      This appears to be a long-standing bug, discovered by BlueSpec 
      (ravi@bluespec.com), Trac bug #795
      
      The problem was that in an IP binding group, the dict bindings
      aren't necessarily in dependency order; and if they aren't 
      we get a core-lint error.
      
      Test tc203 checks this case.  (Though whether it shows up at
      all depends a bit on accidental factors of binding ordering.)
      5c9c3660
  5. 04 Jul, 2006 1 commit
  6. 29 Jun, 2006 11 commits
  7. 23 Jun, 2006 1 commit
  8. 20 Jun, 2006 8 commits
  9. 29 Jun, 2006 1 commit
  10. 27 Jun, 2006 3 commits
  11. 26 Jun, 2006 3 commits
    • simonpj@microsoft.com's avatar
      More SpecConstr tuning · b5f43414
      simonpj@microsoft.com authored
      For some reason, SpecConstr wasn't taking account of let-bound constructors:
      	let v = Just 4
      	in ...(f v)...
      
      Now it does.  An easy fix fortunately.
      b5f43414
    • simonpj@microsoft.com's avatar
      Improve consistency checking for derived instances · 7f0ce617
      simonpj@microsoft.com authored
      This patch arranges that derived instances use the same instance-decl
      checking code as user-defined instances.  That gives greater consistency
      in error messages.
      
      Furthermore, the error description if this consistency check fails is now
      much more explicit.  For example, drvfail003 now says
           Variable occurs more often in a constraint than in the instance head
             in the constraint: Show (v (v a))
           (Use -fallow-undecidable-instances to permit this)
           In the derived instance
             instance (Show (v (v a))) => Show (Square_ v w a)
      7f0ce617
    • simonpj@microsoft.com's avatar
      7f546581
  12. 14 Jun, 2006 1 commit
  13. 25 Jun, 2006 1 commit
  14. 24 Jun, 2006 1 commit
    • simonpj@microsoft.com's avatar
      Improve RULE matching a bit more · 7d44782f
      simonpj@microsoft.com authored
      Consider this example (provided by Roman)
      
      	foo :: Int -> Maybe Int -> Int
      	foo 0 (Just n) = n
      	foo m (Just n) = foo (m-n) (Just n)
      
      SpecConstr sees this fragment:
      
      	case w_smT of wild_Xf [Just A] {
      	  Data.Maybe.Nothing -> lvl_smf;
      	  Data.Maybe.Just n_acT [Just S(L)] ->
      	    case n_acT of wild1_ams [Just A] { GHC.Base.I# y_amr [Just L] ->
      	    $wfoo_smW (GHC.Prim.-# ds_Xmb y_amr) wild_Xf
      	    }};
      
      and correctly generates the rule
      
      	RULES: "SC:$wfoo1" [0] __forall {y_amr [Just L] :: GHC.Prim.Int#
      					  sc_snn :: GHC.Prim.Int#}
      	  $wfoo_smW sc_snn (Data.Maybe.Just @ GHC.Base.Int (GHC.Base.I# y_amr))
      	  = $s$wfoo_sno y_amr sc_snn ;]
      
      BUT we must ensure that this rule matches in the original function!
      Note that the call to $wfoo is
      	    $wfoo_smW (GHC.Prim.-# ds_Xmb y_amr) wild_Xf
      
      During matching we expand wild_Xf to (Just n_acT).  But then we must also
      expand n_acT to (I# y_amr).  And we can only do that if we look up n_acT
      in the in-scope set, because in wild_Xf's unfolding it won't have an unfolding
      at all. 
      
      Happily, fixing the bug is easy: add a call to 'lookupRnInScope' in the 
      (Var v2) case of 'match'.
      7d44782f
  15. 23 Jun, 2006 2 commits
  16. 22 Jun, 2006 2 commits
  17. 21 Jun, 2006 1 commit