1. 24 Nov, 2018 2 commits
  2. 23 Nov, 2018 10 commits
  3. 22 Nov, 2018 28 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 a [GlobalRdrElt] for the
        things that are used, rather than [AvailInfo]. This is simpler
        and more direct.
      * Rename greParentName to greParent_maybe, to follow GHC
        naming conventions
      * Delete dead code RdrName.greUsedRdrName
      Bumps a few submodules.
      Reviewers: hvr, goldfire, bgamari, simonmar, jrtc27
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5312
    • 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: rwbarton, carter
      GHC Trac Issues: #15871
      Differential Revision: https://phabricator.haskell.org/D5314
    • 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
    • Christiaan Baaij's avatar
      plugins10 no longer broken · 1f74f7dd
      Christiaan Baaij authored
      Reviewers: bgamari, tdammers
      Reviewed By: tdammers
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15216
      Differential Revision: https://phabricator.haskell.org/D5350
    • Alp Mestanogullari's avatar
      rts.cabal.in: force inclusion of findPtr/_findPtr symbol only with debug flag · 561748cb
      Alp Mestanogullari authored
      The previous strategy caused problems on Windows, as pointed out
      at [1]
      [1]: https://phabricator.haskell.org/rGHC900c47f88784#133905
      Reviewers: Phyx, bgamari, erikd, simonmar
      Reviewed By: Phyx
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15671
      Differential Revision: https://phabricator.haskell.org/D5356
    • Alec Theriault's avatar
      Hadrian: work around Cabal's/GHC's different Arch/OS strings · 19ffddc1
      Alec Theriault authored
      The path to the 'include' subdirectory of 'rts' includes a folder that
      whose name is generated by Cabal and mentiones the architecture and OS.
      For example:
      Hadrian needs to be aware that Cabal renders architectures and OSes in
      a slightly different way than GHC. There is already symmetric logic in
      Cabal (for working with GHC environment files, which follow GHC's naming
      Test Plan: ./hadrian/build.sh -c "binary-dist" # on mac
      Reviewers: snowleopard, alpmestan, bgamari
      Reviewed By: snowleopard
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15922
      Differential Revision: https://phabricator.haskell.org/D5361
    • Tamar Christina's avatar
      rts: fix Windows megablock allocator · 676f1f2d
      Tamar Christina authored
      The megablock allocator does not currently check that after aligning the
      free region if it still has enough space to actually do the allocation.
      This causes it to return a memory region which it didn't fully allocate
      itself.  Even worse, it can cause it to return a block with a region
      that will be present in two allocation pools.
      This causes if you're lucky an error from the OS that you're committing
      memory that has never been reserved, or causes random heap corruption.
      This change makes it consider the alignment as well.
      Test Plan: ./validate , testcase testmblockalloc
      Reviewers: bgamari, erikd, simonmar
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5363
    • Simon Jakobi's avatar
      Don't reverse explicit export lists during renaming · 7cba71fc
      Simon Jakobi authored
      This will be useful for Hi Haddock / D5067.
      Previously any export list in 'tcg_rn_exports' would be in reverse
      Also remove a redundant setSrcSpan.
      Test Plan: ./validate
      Reviewers: bgamari
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5347
    • Andreas Klebinger's avatar
      Fixup the new code layout patch for SplitObjs. · 6c26b3f8
      Andreas Klebinger authored
      When splitting objects we sometimes generate
      dummy CmmProcs containing bottom in some fields.
      Code introduced in the new code layout patch looked
      at these which blew up the compiler. Now we instead
      check first if the function actually contains code.
      Reviewers: bgamari
      Subscribers: simonpj, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5357
    • Tamar Christina's avatar
      testuite: update more windows tests outputs · 67277e7c
      Tamar Christina authored
      Test Plan: ./validate
      Reviewers: bgamari, simonmar
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5362