1. 12 Feb, 2017 4 commits
    • Edward Z. Yang's avatar
      Fix #13214 by correctly setting up dep_orphs for signatures. · 26eaa7ec
      Edward Z. Yang authored
      
      
      Prior to this, I hadn't thought about orphan handling at all.
      This commit implements the semantics that if a signature
      (transitively) imports an orphan instance, that instance
      is considered in scope no matter what the implementing module
      is.  (As it turns out, this is the semantics that falls out
      when orphans are recorded transitively.)
      
      This patch fixes a few bugs:
      
      1. Put semantic modules in dep_orphs rather than identity
         modules.
      2. Don't put the implementing module in dep_orphs when
         merging signatures (this is a silly bug that happened
         because we were reusing calculateAvails, which is
         designed for imports. It mostly works for signature
         merging, except this case.)
      3. When renaming a signature, blast in the orphans of the
         implementing module inside Dependencies.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3095
      26eaa7ec
    • Joachim Breitner's avatar
      Improve the Occurrence Analyzer’s handling of one-shot functions · a1980ecb
      Joachim Breitner authored
      When determining whether an expression is used saturatedly, count the
      number of value arguments that the occurrence analyser sees, and add
      the number of one-shot arguments that we know (from the strictness
      analyser) are passed from the context.
      
      perf results suggest no noticable change in allocations, reduction of
      code sizes, and performance regression possibliy due to loss of join
      points.
      
      Test Plan: perf.haskell.org
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3089
      a1980ecb
    • rwbarton's avatar
      Mark orphan instances and rules in --show-iface output · 17b1e0ba
      rwbarton authored
      Test Plan: new test Orphans
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3086
      17b1e0ba
    • Ben Gamari's avatar
      Dwarf.Types: Use DW_CFA_same_value encoding when possible · 7fac7cdc
      Ben Gamari authored
      This is a bit smaller than the alternative, DW_CFA_val_expression. Also
      a bit of refactoring.
      
      Test Plan: Validate
      
      Reviewers: scpmw, simonmar, austin
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2745
      7fac7cdc
  2. 11 Feb, 2017 1 commit
  3. 10 Feb, 2017 6 commits
    • Ryan Scott's avatar
      Refactor DeriveAnyClass's instance context inference · 639e702b
      Ryan Scott authored
      Summary:
      Currently, `DeriveAnyClass` has two glaring flaws:
      
      * It only works on classes whose argument is of kind `*` or `* -> *` (#9821).
      * The way it infers constraints makes no sense. It basically co-opts the
        algorithms used to infer contexts for `Eq` (for `*`-kinded arguments) or
        `Functor` (for `(* -> *)`-kinded arguments). This tends to produce overly
        constrained instances, which in extreme cases can lead to legitimate things
        failing to typecheck (#12594). Or even worse, it can trigger GHC panics
        (#12144 and #12423).
      
      This completely reworks the way `DeriveAnyClass` infers constraints to fix
      these two issues. It now uses the type signatures of the derived class's
      methods to infer constraints (and to simplify them). A high-level description
      of how this works is included in the GHC users' guide, and more technical notes
      on what is going on can be found as comments (and a Note) in `TcDerivInfer`.
      
      Fixes #9821, #12144, #12423, #12594.
      
      Test Plan: ./validate
      
      Reviewers: dfeuer, goldfire, simonpj, austin, bgamari
      
      Subscribers: dfeuer, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2961
      639e702b
    • Facundo Domínguez's avatar
      Relax test TH_addCStub2 so it succeeds on travis. · e79ef75d
      Facundo Domínguez authored
      Test Plan: ./validate
      
      Reviewers: bgamari, nomeata, austin, mpickering
      
      Reviewed By: mpickering
      
      Subscribers: mpickering, rwbarton, mboes, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3124
      e79ef75d
    • Ryan Scott's avatar
      Prevent Template Haskell splices from throwing a spurious TypeInType error · 283a3465
      Ryan Scott authored
      Summary:
      There was a rather annoying corner case where splicing poly-kinded
      Template Haskell declarations could trigger an error muttering about
      `TypeInType` not being enabled, whereas the equivalent non-TH code would
      compile without issue. This was causing by overzealous validity check in the
      renamer, wherein failed to distinguish between two different `Exact` names
      with the same `OccName`. As a result, it mistakenly believed some type
      variables were being used as both type and kind variables simultaneously! Ack.
      
      This avoids the issue by simply disabling the aforementioned validity check
      for Exact names. Fixes #12503.
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari, goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3022
      283a3465
    • Simon Peyton Jones's avatar
      Change rewritableTyVarsOfType to anyRewritableTyVar · 76244ec2
      Simon Peyton Jones authored
      This fixes the regression in FrozenErrorTests, eliminates the
      awkward "crash on forall" in rewritableTyVars, and makes it more
      efficient too.
      76244ec2
    • Gabor Greif's avatar
      Spelling in comments [ci skip] · 3211fa06
      Gabor Greif authored
      3211fa06
    • Alan Zimmerman's avatar
      TH-spliced class instances are pretty-printed incorrectly post-#3384 · 258c7195
      Alan Zimmerman authored
      Summary:
      The HsSyn prettyprinter tests patch 499e4382
      broke the pretty-printing of Template Haskell-spliced class instances.
      
      Test Plan: ./validate
      
      Reviewers: RyanGlScott, austin, goldfire, bgamari
      
      Reviewed By: RyanGlScott, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3043
      258c7195
  4. 09 Feb, 2017 9 commits
  5. 08 Feb, 2017 20 commits