1. 21 Jul, 2015 10 commits
    • Simon Peyton Jones's avatar
      Refactor self-boot info · 3c44a46b
      Simon Peyton Jones authored
      This patch is a simple refactoring that prepares for a later one,
      related to Trac #10083.
      * Add a field tcg_self_boot :: SelfBootInfo to TcGblEnv,
        where SelfBootInfo is a new data type, describing the
        hi-boot file, if any, for the module being compiled.
      * Make tcHiBootIface return SelfBootInfo, a new data type
      * Make other functions get SelfBootInfo from the monad.
      * Remove tcg_mod_name from TcGblEnv; it was barely used and
        simpler to pass around explicitly.
    • Simon Peyton Jones's avatar
      Comments and white space only · cd48797a
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Improve strictness analysis for exceptions · 7c0fff41
      Simon Peyton Jones authored
      Two things here:
      * For exceptions-catching primops like catch#, we know
        that the main argument function will be called, so
        we can use strictApply1Dmd, rather than lazy
        Changes in primops.txt.pp
      * When a 'case' scrutinises a I/O-performing primop,
        the Note [IO hack in the demand analyser] was
        throwing away all strictness from the code that
        I found that this was causing quite a bit of unnecessary
        reboxing in the (heavily used) function
        So this patch prevents the hack applying when the
        case scrutinises a primop.  See the revised
        Note [IO hack in the demand analyser]
      Thse two things buy us quite a lot in programs that do a lot of IO.
              Program           Size    Allocs   Runtime   Elapsed  TotalMem
                  hpg          -0.4%     -2.9%     -0.9%     -1.0%     +0.0%
      reverse-complem          -0.4%    -10.9%    +10.7%    +10.9%     +0.0%
               simple          -0.3%     -0.0%    +26.2%    +26.2%     +3.7%
               sphere          -0.3%     -6.3%      0.09      0.09     +0.0%
                  Min          -0.7%    -10.9%     -4.6%     -4.7%     -1.7%
                  Max          -0.2%     +0.0%    +26.2%    +26.2%     +6.5%
       Geometric Mean          -0.4%     -0.3%     +2.1%     +2.1%     +0.1%
      I think the increase in runtime for 'simple' is measurement error.
    • Simon Peyton Jones's avatar
      Refactor newSCWorkFromFlavoured · 35091912
      Simon Peyton Jones authored
      No change in behaviour is intended here
    • Simon Peyton Jones's avatar
    • Simon Peyton Jones's avatar
      Use varToCoreExpr in mkWWcpr_help · 8f48fdc8
      Simon Peyton Jones authored
      Lacking this cuased Trac #10658.
      The fix is easy; it was a simple omission.
    • thomie's avatar
      Delete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.8 · e0a3c441
      thomie authored
      Reviewers: austin, goldfire, bgamari
      Reviewed By: bgamari
      Subscribers: bgamari, thomie
      Differential Revision: https://phabricator.haskell.org/D904
    • Ben Gamari's avatar
      primops: Fix spelling mistake · 9ade0871
      Ben Gamari authored
    • Edward Z. Yang's avatar
      Revert "Revert "Support for multiple signature files in scope."" · 214596de
      Edward Z. Yang authored
      This reverts commit bac927b9.
      As it turns out, we need these commits for separate compilation
      and accurate dependency tracking.  So back in they go!
    • Edward Z. Yang's avatar
  2. 20 Jul, 2015 13 commits
    • thomie's avatar
      Update submodule hpc with fix for #10529 · b4ef8b8b
      thomie authored
    • thomie's avatar
      Testsuite: simplify T8089 (#8089) · d0cf8f1a
      thomie authored
      The previous implementation wasn't working for the `ghci` test way,
      causing a fulltest failure.
      Differential Revision: https://phabricator.haskell.org/D1075
    • thomie's avatar
    • thomie's avatar
      Testsuite: fix concprog002 (AMP) · d71d9a9e
      thomie authored
      Requires random to be installed.
    • Ben Gamari's avatar
      Fix primops documentation syntax · 96de8098
      Ben Gamari authored
    • Luite Stegeman's avatar
      Do not treat prim and javascript imports as C imports in TH and QQ · 4cd008b6
      Luite Stegeman authored
      Reviewers: austin, hvr, goldfire, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1070
      GHC Trac Issues: #10638
    • Ben Gamari's avatar
      primops: Add haddocks to BCO primops · c526e095
      Ben Gamari authored
      Test Plan: none
      Reviewers: simonmar, austin, hvr
      Subscribers: hvr, thomie
      Differential Revision: https://phabricator.haskell.org/D1082
      GHC Trac Issues: #10640
    • thomasw's avatar
      Support wild cards in TH splices · 49373ffe
      thomasw authored
      - Declaration splices: partial type signatures are fully supported in TH
        declaration splices.
        For example, the wild cards in the example below will unify with `Eq
        and `a -> a -> Bool`, as expected:
      [d| foo :: _ => _
          foo x y = x == y |]
      - Expression splices: anonymous and named wild cards are supported in
        expression signatures, but extra-constraints wild cards aren't. Just
        as is the case for regular expression signatures.
      [e | Just True :: _a _ |]
      - Typed expression splices: the same wildcards as in (untyped)
        expression splices are supported.
      - Pattern splices: TH doesn't support type signatures in pattern
        splices, consequently, partial type signatures aren't supported
      - Type splices: partial type signatures are only partially supported in
        type splices, specifically: only anonymous wild cards are allowed.
        So `[t| _ |]`, `[t| _ -> Maybe _ |]` will work, but `[t| _ => _ |]` or
        `[| _a |]` won't (without `-XNamedWildCards`, the latter will work as
        the named wild card is treated as a type variable).
        Normally, named wild cards are collected before renaming a (partial)
        type signature. However, TH type splices are run during renaming, i.e.
        after the initial traversal, leading to out of scope errors for named
        wild cards. We can't just extend the initial traversal to collect the
        named wild cards in TH type splices, as we'd need to expand them,
        which is supposed to happen only once, during renaming.
        Similarly, the extra-constraints wild card is handled right before
        renaming too, and is therefore also not supported in a TH type splice.
        Another reason not to support extra-constraints wild cards in TH type
        splices is that a single signature can contain many TH type splices,
        whereas it mustn't contain more than one extra-constraints wild card.
        Enforcing would this be hard the way things are currently organised.
        Anonymous wild cards pose no problem, because they start without names
        and are given names during renaming. These names are collected right
        after renaming. The names generated for anonymous wild cards in TH
        type splices will thus be collected as well.
        With a more invasive refactoring of the renaming, partial type
        signatures could be fully supported in TH type splices. As only
        anonymous wild cards have been requested so far, these small changes
        satisfying this request will do for now. Also don't forget that a TH
        declaration splices support all kinds of wild cards.
      - Extra-constraints wild cards were silently ignored in expression and
        pattern signatures, appropriate error messages are now generated.
      Test Plan: run new tests
      Reviewers: austin, goldfire, adamgundry, bgamari
      Reviewed By: goldfire, adamgundry, bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1048
      GHC Trac Issues: #10094, #10548
    • Michal Terepeta's avatar
      LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp · 82ffc80d
      Michal Terepeta authored
      This adds support MO_U_Mul2 to the LLVM backend by simply using 'mul'
      instruction but operating at twice the bit width (e.g., for 64 bit
      words we will generate mul that operates on 128 bits and then extract
      the two 64 bit values for the result of the CallishMachOp).
      Test Plan: validate
      Reviewers: rwbarton, austin, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1068
      GHC Trac Issues: #9430
    • thomie's avatar
      Testsuite: add regression test for missing class constraint · 029367e5
      thomie authored
      The following program is accepted by ghc-7.0 to ghc-7.10, but rejected
      by ghc-6.12.3 and HEAD (and rightfully so):
          class Class1 a
          class Class1 a => Class2 a
          class Class2 a => Class3 a
          instance Class3 a => Class2 a
      The last line is missing a `Class1 a` constraint. Add a regression test
      for this (typechecker/should_fail/tcfail223).
      Add similar missing class constraints to T7126 and T5751. I verified
      that the these changes don't interfer with the intention of the tests
      (they still result in a loop with ghc-7.4.1).
      Reviewers: austin, simonpj, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D1078
    • thomie's avatar
      Testsuite: add -XUndecidableInstances to T3500a · 7f37274d
      thomie authored
      This makes the test pass again with HEAD (7.11), instead of resulting
        T3500a.hs:11:10: error:
            The constraint ‘C (F a)’ is no smaller than the instance head
            (Use UndecidableInstances to permit this)
            In the instance declaration for ‘C (a, b)’
      Test Plan: I verified that ghc-6.12.3's typechecker still loops on this
      Reviewers: austin, bgamari, simonpj
      Reviewed By: simonpj
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1079
    • thomie's avatar
      Testsuite: add ImpredicativeTypes to T7861 (#7861) · 4c96e7cf
      thomie authored
      The test was failing with:
          T7861: T7861.hs:15:13:
              Cannot instantiate unification variable ‘t0’
              with a type involving foralls: A a0 -> a0
                GHC doesn't yet support impredicative polymorphism
              In the first argument of ‘seq’, namely ‘f’
              In a stmt of a 'do' block: f `seq` print "Hello 2"
      It requires ImpredicativeTypes, at least since 7.8, because we
      instantiate seq's type (c->d->d) with f's type (c:= (forall b. a) -> a),
      which is polymorphic (it has foralls).
      I simplified the test a bit by removing the type synonym, and verified
      that ghc-7.6.3 still panics on this test.
      Reviewers: simonpj, austin, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1080
      GHC Trac Issues: #7861
    • rwbarton's avatar
  3. 18 Jul, 2015 7 commits
  4. 17 Jul, 2015 6 commits
  5. 16 Jul, 2015 4 commits
    • Ömer Sinan Ağacan's avatar
      Fix off-by-one error in GHCi line reporting (Trac #10578) · a5e9da8f
      Ömer Sinan Ağacan authored
      Test Plan: I couldn't add tests because apparently line number
      reporting was already working correctly when loading script files. I
      don't know how to test by running commands using stdin, is this
      Reviewers: austin, thomie, bgamari
      Reviewed By: thomie, bgamari
      Subscribers: hvr, thomie
      Differential Revision: https://phabricator.haskell.org/D1067
    • RyanGlScott's avatar
      Handle Char#, Addr# in TH quasiquoter (fixes #10620) · 2c9de9c9
      RyanGlScott authored
      DsMeta does not attempt to handle quasiquoted Char# or Addr# values,
      which causes expressions like `$([| 'a'# |])` or `$([| "abc"# |])` to
      with an `Exotic literal not (yet) handled by Template Haskell` error.
      To fix this, the API of `template-haskell` had to be changed so that
      now has an extra constructor `CharPrimL` (a `StringPrimL` constructor
      existed, but it wasn't used). In addition, `DsMeta` has to manipulate
      `CoreExpr`s directly that involve `Word8`s. In order to do this,
      `Word8` had
      to be added as a wired-in type to `TysWiredIn`.
      Actually converting from `HsCharPrim` and `HsStringPrim` to `CharPrimL`
      `StringPrimL`, respectively, is pretty straightforward after that, since
      both `HsCharPrim` and `CharPrimL` use `Char` internally, and
      uses a `ByteString` internally, which can easily be converted to
      which is what `StringPrimL` uses.
      Reviewers: goldfire, austin, simonpj, bgamari
      Reviewed By: simonpj, bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1054
      GHC Trac Issues: #10620
    • RyanGlScott's avatar
      DeriveFoldable for data types with existential constraints (#10447) · 2c5c2972
      RyanGlScott authored
      Reviewers: dolio, shachaf, ekmett, austin, #core_libraries_committee,
      simonpj, bgamari
      Reviewed By: simonpj, bgamari
      Subscribers: thomie, bgamari
      Differential Revision: https://phabricator.haskell.org/D1031
      GHC Trac Issues: #10447
    • bherzog's avatar
      Put Opt_Static into defaultFlags if not pc_DYNAMIC_BY_DEFAULT (#7478) · 415351a9
      bherzog authored
      The test for Trac issue #7478 fails on some systems due to
      inconsistent default flags for dynamic vs. static linking.
      Test Plan: validate
      Reviewers: austin, thomie
      Reviewed By: thomie
      Subscribers: thomie, bgamari
      Differential Revision: https://phabricator.haskell.org/D1017
      GHC Trac Issues: #7478