1. 02 Feb, 2018 1 commit
  2. 01 Feb, 2018 1 commit
    • takano-akio's avatar
      Implement BlockArguments (#10843) · be84823b
      takano-akio authored
      This patch implements the BlockArguments extension, as proposed at
      https://github.com/ghc-proposals/ghc-proposals/pull/90. It also
      fixes #10855 as a side-effect.
      
      This patch adds a large number of shift-reduce conflicts to the parser.
      All of them concern the ambiguity as to where constructs like `if` and
      `let` end. Fortunately they are resolved correctly by preferring shift.
      
      The patch is based on @gibiansky's ArgumentDo implementation (D1219).
      
      Test Plan: ./validate
      
      Reviewers: goldfire, bgamari, alanz, mpickering
      
      Reviewed By: bgamari, mpickering
      
      Subscribers: Wizek, dfeuer, gibiansky, rwbarton, thomie, mpickering, carter
      
      GHC Trac Issues: #10843, #10855
      
      Differential Revision: https://phabricator.haskell.org/D4260
      be84823b
  3. 21 Jan, 2018 1 commit
    • Takenobu Tani's avatar
      Implement underscores in numeric literals (NumericUnderscores extension) · 4a13c5b1
      Takenobu Tani authored
      Implement the proposal of underscores in numeric literals.
      Underscores in numeric literals are simply ignored.
      
      The specification of the feature is available here:
      https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/000
      9-numeric-underscores.rst
      
      For a discussion of the various choices:
      https://github.com/ghc-proposals/ghc-proposals/pull/76
      
      Implementation detail:
      
      * Added dynamic flag
        * `NumericUnderscores` extension flag is added for this feature.
      
      * Alex "Regular expression macros" in Lexer.x
        * Add `@numspc` (numeric spacer) macro to represent multiple
          underscores.
        * Modify `@decimal`, `@decimal`, `@binary`, `@octal`, `@hexadecimal`,
          `@exponent`, and `@bin_exponent` macros to include `@numspc`.
      
      * Alex "Rules" in Lexer.x
        * To be simpler, we have only the definitions with underscores.
          And then we have a separate function (`tok_integral` and `tok_frac`)
          that validates the literals.
      
      * Validation functions in Lexer.x
        * `tok_integral` and `tok_frac` functions validate
          whether contain underscores or not.
          If `NumericUnderscores` extensions are not enabled,
          check that there are no underscores.
        * `tok_frac` function is created by merging `strtoken` and
          `init_strtoken`.
        * `init_strtoken` is deleted. Because it is no longer used.
      
      * Remove underscores from target literal string
        * `parseUnsignedInteger`, `readRational__`, and `readHexRational} use
          the customized `span'` function to remove underscores.
      
      * Added Testcase
        * testcase for NumericUnderscores enabled.
            NumericUnderscores0.hs and NumericUnderscores1.hs
        * testcase for NumericUnderscores disabled.
            NoNumericUnderscores0.hs and NoNumericUnderscores1.hs
        * testcase to invalid pattern for NumericUnderscores enabled.
            NumericUnderscoresFail0.hs and NumericUnderscoresFail1.hs
      
      Test Plan: `validate` including the above testcase
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: carter, rwbarton, thomie
      
      GHC Trac Issues: #14473
      
      Differential Revision: https://phabricator.haskell.org/D4235
      4a13c5b1
  4. 15 Jan, 2018 1 commit
  5. 11 Dec, 2017 1 commit
    • David Feuer's avatar
      Allow users to ignore optimization changes · 708ed9ca
      David Feuer authored
      * Add a new flag, `-fignore-optim-changes`, allowing them to avoid
        recompilation if the only changes are to the `-O` level or to
        flags controlling optimizations.
      
      * When `-fignore-optim-changes` is *off*, recompile when optimization
        flags (e.g., `-fno-full-laziness`) change. Previously, we ignored
        these unconditionally when deciding whether to recompile a module.
      
      Reviewers: austin, bgamari, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: duog, carter, simonmar, rwbarton, thomie
      
      GHC Trac Issues: #13604
      
      Differential Revision: https://phabricator.haskell.org/D4123
      708ed9ca
  6. 18 Nov, 2017 1 commit
    • niteria's avatar
      Fix T4437 · 912a72d2
      niteria authored
      This test tests if the flags are in sync between GHC and
      Cabal.
      After b0b80e90 'Implement the basics of hex floating point
      literals' landed, the Cabal side had to be updated. That
      has been done, and 835d8ddb 'GHC.Prim use virtual-modules'
      brought the Cabal submodule up to date.
      912a72d2
  7. 15 Nov, 2017 1 commit
    • Peter Trommler's avatar
      RTS: Disable warnings in ffi.h · 8b1020ed
      Peter Trommler authored
      The update of GHC's in-tree libffi causes warnings about
      undefined macros and hence validate fails.
      
      Also mark broken tests that have a ticket.
      
      Fixes #14353
      
      Test Plan: ./validate (on AIX and powerpc if possible)
      
      Reviewers: bgamari, hvr, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: snowleopard, rwbarton, thomie
      
      GHC Trac Issues: #14353, #11259, #14455, #11261
      
      Differential Revision: https://phabricator.haskell.org/D4181
      8b1020ed
  8. 09 Nov, 2017 1 commit
    • Tamar Christina's avatar
      Update Win32 version for GHC 8.4. · bdd2d286
      Tamar Christina authored
      Update to Win32 2.6 which is the expected version release for 8.4
      
      This involves moving Cabal forward which brings some backwards incompatible
      changes that needs various fixups.
      
      Bump a bunch of submodules
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari, angerman
      
      Reviewed By: bgamari, angerman
      
      Subscribers: angerman, thomie, rwbarton
      
      Differential Revision: https://phabricator.haskell.org/D4133
      bdd2d286
  9. 06 Nov, 2017 1 commit
    • Ben Gamari's avatar
      DynFlags: Introduce -show-mods-loaded flag · 8613e61d
      Ben Gamari authored
      This flag reintroduces the verbose module name output produced by GHCi's
      :load command behind a new flag, -show-mods-loaded. This was originally
      removed in D3651 but apparently some tools (e.g. haskell-mode) rely on
      this output.
      
      Addresses #14427.
      
      Test Plan: Validate
      
      Reviewers: svenpanne
      
      Reviewed By: svenpanne
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D4164
      8613e61d
  10. 02 Nov, 2017 2 commits
  11. 16 Oct, 2017 1 commit
  12. 21 Sep, 2017 1 commit
  13. 22 Aug, 2017 1 commit
    • Edward Z. Yang's avatar
      Fix incorrect retypecheck loop in -j (#14075) · 4717ce86
      Edward Z. Yang authored
      The parallel codepath was incorrectly retypechecking the
      hs-boot ModIface prior to typechecking the hs file,
      which was inconsistent with the non-parallel case.  The
      non-parallel case gets it right: you don't want to retypecheck
      the hs-boot file itself (forwarding its declarations to hs)
      because you need it to be consistently knot-tied with itself
      when you compare the interfaces.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, simonpj, austin
      
      Reviewed By: bgamari
      
      Subscribers: duog, rwbarton, thomie
      
      GHC Trac Issues: #14075
      
      Differential Revision: https://phabricator.haskell.org/D3815
      4717ce86
  14. 28 Jul, 2017 1 commit
  15. 23 Jul, 2017 1 commit
  16. 20 Jul, 2017 1 commit
  17. 11 Jul, 2017 1 commit
    • Ömer Sinan Ağacan's avatar
      Mention which -Werror promoted a warning to an error · 4befb415
      Ömer Sinan Ağacan authored
      Previously -Werror or -Werror=flag printed warnings as usual and then
      printed
      these two lines:
      
          <no location info>: error:
          Failing due to -Werror.
      
      This is not ideal: first, it's not clear which flag made one of the
      warnings an
      error. Second, warning messages are not modified in any way, so there's
      no way
      to know which warnings caused this error.
      
      With this patch we (1) promote warning messages to error messages if a
      relevant
      -Werror is enabled (2) mention which -Werror is used during this
      promotion.
      
      Previously:
      
          [1 of 1] Compiling Main             ( test.hs, test.o )
      
          test.hs:9:10: warning: [-Wincomplete-patterns]
              Pattern match(es) are non-exhaustive
              In a case alternative: Patterns not matched: (C2 _)
            |
          9 | sInt s = case s of
            |          ^^^^^^^^^...
      
          test.hs:12:14: warning: [-Wmissing-fields]
              • Fields of ‘Rec’ not initialised: f2
              • In the first argument of ‘print’, namely ‘Rec {f1 =
      1}’
                In the expression: print Rec {f1 = 1}
                In an equation for ‘main’: main = print Rec {f1 = 1}
             |
          12 | main = print Rec{ f1 = 1 }
             |              ^^^^^^^^^^^^^
      
          <no location info>: error:
          Failing due to -Werror.
      
      Now:
      
          [1 of 1] Compiling Main             ( test.hs, test.o )
      
          test.hs:9:10: error: [-Wincomplete-patterns,
      -Werror=incomplete-patterns]
              Pattern match(es) are non-exhaustive
              In a case alternative: Patterns not matched: (C2 _)
            |
          9 | sInt s = case s of
            |          ^^^^^^^^^...
      
          test.hs:12:14: error: [-Wmissing-fields, -Werror=missing-fields]
              • Fields of ‘Rec’ not initialised: f2
              • In the first argument of ‘print’, namely ‘Rec {f1 =
      1}’
                In the expression: print Rec {f1 = 1}
                In an equation for ‘main’: main = print Rec {f1 = 1}
             |
          12 | main = print Rec{ f1 = 1 }
             |              ^^^^^^^^^^^^^
      
      Test Plan: - Update old tests, add new tests if there aren't any
      relevant tests
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3709
      4befb415
  18. 03 Jul, 2017 1 commit
  19. 21 Jun, 2017 1 commit
  20. 12 Jun, 2017 1 commit
  21. 05 Jun, 2017 1 commit
    • Douglas Wilson's avatar
      Desugar modules compiled with -fno-code · c9eb4385
      Douglas Wilson authored
      Previously modules with hscTarget == HscNothing were not desugared.
      This patch changes behavior so that all modules HsSrcFile Modules except GHC.Prim
      are desugared. Modules with hscTarget == HscNothing are not simplified.
      
      Warnings and errors produced by the desugarer will now be produced when
      compiling with -fno-code.
      
      HscMain.finishTypecheckingOnly is removed, HscMain.hscIncrementalCompile is
      simplified a bit, and HscMain.finish takes in the removed logic. I think this
      is easier to follow.
      
      Updates haddock submodule.
      
      Tests T8101, T8101b, T10600 are no longer expect_broken.
      
      Reviewers: ezyang, austin, bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #10600
      
      Differential Revision: https://phabricator.haskell.org/D3542
      c9eb4385
  22. 07 May, 2017 1 commit
    • Douglas Wilson's avatar
      testsuite: add new test for desugar warnings/errors with -fno-code · baa18def
      Douglas Wilson authored
      Add a new (expect_broken) test T10600 that checks that the error:
      Top-level bindings for unlifted types aren't allowed: is thrown when
      compiling with -fno-code. This test currently fails because modules
      compiled with -fno-code aren't desugared. There are several other errors
      which can be thrown during desugaring that aren't tested for,
      discoverable by grepping for "errDs".
      
      Update .stderr files T8101 and T8101b. Presumably the compilation output
      has changed slightly since they were written.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #10600, #8101
      
      Differential Revision: https://phabricator.haskell.org/D3533
      baa18def
  23. 18 Apr, 2017 1 commit
  24. 10 Mar, 2017 1 commit
    • Simon Peyton Jones's avatar
      Fix TcSimplify.decideQuantification for kind variables · 7e96526a
      Simon Peyton Jones authored
      TcSimplify.decideQuantification was doing the Wrong Thing when
      "growing" the type variables to quantify over. We were trying to do
      this on a tyvar set where we'd split off the dependent type varaibles;
      and we just got it wrong.  A kind variable wasn't being generalised
      properly, with confusing knock on consequences.
      
      All this led to Trac #13371 and Trac #13393.
      
      This commit tidies it all up:
      
      * The type TcDepVars is renamed as CandidateQTvs;
        and splitDepVarsOfType to candidateQTyVarsOfType
      
      * The code in TcSimplify.decideQuantification is simpler.
        It no longer does the tricky "grow" stuff over TcDepVars.
        Instead it use ordinary VarSets (thereby eliminating the
        nasty growThetaTyVarsDSet) and uses that to filter the
        result of candidateQTyVarsOfType.
      
      * I documented that candidateQTyVarsOfType returns the type
        variables in a good order in which to quantify, and rewrote
        it to use an accumulator pattern, so that we would predicatably
        get left-to-right ordering.
      
      In doing all this I also made UniqDFM behave a little more nicely:
      
      * When inserting an element that is there already, keep the old tag,
        while still overwriting with the new value.
      
      * This means that when doing udfmToList we get back elements in the
        order they were originally inserted, rather than in reverse order.
      
      It's not a big deal, but in a subsequent commit I use it to improve
      the order of type variables in inferred types.
      
      All this led to a lot of error message wibbles:
       - changing the order of quantified variables
       - changing the order in which instances are listed in GHCi
       - changing the tidying of variables in typechecker erors
      
      There's a submodule update for 'array' because one of its tests
      has an error-message change.
      
      I may not have associated all of them with the correct commit.
      7e96526a
  25. 06 Mar, 2017 1 commit
  26. 03 Mar, 2017 1 commit
    • Simon Marlow's avatar
      Add -fwhole-archive-hs-libs · a6874e54
      Simon Marlow authored
      We're building a demo to show how to hot-swap Haskell code in a
      running process, and unfortunately it wasn't possible to convince GHC
      to generate the correct linker command line without this extra knob.
      
      Test Plan:
      Tested it on a hot-swapping demo (which is not released yet, but will
      be shortly)
      
      Reviewers: niteria, austin, erikd, JonCoens, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: Phyx, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3136
      a6874e54
  27. 28 Feb, 2017 1 commit
  28. 26 Feb, 2017 2 commits
    • rwbarton's avatar
      tests: remove extra_files.py (#12223) · 3415bcaa
      rwbarton authored
      The script I used is included as testsuite/driver/kill_extra_files.py,
      though at this point it is for mostly historical interest.
      
      Some of the tests in libraries/hpc relied on extra_files.py, so this
      commit includes an update to that submodule.
      
      One test in libraries/process also relies on extra_files.py, but we
      cannot update that submodule so easily, so for now we special-case it
      in the test driver.
      3415bcaa
    • rwbarton's avatar
      tests: manually move some extra_files into *.T files · 98119f5a
      rwbarton authored
      Some of the *.T files were in libraries/hpc, so this contains an
      update to that submodule.
      98119f5a
  29. 22 Feb, 2017 2 commits
  30. 20 Feb, 2017 1 commit
  31. 30 Jan, 2017 1 commit
    • Matthew Pickering's avatar
      Add a flag to emit error messages as JSON · 91691117
      Matthew Pickering authored
      This patch adds the flag `-ddump-json` which dumps all the compiler
      output as a JSON array. This allows tooling to more easily parse GHC's
      output to display to users.
      
      The flag is currently experimental and will hopefully be refined for the
      next release.  In particular I have avoided any changes which involve
      significant refactoring and provided what is easy given the current
      infrastructure.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: DanielG, gracjan, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3010
      
      GHC Trac Issues: #13190
      91691117
  32. 22 Jan, 2017 1 commit
  33. 20 Jan, 2017 1 commit
  34. 18 Jan, 2017 2 commits
  35. 17 Jan, 2017 1 commit
  36. 15 Jan, 2017 1 commit
    • Tamar Christina's avatar
      Use latin1 code page on Windows for response files. · f63c8ef3
      Tamar Christina authored
      Summary:
      D2917 added a change that will make paths on Windows response files
      use DOS 8.3 shortnames to get around the fact that `libiberty` assumes
      a one byte per character encoding.
      
      This is actually not the problem, the actual problem is that GCC on
      Windows doesn't seem to support Unicode at all.
      
      This comes down to how unicode characters are handled between POSIX and
      Windows. On Windows, Unicode is only supported using a multibyte character
      encoding such as `wchar_t` with calls to the appropriate wide version of
      APIs (name post-fixed with the `W` character). On Posix I believe the standard
      `char` is used and based on the value it is decoded to the correct string.
      
      GCC doesn't seem to make calls to the Wide version of the Windows APIs,
      and even if it did, it's character representation would be wrong. So I
      believe GCC just does not support utf-8 paths on Windows.
      
      So the hack in D2917 is the only way to get Unicode support. The problem is
      however that `GCC` is not the only tool with this issue and we don't use response
      files for every invocation of the tools. Most of the tools probably don't support it.
      
      Furthermore, DOS 8.1 shortnames only exist when the path or file physically exists on
      disk. We pass lots of paths to GCC that don't exist yet, like the output file.
      D2917 works around this by splitting the path from the file and try shortening that.
      
      But this may not always work.
      
      In short, even if we do Unicode correctly (which we don't atm, the GCC driver we build
      uses `char` instead of `wchar_t`) we won't be able to compile using unicode paths that
      need to be passed to `GCC`. So not sure about the point of D2917.
      
      What we can do is support the most common non-ascii characters by writing the response
      files out using the `latin1` code page.
      
      Test Plan: compile + make test TEST=T12971
      
      Reviewers: austin, bgamari, erikd
      
      Reviewed By: bgamari
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2942
      
      GHC Trac Issues: #12971
      f63c8ef3