1. 12 Jan, 2017 1 commit
  2. 11 Jan, 2017 10 commits
    • Ryan Scott's avatar
      Add mkUserGuidePart.cabal to .gitignore · f9df77e4
      Ryan Scott authored
      Following fe75d2d4.
      f9df77e4
    • Edward Z. Yang's avatar
      501de268
    • Edward Z. Yang's avatar
      Fix handling of closed type families in Backpack. · f59aad68
      Edward Z. Yang authored
      Summary:
      A few related problems:
      
      - CoAxioms, like DFuns, are implicit and never exported,
        so we have to make sure we treat them the same way as
        DFuns: in RnModIface we need to rename references to
        them with rnIfaceImplicit and in mergeSignatures we need
        to NOT check them directly for compatibility (the
        test on the type family will do this check for us.)
      
      - But actually, we weren't checking if the axioms WERE
        consistent.  This is because we were forwarding all
        embedded CoAxiom references in the type family TyThing
        to the merged version, but that reference was what
        checkBootDeclM was using as a comparison point.
        This is similar to a problem we saw with DFuns.
      
        To fix this, I refactored the handling of implicit entities in TcIface
        for Backpack.  See Note [The implicit TypeEnv] for the gory details.
        Instead of passing the TypeEnv around explicitly, we stuffed it in
        IfLclEnv.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, simonpj, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2928
      f59aad68
    • Edward Z. Yang's avatar
      Rewrite module signature documentation. · 8744869e
      Edward Z. Yang authored
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: none
      
      Reviewers: bgamari, simonpj, austin, goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2918
      
      GHC Trac Issues: #10262
      8744869e
    • Edward Z. Yang's avatar
      Revamp Backpack/hs-boot handling of type class signatures. · 5def07fa
      Edward Z. Yang authored
      Summary:
      A basket of fixes and improvements:
      
      - The permissible things that one can write in a type
        class definition in an hsig file has been reduced
        to encompass the following things:
      
          - Methods
          - Default method signatures (but NOT implementation)
          - MINIMAL pragma
      
        It is no longer necessary nor encouraged to specify
        that a method has a default if it is mentioned in
        a MINIMAL pragma; the MINIMAL pragma is assumed to
        provide the base truth as to what methods need to
        be implemented when writing instances of a type
        class.
      
      - Handling of default method signatures in hsig was
        previously buggy, as these identifiers were not exported,
        so we now treat them similarly to DFuns.
      
      - Default methods are merged, where methods with defaults
        override those without.
      
      - MINIMAL pragmas are merged by ORing together pragmas.
      
      - Matching has been relaxed: a method with a default can
        be used to fill a signature which did not declare the
        method as having a default, and a more relaxed MINIMAL
        pragma can be used (we check if the signature pragma
        implies the final implementation pragma, on the way
        fixing a bug with BooleanFormula.implies, see #13073)
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, bgamari, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2925
      
      GHC Trac Issues: #13041
      5def07fa
    • Edward Z. Yang's avatar
      Improve Backpack support for fixities. · e41c61fa
      Edward Z. Yang authored
      Summary:
      Two major bug-fixes:
      
          - Check that fixities match between hsig and implementation
      
          - Merge and preserve fixities when merging signatures
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, simonpj, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2919
      
      GHC Trac Issues: #13066
      e41c61fa
    • Edward Z. Yang's avatar
      Warn if you explicitly export an identifier with warning attached. · 0bbcf76a
      Edward Z. Yang authored
      Summary:
      This won't stop people from attempting to use this identifier
      (since it is still always going to be in the export list), but
      having an explicit reference to something people shouldn't
      use is a smell, so warn about it.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2907
      0bbcf76a
    • Edward Z. Yang's avatar
      Attach warnings to non-PVP compatible uses of signatures. · 9f169bcd
      Edward Z. Yang authored
      Summary:
      If you use an inherited signature from another package in your own code,
      the only valid PVP bound you can specify for this package is an *exact*
      version bound.  This is because the signature is used both covariantly
      (it provides declarations for import) and contravariantly (it specifies
      what is required).  However, this is a bit distressing if you want to
      use a PVP-style bound that allows for upgrading a package.  So there is
      a dichotomy:
      
          1. Any signatures that come from packages with exact bounds
          (this includes, in particular, signature packages, who are
          included solely to make declarations available), can be
          used without problem by modules, but
      
          2. Any signatures that come from packages that are version
          bounded (i.e., any package that also provides modules) must
          NOT be used, because if they were used, they could break
          under a PVP policy that allows relaxations in the needed
          requirements.
      
      To help users avoid situation (2), I've added a warning to all
      signature declarations that come solely from (2).  This is not
      perfect; you might still end up relying on some type identity
      specified by a signature in a version-bounded package, but it
      should help catch major errors.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2906
      9f169bcd
    • Edward Z. Yang's avatar
      Support for using only partial pieces of included signatures. · 5f9c6d2a
      Edward Z. Yang authored
      Summary:
      Generally speaking, it's not possible to "hide" a requirement from a
      package you include, because if there is some module relying on that
      requirement, well, you can't just wish it out of existence.
      
      However, some packages don't have any modules.  For these, we can
      validly thin out requirements; indeed, this is very convenient if
      someone has published a large signature package but you only want
      some of the definitions.
      
      This patchset tweaks the interpretation of export lists in
      signatures: in particular, they no longer need to refer to
      entities that are defined locally; they range over both the current
      signature as well as any signatures that were inherited from
      signature packages (defined by having zero exposed modules.)
      
      In the process of doing this, I cleaned up a number of other
      things:
      
      * rnModIface and rnModExports now report errors that occurred
        during renaming and can propagate these to the TcM monad.
        This is important because in the current semantics, you can
        thin out a type which is referenced by a value you keep;
        in this situation, we need to error (to ensure that all
        types in signatures are rooted, so that we can determine
        their identities).
      
      * I ended up introducing a new construct 'dependency signature;
        to bkp files, to make it easier to tell if we were depending
        on a signature package.  It's not difficult for Cabal to
        figure this out (I already have a patch for it.)
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari
      
      Subscribers: thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2904
      
      GHC Trac Issues: #12994
      5f9c6d2a
    • Ben Gamari's avatar
      Revert "event manager: Don't worry if attempt to wake dead manager fails" · 436aa7aa
      Ben Gamari authored
      This broke the OS X build.
      
      This reverts commit 6de76136.
      436aa7aa
  3. 10 Jan, 2017 23 commits
    • David Feuer's avatar
      Inline partially-applied wrappers · 2be364ac
      David Feuer authored
      Suppose we have
      
      ```
      data Node a = Node2 !Int a a | Node3 !Int a a a
      instance Traversable Node where
        traverse f (Node2 s x y) = Node2 s <$> f x <*> f y
        ...
      
      ```
      
      Since `Node2` is partially applied, we wouldn't inline its
      wrapper.  The result was that we'd box up the `Int#` to put
      the box in the closure passed to `fmap`. We now allow the wrapper
      to inline when partially applied, so GHC stores the `Int#`
      directly in the closure.
      
      Reviewers: rwbarton, mpickering, simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2891
      
      GHC Trac Issues: #12990
      2be364ac
    • David Feuer's avatar
      Fix references in let/app invariant note · 8b15fc42
      David Feuer authored
      `mkCoreApp` and `mkCoreLet` have moved since the let/app invariant
      note was written. Update the note to reflect that change.
      
      [skip ci]
      
      Test Plan: Read
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2953
      8b15fc42
    • takano-akio's avatar
      Mark *FB functions INLINE[0] (Fixes #13001) · 09bce7ac
      takano-akio authored
      When fusion rules successfully fire, we are left with calls to
      *FB functions. They are higher-order functions, and therefore they
      often benefit from inlining. This is particularly important when
      then final consumer is a strict fold (foldl', length, etc.), because
      not inlining these functions means allocating a function closure
      for each element in the list, which often is more costly than what
      fusion eliminates.
      
      Nofib shows a slight increase in the binary size:
      
      ------------------------------------------------------------------------
             Program           Size    Allocs   Runtime   Elapsed  TotalMem
      ------------------------------------------------------------------------
         gen_regexps          -0.3%      0.0%     0.000     0.000      0.0%
              puzzle          +0.8%      0.0%     0.089     0.090      0.0%
             reptile          +0.8%     -0.0%     0.008     0.008      0.0%
      ------------------------------------------------------------------------
                 Min          -0.3%     -0.0%     -7.3%     -7.1%      0.0%
                 Max          +0.8%     +0.0%     +7.8%     +7.7%     +1.8%
      Geometric Mean          +0.0%     -0.0%     +0.2%     +0.2%     +0.0%
      ------------------------------------------------------------------------
      
      Reviewers: simonpj, austin, hvr, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2951
      
      GHC Trac Issues: #13001
      09bce7ac
    • dobenour's avatar
      Don't use the splitter on Darwin · 266a9dc4
      dobenour authored
      Test Plan: GHC CI
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2879
      266a9dc4
    • Rufflewind's avatar
      Fix terminal corruption bug and clean up SDoc interface. · 22845adc
      Rufflewind authored
      - Fix #13076 by wrapping `printDoc_` so that the terminal color is
        reset even if an exception occurs.
      
      - Add `printSDoc`, `printSDocLn`, and `bufLeftRenderSDoc` to keep `SDoc`
        values abstract (they are wrappers of `printDoc_`, `printDoc`, and
        `bufLeftRender` respectively).
      
      - Remove unused function: `printForAsm`
      
      Test Plan: manual
      
      Reviewers: RyanGlScott, austin, dfeuer, bgamari
      
      Reviewed By: dfeuer, bgamari
      
      Subscribers: dfeuer, mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2932
      
      GHC Trac Issues: #13076
      22845adc
    • rwbarton's avatar
      testsuite driver: don't append to existing output files · 35a5b603
      rwbarton authored
      If you happen to have a T1234.run.stdout file lying aroud (probably
      from before the move to running tests in temporary subdirectories)
      it gets symlinked into the T1234.run directory since its name starts
      with T1234; and then program output gets appended to the existing
      file (through the symlink). We should open the file for writing
      instead, to replace the symlink with a new file.
      
      Test Plan: tested locally, + harbormaster
      
      Reviewers: austin, Phyx, bgamari
      
      Reviewed By: Phyx, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2946
      35a5b603
    • Jon Coens's avatar
      Expose purgeObj in ObjLink · c2bd62ed
      Jon Coens authored
      Test Plan: Rebuild GHC under 7.10.2.
      
      Reviewers: niteria, simonmar, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2948
      c2bd62ed
    • Steffen Forkmann's avatar
      Fix typo in comment · b1923ed5
      Steffen Forkmann authored
      b1923ed5
    • David Feuer's avatar
      Remove tyConString · 5857dfb8
      David Feuer authored
      `tyConString` has been deprecated since GHC 7.4. It's time for it to go.
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2950
      
      GHC Trac Issues: #13096
      5857dfb8
    • David Feuer's avatar
      Remove deprecated InteractiveEval API · eee81994
      David Feuer authored
      Remove `RunResult(..)`, `runStmt`, and `runStmtWithLocation`.  These
      were all deprecated and documented as slated for removal in GHC 7.14,
      which I figure means 8.2.
      
      See cf7573b8 for an explanation of why
      this change was made.
      
      Reviewers: simonpj, hvr, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2949
      
      GHC Trac Issues: #13095
      eee81994
    • Ben Gamari's avatar
      event manager: Don't worry if attempt to wake dead manager fails · 6de76136
      Ben Gamari authored
      This fixes #12038, where the TimerManager would attempt to wake up a
      manager that was already dead, resulting in setnumcapabilities001
      occassionally failing during shutdown with unexpected output on stderr.
      
      I'm frankly still not entirely confident in this solution but perhaps it
      will help to get a few more eyes on this.
      
      My hypothesis is that the TimerManager is racing:
      
        thread                   TimerManager worker
        -------                  --------------------
        requests that thread
        manager shuts down
      
                                 begins to clean up,
                                 closing eventfd
      
        calls wakeManager,
        which tries to write
        to closed eventfd
      
      To prevent this `wakeManager` will need to synchronize with the
      TimerManger worker to ensure that the worker doesn't clean up the
      `Control` while another thread is trying to send a wakeup. However, this
      would add a bit of overhead on every timer interaction, which feels
      rather costly for what is really a problem only at shutdown.  Moreover,
      it seems that the event manager (e.g.  `GHC.Event.Manager`) is also
      afflicted by a similar race.
      
      This patch instead simply tries to catch the write failure after it has
      happened and silence it in the case that the fd has vanished. It feels
      rather hacky but it seems to work.
      
      Test Plan: Run `setnumcapabilities001` repeatedly
      
      Reviewers: austin, hvr, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2926
      
      GHC Trac Issues: #12038
      6de76136
    • Chris Martin's avatar
      Add doc header to Dynamic's re-export of Typeable · fe8bc14f
      Chris Martin authored
      Data.Data and Data.Dynamic both re-export Data.Typeable with the same
      comment, though in the Data module the comment is a haddock header, and
      in Typeable it is not. I assume the inconsistency was a mistake.
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2923
      fe8bc14f
    • Ben Gamari's avatar
      users-guide: Produce OpenSearch description · 89d4d261
      Ben Gamari authored
      Reviewers: austin, hsyl20
      
      Reviewed By: hsyl20
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2921
      89d4d261
    • dobenour's avatar
      Enable subsections via symbols on iOS · 58e68b37
      dobenour authored
      Test Plan: GHC CI
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2915
      
      GHC Trac Issues: #11040, #13049
      58e68b37
    • johnleo's avatar
      Check that type variable does not reference itself in its kind signature · 8a76d32e
      johnleo authored
      This fixes #11592.
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari, goldfire
      
      Reviewed By: goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2914
      
      GHC Trac Issues: #11592
      8a76d32e
    • shlevy's avatar
      base: Add Foreign.ForeignPtr.plusForeignPtr. · 226c5352
      shlevy authored
      Reviewers: simonmar, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2900
      226c5352
    • dobenour's avatar
      Throw an exception on heap overflow · 12ad4d41
      dobenour authored
      This changes heap overflow to throw a HeapOverflow exception instead of
      killing the process.
      
      Test Plan: GHC CI
      
      Reviewers: simonmar, austin, hvr, erikd, bgamari
      
      Reviewed By: simonmar, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2790
      
      GHC Trac Issues: #1791
      12ad4d41
    • Ben Gamari's avatar
      e8d74321
    • Ben Gamari's avatar
      fe75d2d4
    • dobenour's avatar
      -dead_strip is now the default on Darwin · 0a6c257d
      dobenour authored
      This enables subsections-via-symbols (-dead_strip) by default on Darwin.
      The Static Reference Table (SRT) needs to be split in order for
      -dead_strip to be helpful, so this commit always splits it on Darwin
      systems.
      
      Test Plan: GHC CI on Darwin
      
      Reviewers: erikd, austin, bgamari
      
      Reviewed By: erikd, bgamari
      
      Subscribers: erikd, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2911
      
      GHC Trac Issues: #11040, #13049
      0a6c257d
    • Ryan Scott's avatar
      Properly detect MinTTY when running GHCi on Windows · 6fe9b057
      Ryan Scott authored
      Before, we detecting the presence of MinTTY on Windows in a very
      imprecise way: by checking if the `_` environment variable was set. Not
      only is this easy to circumvent, but it also yields false positives on
      terminals like ConEmu.
      
      This changes the test to use the `GetFileInformationByHandleEx` function
      instead, which provides a far more accurate check for MinTTY's presence.
      I've tested this on PowerShell, MSYS2, Cygwin, ConEmu, and Git Bash, and
      it does the right thing on each one.
      
      Fixes #12958.
      
      Test Plan: Run GHCi on many different Windows and MinTTY consoles
      
      Reviewers: erikd, Phyx, austin, bgamari
      
      Reviewed By: Phyx, bgamari
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2878
      
      GHC Trac Issues: #12958
      6fe9b057
    • Ben Gamari's avatar
      CmmCommonBlockElim: Ignore CmmUnwind nodes · e94b07dc
      Ben Gamari authored
      We don't want unwind information to affect the code we produce.
      Consequently we need to ensure that CBE ignores unwind nodes for the
      purposes of equality.
      
      Test Plan: Validate
      
      Reviewers: scpmw, simonmar, austin
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2739
      e94b07dc
    • Alan Zimmerman's avatar
      Make HsIParamTy have a Located HsIPName · 1a6bdca0
      Alan Zimmerman authored
      To simplify API Annotations.
      
      Updates haddock submodule
      1a6bdca0
  4. 09 Jan, 2017 2 commits
  5. 08 Jan, 2017 1 commit
    • Ömer Sinan Ağacan's avatar
      Parse holes as infix operators · 6c869f90
      Ömer Sinan Ağacan authored
      Reported as #13050. Since holes are expressions but not identifiers,
      holes were not allowed in infix operator position. This patch introduces
      a new production in infix operator parser to allow this.
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, RyanGlScott, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2910
      
      GHC Trac Issues: #13050
      6c869f90
  6. 07 Jan, 2017 1 commit
  7. 06 Jan, 2017 2 commits