1. 26 Nov, 2018 3 commits
    • Ryan Scott's avatar
      Print explicit foralls in type family eqns when appropriate · f932b1aa
      Ryan Scott authored
      When `-fprint-explicit-foralls` is enabled, type family
      equations are either printed without an explict `forall` entirely,
      or with a bizarre square bracket syntax (in the case of closed type
      families). I find neither satisfying, so in this patch, I introduce
      support for printing explicit `forall`s in open type-family, closed
      type-family, and data-family equations when appropriate. (By "when
      appropriate", I refer to the conditions laid out in
      `Note [When to print foralls]` in `IfaceType`.)
      One tricky point in the implementation is that I had to pick a
      visibility for each type variable in a `CoAxiom`/`FamInst` in order
      to be able to pass it to `pprUserIfaceForAll` //et al.// Because
      the type variables in a type family instance equation can't be
      instantiated by the programmer anyway, the choice only really matters
      for pretty-printing purposes, so I simply went with good ol'
      trustworthy `Specified`. (This design choice is documented in
      `Note [Printing foralls in type family instances]` in `IfaceType`.)
      Test Plan: make test TEST=T15827
      Reviewers: goldfire, bgamari, simonpj
      Reviewed By: simonpj
      Subscribers: simonpj, rwbarton, carter
      GHC Trac Issues: #15827
      Differential Revision: https://phabricator.haskell.org/D5282
    • Ömer Sinan Ağacan's avatar
      Fix build on darwin · df570d92
      Ömer Sinan Ağacan authored
      CPP error introduced with b2950e03
    • Ömer Sinan Ağacan's avatar
      Revert "Remove redundant check in cgCase" · 8a6aa877
      Ömer Sinan Ağacan authored
      This reverts commit d13b7d60.
      (See discussion in D5358)
  2. 25 Nov, 2018 1 commit
  3. 24 Nov, 2018 5 commits
  4. 23 Nov, 2018 10 commits
  5. 22 Nov, 2018 21 commits
    • David Eichmann's avatar
      Fix unused-import warnings · 6353efc7
      David Eichmann authored
      This patch fixes a fairly long-standing bug (dating back to 2015) in
      RdrName.bestImport, namely
         commit 9376249b
         Author: Simon Peyton Jones <simonpj@microsoft.com>
         Date:   Wed Oct 28 17:16:55 2015 +0000
         Fix unused-import stuff in a better way
      In that patch got the sense of the comparison back to front, and
      thereby failed to implement the unused-import rules described in
        Note [Choosing the best import declaration] in RdrName
      This led to Trac #13064 and #15393
      Fixing this bug revealed a bunch of unused imports in libraries;
      the ones in the GHC repo are part of this commit.
      The two important changes are
      * Fix the bug in bestImport
      * Modified the rules by adding (a) in
           Note [Choosing the best import declaration] in RdrName
        Reason: the previosu rules made Trac #5211 go bad again.  And
        the new rule (a) makes sense to me.
      In unravalling this I also ended up doing a few other things
      * Refactor RnNames.ImportDeclUsage to use...
    • Krzysztof Gogolewski's avatar
      Don't pass -no-pie when -pgmc is supplied · 8d008b71
      Krzysztof Gogolewski authored
      Test Plan: validate
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15319
      Differential Revision: https://phabricator.haskell.org/D5317
    • Alec Theriault's avatar
      Simplify 'ExtBits' in the lexer · d2fbc33c
      Alec Theriault authored
      The main change is to export 'ExtBits' instead of defining/exporting a
      bunch of boilerplate functions that test for a particular 'ExtBits'.
      In the process, I also
        * cleaned up an unneeded special case for 'ITstatic'
        * made 'UsePosPrags' another variant of 'ExtBits'
        * made the logic in 'reservedSymsFM' match that of 'reservedWordsFM'
      Test Plan: make test
      Reviewers: bgamari, alanz
      Subscribers: sjakobi, rwbarton, mpickering, carter
      Differential Revision: https://phabricator.haskell.org/D5332
    • Alec Theriault's avatar
      'DynFlag'-free version of 'mkParserFlags' · 5aa29231
      Alec Theriault authored
      Obtaining a `DynFlags` is difficult, making using the lexer/parser
      for pure parsing/lexing unreasonably difficult, even with
      This is despite the fact that we only really need
        * language extension flags
        * warning flags
        * a handful of boolean options
      The new `mkParserFlags'` function makes is easier to directly construct
      a `ParserFlags`. Furthermore, since `pExtsBitmap` is just a footgun,
      I've gone ahead and made `ParserFlags` an abstract type.
      Reviewers: bgamari, alanz, sjakobi
      Reviewed By: bgamari, sjakobi
      Subscribers: mpickering, sjakobi, rwbarton, carter
      GHC Trac Issues: #11301
      Differential Revision: https://phabricator.haskell.org/D5269
    • Alec Theriault's avatar
      Doc-only fixes · a1bbb56f
      Alec Theriault authored
      * laws are capitalized definition lists, no emphasis on the labels
      * adds missing hyperlinks
      * fixes other misc. Haddock markup issues.
    • Peter Trommler's avatar
    • Dario Bertini's avatar
    • Dario Bertini's avatar
      rts/MachO: A bit of refactoring in ocGetNames · b2f6f896
      Dario Bertini authored
      Eliminates a bit of repetition.
    • Dario Bertini's avatar
    • Dario Bertini's avatar
      circleci: Actually build with in-tree GMP on Darwin · 3584bd42
      Dario Bertini authored
      Fixes #15404.
    • Gabor Greif's avatar
      llvmGen: Eliminate duplicate definition · d0fc7618
      Gabor Greif authored
      remove local
    • Jessica Clarke's avatar
      UNREG: PprC: Add support for adjacent floats · 35a89778
      Jessica Clarke authored
      When two 32-bit floats are adjacent for a 64-bit target, there is no
      padding between them to force alignment, so we must combine their bit
      representations into a single word.
      Reviewers: bgamari, simonmar
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15853
      Differential Revision: https://phabricator.haskell.org/D5306
    • Ryan Scott's avatar
      Overhaul -fprint-explicit-kinds to use VKA · f5d20838
      Ryan Scott authored
      This patch changes the behavior of `-fprint-explicit-kinds`
      so that it displays kind argument using visible kind application.
      In other words, the flag now:
      1. Prints instantiations of specified variables with `@(...)`.
      2. Prints instantiations of inferred variables with `@{...}`.
      In addition, this patch removes the `Use -fprint-explicit-kinds to
      see the kind arguments` error message that often arises when a type
      mismatch occurs due to different kinds. Instead, whenever there is a
      kind mismatch, we now enable the `-fprint-explicit-kinds` flag
      locally to help cue to the programmer where the error lies.
      (See `Note [Kind arguments in error messages]` in `TcErrors`.)
      As a result, these funny `@{...}` things can now appear to the user
      even without turning on the `-fprint-explicit-kinds` flag explicitly,
      so I took the liberty of documenting them in the users' guide.
      Test Plan: ./validate
      Reviewers: goldfire, simonpj, bgamari
      Reviewed By: simonpj
      Subscribers: rwbar...
    • Alec Theriault's avatar
      Hadrian: Misc. fixes in Haddock rules · ff619555
      Alec Theriault authored
      * Pass 'GHC/Prim.hs' to Haddock when processing 'ghc-prim'. This
        file is autogenerated for the sole purpose of giving Haddock
        something to process, so we really should make sure it gets
        through to Haddock!
      * Add a "docs-haddock" build rule, which should build all Haddock docs
        that the Makefile builds by default (all libs + index for libs + ghc)
      * Prune some unnecessary rules (esp. `gen_contents_index`)
      Reviewers: bgamari, snowleopard
      Reviewed By: snowleopard
      Subscribers: alpmestan, snowleopard, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5316
    • Simon Jakobi's avatar
      Remove warnings-silencing flags for code generated by Alex · 699e5072
      Simon Jakobi authored
      Current versions of Alex don't seem to produce as many warnings any
      In order to silence a warning and to avoid overlong lines, I've taken
      the liberty of refactoring 'tok_num'.
      Test Plan: ./validate
      Reviewers: bgamari, simonmar
      Reviewed By: simonmar
      Subscribers: erikd, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5319
    • Roland Senn's avatar
      Calling gcc: Pass optc flags as last options (#14452) · f2d9fb0c
      Roland Senn authored
      Test Plan: make test TEST=T14452
      Reviewers: hvr, bgamari, monoidal, thomie, osa1
      Reviewed By: osa1
      Subscribers: rwbarton, carter
      GHC Trac Issues: #14452
      Differential Revision: https://phabricator.haskell.org/D5318
    • Ryan Scott's avatar
      Fix #15852 by eta expanding data family instance RHSes, too · 014d6c1f
      Ryan Scott authored
      When I defined `etaExpandFamInstLHS`, I blatantly forgot
      to eta expand the RHSes of data family instances. (Actually, I
      claimed that they didn't //need// to be eta expanded. I'm not sure
      what I was thinking.)
      This fixes the issue by changing `etaExpandFamInstLHS` to
      `etaExpandFamInst` and, well, making it actually eta expand the RHS.
      Test Plan: make test TEST=T15852
      Reviewers: goldfire, bgamari
      Reviewed By: goldfire
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15852
      Differential Revision: https://phabricator.haskell.org/D5328
    • Simon Jakobi's avatar
      Refactor TcRnMonad.mapAndRecoverM · 66f0056a
      Simon Jakobi authored
      This version doesn't require the 'reverse' step after the monadic
      Test Plan: ./validate
      Reviewers: bgamari, tdammers
      Reviewed By: tdammers
      Subscribers: monoidal, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5343
    • Zejun Wu's avatar
      Fix uninformative hp2ps error when the cmdline contains double quotes · 390df8b5
      Zejun Wu authored
      The format of hp file didn't allow double quotes inside strings, and
      under prof build, we include args in JOB, which may have double quotes.
      When this happens, the error message is confusing to the user. This can
      also happen under normal build if the executable name contains double
      quite, which is unlikely though.
      We fix this issue by introducing escaping for double quotes inside a
      string by repeating it twice.
      We also fix a buffer overflow bug when the length of the string happen
      to be multiple of 5000.
      Test Plan:
      new tests, which used to fail with error message:
      hp2ps: "T15904".hp, line 2: integer must follow identifier
      use new ghc and hp2ps to profile a simple program.
      Reviewers: simonmar, bgamari, erikd
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15904
      Differential Revision: https://phabricator.haskell.org/D5346
    • Christiaan Baaij's avatar
      Load plugins in interactive session · 599eaada
      Christiaan Baaij authored
      Reviewers: bgamari, tdammers
      Reviewed By: tdammers
      Subscribers: monoidal, rwbarton, carter
      GHC Trac Issues: #15633
      Differential Revision: https://phabricator.haskell.org/D5348
    • Zejun Wu's avatar
      Fix deadlock bug when mkFastStringWith is duplicated · f088c2d4
      Zejun Wu authored
      In D5211, we use `withMVar` to guard writes to the same segment, this
      is unsafe to be duplicated. It can lead to deadlock if it is only run
      partially and `putMVar` is not called after `takeMVar`.
      Test Plan:
      We used to see deadlock when building stackage without this fix, and it
      no longer happens.
      Reviewers: simonmar, bgamari
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5349