1. 02 Mar, 2015 3 commits
  2. 23 Feb, 2015 4 commits
    • Oleg Grenrus's avatar
      driver: split -fwarn-unused-binds into 3 flags (fixes #17) · aead0190
      Oleg Grenrus authored
      Summary: New flags:
      
       -fwarn-unused-top-binds
       -fwarn-unused-local-binds
       -fwarn-unused-pattern-binds
      
      Test Plan: `tests/rename/should_compile/T17` tests
      
      Correct other tests
      
      Reviewers: austin, rwbarton
      
      Reviewed By: austin, rwbarton
      
      Subscribers: rwbarton, carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D591
      
      GHC Trac Issues: #17
      aead0190
    • thomie's avatar
      Show '#' on unboxed literals · 47175e06
      thomie authored
      Test Plan: deriving/should_run/T10104
      
      Reviewers: austin, jstolarek
      
      Reviewed By: austin, jstolarek
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D672
      
      GHC Trac Issues: #10104
      47175e06
    • thomie's avatar
      Declare some Makefile targets to be PHONY · a0ef626e
      thomie authored
      Summary:
      Given:
        a Makefile with a non-PHONY target called `target`
      If:
        after running `make target`, a file exists with the same name as `target`
        (it was either already there, or it was created by running `make target`)
      And:
        `target` has no dependencies, such as `clean`, that modify or delete that
        file
      Then:
        subsequent invocations of `make target` will not have any effect.
      
      Solution: make `target` PHONY.
      
      BAD:
        ```
        foo:
                ...
                ./foo
        ```
      
      BETTER:
        ```
        foo:
                ...
                ./foo
        .PHONY: foo
        ```
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D670
      a0ef626e
    • thomie's avatar
      Error out on `Main` without `main` in GHCi (#7765) · 0fa20726
      thomie authored
      Summary:
      GHC does 2 validation checks for module `Main`:
      * does `main` exist
      * is `main` exported (#414)
      
      The second check is done in ghc as well as in ghci (and runghc and ghc -e).
      The first check however is currently not done in ghci, to prevent "'main' is
      not in scope" errors when loading simple scripts. See commit d28ba8c8 for
      more information.
      
      This commit tightens the special case for ghci. When the file does not contain
      a main function, but does contain an explicit module header (i.e. "module Main
      where"), then /do/ raise an error in ghci (and runghc and ghc -e) as well
      
      Test Plan:
      module/T7765: a module Main with an explicit module header but without a
      main function should be an error for all Ways.
      
      Additionaly: delete test module/mod174. It was added in commit 5a54c38e, but it
      is a duplicate of module/T414.
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D649
      
      GHC Trac Issues: #7765
      0fa20726
  3. 20 Feb, 2015 2 commits
  4. 19 Feb, 2015 2 commits
    • kgardas's avatar
      fix T7600 run on bigendian platform · 3f30912f
      kgardas authored
      3f30912f
    • thomasw's avatar
      Fix #10045 · e9d72cef
      thomasw authored
      Summary:
      SPJ's solution is to only bring the `TcId` (which includes the type) of a
      binder into scope when it had a non-partial type signature.
      
      Take care of this by only storing the `TcId` in `TcSigInfo` of non-partial
      type signatures, hence the change to `sig_poly_id :: Maybe TcId`. Only in case
      of a `Just` will we bring the `TcId` in scope. We still need to know the name
      of the binder, even when it has a partial type signature, so add a `sig_name
      :: Name` field. The field `sig_partial :: Bool` is no longer necessary, so
      reimplement `isPartialSig` in terms of `sig_poly_id`.
      
      Note that the new test case fails, but not because of a panic, but because the
      `Num a` constraint is missing. Adding an extra-constraints wildcard to
      `copy`'s signature would fix it.
      
      Test Plan: validate
      
      Reviewers: simonpj, austin
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D646
      
      GHC Trac Issues: #10045
      e9d72cef
  5. 17 Feb, 2015 1 commit
    • thomie's avatar
      Don't truncate traceEvents to 512 bytes (#8309) · a82364c9
      thomie authored
      Summary:
      Don't call postLogMsg to post a user msg, because it truncates messages to
      512 bytes.
      
      Rename traceCap_stderr and trace_stderr to vtraceCap_stderr and trace_stderr,
      to signal that they take a va_list (similar to vdebugBelch vs debugBelch).
      
      See #3874 for the original reason behind traceFormatUserMsg.
      
      See the commit msg in #9395 (d360d440) for a discussion about using
      null-terminated strings vs strings with an explicit length.
      
      Test Plan:
      Run `cabal install ghc-events` and inspect the result of `ghc-events show` on
      an eventlog file created with `ghc -eventlog Test.hs` and `./Test +RTS -l`,
      where Test.hs contains:
      
      ```
      import Debug.Trace
      main = traceEvent (replicate 510 'a' ++ "bcd") $ return ()
      ```
      
      Depends on D655.
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D656
      
      GHC Trac Issues: #8309
      a82364c9
  6. 15 Feb, 2015 1 commit
  7. 13 Feb, 2015 1 commit
    • Simon Peyton Jones's avatar
      Refactor decideQuantification · b96db75c
      Simon Peyton Jones authored
      Richard was interrogating me about decideQuantification yesterday.
      I got a bit stuck on the promote_tvs part. This refactoring
      
       * simplifes the API of decideQuantification
      
       * move mkMinimalBySCs into decideQuantification (a better place for it)
      
       * moves promotion out of decideQuantification (where it didn't really
         fit), and comments much more fully what is going on with the promtion stuff
      
       * comments decideQuantification more fully
      
       * coments the EqPred case of quantifyPred more fully
      
      It turned out that the theta returned by decideQuantification,
      and hence by simplifyInfer, is now fully zonked, so I could remove
      a zonking in TcBinds.
      b96db75c
  8. 11 Feb, 2015 4 commits
  9. 10 Feb, 2015 3 commits
    • Simon Peyton Jones's avatar
      1d982ba1
    • Simon Peyton Jones's avatar
      Refactor the handling of quasi-quotes · f46360ed
      Simon Peyton Jones authored
      As Trac #10047 points out, a quasi-quotation [n|...blah...|] is supposed
      to behave exactly like $(n "...blah...").  But it doesn't!  This was outright
      wrong: quasiquotes were being run even inside brackets.
      
      Now that TH supports both typed and untyped splices, a quasi-quote is properly
      regarded as a particular syntax for an untyped splice. But apart from that
      they should be treated the same.  So this patch refactors the handling of
      quasiquotes to do just that.
      
      The changes touch quite a lot of files, but mostly in a routine way.
      The biggest changes by far are in RnSplice, and more minor changes in
      TcSplice.  These are the places where there was real work to be done.
      Everything else is routine knock-on changes.
      
      * No more QuasiQuote forms in declarations, expressions, types, etc.
        So we get rid of these data constructors
          * HsBinds.QuasiQuoteD
          * HsExpr.HsSpliceE
          * HsPat.QuasiQuotePat
          * HsType.HsQuasiQuoteTy
      
      * We get rid of the HsQuasiQuote type altogether
      
      * Instead, we augment the HsExpr.HsSplice type to have three
        consructors, for the three types of splice:
          * HsTypedSplice
          * HsUntypedSplice
          * HsQuasiQuote
        There are some related changes in the data types in HsExpr near HsSplice.
        Specifically: PendingRnSplice, PendingTcSplice, UntypedSpliceFlavour.
      
      * In Hooks, we combine rnQuasiQuoteHook and rnRnSpliceHook into one.
        A smaller, clearer interface.
      
      * We have to update the Haddock submodule, to accommodate the hsSyn changes
      f46360ed
    • Rufflewind's avatar
      Don't overwrite input file by default · 78833ca6
      Rufflewind authored
      Summary:
      If the default filename of the output executable coincides with that of main
      source file, throw an error instead of silently clobbering the input file.
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D642
      
      GHC Trac Issues: #9930
      78833ca6
  10. 06 Feb, 2015 4 commits
  11. 05 Feb, 2015 2 commits
  12. 04 Feb, 2015 1 commit
    • Simon Marlow's avatar
      Fix a profiling bug · daed18c3
      Simon Marlow authored
      Summary:
      We were erroneously discarding SCCs on function-typed variables.
      These can affect the call stack, so we have to retain them.  The bug
      was introduced during the recent SourceNote refactoring.
      
      This is an alternative to the fix proposed in D616.  I also added the
      scc005 test from that diff, which works with this change.
      
      While I was here, I also fixed up the other profiling tests, marking a
      few as expect_broken_for(10037) where the opt/unopt output differs in
      non-fatal ways.
      
      Test Plan: profiling tests
      
      Reviewers: scpmw, ezyang, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D636
      
      GHC Trac Issues: #10007
      daed18c3
  13. 02 Feb, 2015 1 commit
    • AndreasVoellmy's avatar
      Fix #10017 · 92c93544
      AndreasVoellmy authored
      Summary:
      In the threaded RTS, a signal is delivered from the RTS to Haskell
      user code by writing to file that one of the IO managers watches (via
      an instance of GHC.Event.Control.Control). When the IO manager
      receives the signal, it calls GHC.Conc.Signal.runHandlers to invoke
      Haskell signal handler. In the move from a single IO manager to one IO
      manager per capability, the behavior was (wrongly) extended so that a
      signal is delivered to every event manager (see #9423), each of which
      invoke Haskell signal handlers, leading to multiple invocations of
      Haskell signal handlers for a single signal. This change fixes this
      problem by having the RTS (in generic_handler()) notify only the
      Control instance used by the TimerManager, rather than all the
      per-capability IO managers.
      
      Reviewers: austin, hvr, simonmar, Mikolaj
      
      Reviewed By: simonmar, Mikolaj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D641
      92c93544
  14. 28 Jan, 2015 1 commit
  15. 27 Jan, 2015 1 commit
  16. 22 Jan, 2015 3 commits
  17. 20 Jan, 2015 3 commits
  18. 19 Jan, 2015 3 commits
    • Eric Seidel's avatar
      Expose source locations via Implicit Parameters of type GHC.Location.Location · c024af13
      Eric Seidel authored
      Summary:
      IPs with this type will always be solved for the current source
      location. If another IP of the same type is in scope, the two locations will be
      appended, creating a call-stack. The Location type is kept abstract so users
      cannot create them, but a Location can be turned into a list of SrcLocs, which
      correspond to individual locations in a program. Each SrcLoc contains a
      package/module/file name and start/end lines and columns.
      
      The only thing missing from the SrcLoc in my opinion is the name of the
      top-level definition it inhabits. I suspect that would also be useful, but it's
      not clear to me how to extract the current top-level binder from within the
      constraint solver. (Surely I'm just missing something here?)
      
      I made the (perhaps controversial) decision to have GHC completely ignore
      the names of Location IPs, meaning that in the following code:
      
          bar :: (?myloc :: Location) => String
          bar = foo
      
          foo :: (?loc :: Location) => String
          foo = show ?loc
      
      if I call `bar`, the resulting call-stack will include locations for
      
      1. the use of `?loc` inside `foo`,
      2. `foo`s call-site inside `bar`, and
      3. `bar`s call-site, wherever that may be.
      
      This makes Location IPs very special indeed, and I'm happy to change it if the
      dissonance is too great.
      
      I've also left out any changes to base to make use of Location IPs, since there
      were some concerns about a snowball effect. I think it would be reasonable to
      mark this as an experimental feature for now (it is!), and defer using it in
      base until we have more experience with it. It is, after all, quite easy to
      define your own version of `error`, `undefined`, etc. that use Location IPs.
      
      Test Plan: validate, new test-case is testsuite/tests/typecheck/should_run/IPLocation.hs
      
      Reviewers: austin, hvr, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonmar, rodlogic, carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D578
      
      GHC Trac Issues: #9049
      c024af13
    • Alan Zimmerman's avatar
      API Annotations documentation update, parsing issue, add example test · 851ed721
      Alan Zimmerman authored
      Summary:
      Add a reference note to each AnnKeywordId haddock comment so GHC
      developers will have an idea why they are there.
      
      Add a new test to ghc-api/annotations to serve as a template for other
      GHC developers when they need to update the parser. It provides output
      which checks that each SrcSpan that an annotation is attached to
      actually appears in the `ParsedSource`, and lists the individual
      annotations. The idea is that a developer writes a version of this
      which parses a sample file using whatever syntax is changed in
      Parser.y, and can then check that all the annotations come through.
      
      Depends on D538
      
      Test Plan: ./validate
      
      Reviewers: simonpj, hvr, austin
      
      Reviewed By: austin
      
      Subscribers: thomie, jstolarek
      
      Differential Revision: https://phabricator.haskell.org/D620
      851ed721
    • Austin Seipp's avatar
      960e3c92