Skip to content
Snippets Groups Projects
  1. Mar 19, 2015
  2. Mar 17, 2015
    • Thomas Miedema's avatar
      Dont call unsafeGlobalDynFlags if it is not set · f92acd8e
      Thomas Miedema authored and thoughtpolice's avatar thoughtpolice committed
      Parsing of static and mode flags happens before any session is started,
      i.e., before the first call to 'GHC.withGhc'. Therefore, to report
      errors for invalid usage of these two types of flags, we can not call
      any function that needs DynFlags, as there are no DynFlags available yet
      (unsafeGlobalDynFlags is not set either). So we always print "on the
      commandline" as the location, which is true except for Api users, which
      is probably ok.
      
      When reporting errors for invalid usage of dynamic flags we /can/ make
      use of DynFlags, and we do so explicitly in
      DynFlags.parseDynamicFlagsFull.
      
      Before, we called unsafeGlobalDynFlags when an invalid (combination of)
      flag(s) was given on the commandline, resulting in panics (#9963). This
      regression was introduced in 1d6124de.
      
      Also rename showSDocSimple to showSDocUnsafe, to hopefully prevent this
      from happening again.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D730
      
      GHC Trac Issues: #9963
      
      (cherry picked from commit 5166ee94)
      f92acd8e
  3. Mar 14, 2015
    • Peter Trommler's avatar
      Link temporary shared objects with `--no-as-needed` · 3ea34922
      Peter Trommler authored and Herbert Valerio Riedel's avatar Herbert Valerio Riedel committed
      Some ELF link editors default to `--as-needed` and record only
      those libraries in DT_NEEDED tags that are needed to resolve
      undefined symbols in the shared object to be created.
      
      In Template Haskell we rely on all symbols that were defined
      in modules compiled so far to be available in the current
      temporary shared object. To prevent the link editor from
      dropping the DT_NEEDED tag for the previously linked temporary
      shared object we need to override the link editors default and
      specify `--no-as-needed` on the command line. This is for GNU ld
      and GOLD ld.
      
      This addresses #10110
      
      TODO: regression test
      
      (cherry picked from commit 1b7f5976)
      3ea34922
  4. Mar 13, 2015
    • Iavor S. Diatchki's avatar
      Custom `Typeable` solver, that keeps track of kinds. · 6f46fe15
      Iavor S. Diatchki authored
      Summary:
      This implements the new `Typeable` solver: when GHC sees `Typeable` constraints
      it solves them on the spot.
      
      The current implementation creates `TyCon` representations on the spot.
      
      Pro: No overhead at all in code that does not use `Typeable`
      Cons: Code that uses `Typeable` may create multipe `TyCon` represntations.
      
      We have discussed an implementation where representations of `TyCons` are
      computed once, in the module, where a datatype is declared.  This would
      lead to more code being generated:  for a promotable datatype we need to
      generate `2 + number_of_data_cons` type-constructro representations,
      and we have to do that for all programs, even ones that do not intend to
      use typeable.
      
      I added code to emit warning whenevar `deriving Typeable` is encountered---
      the idea being that this is not needed anymore, and shold be fixed.
      
      Also, we allow `instance Typeable T` in .hs-boot files, but they result
      in a warning, and are ignored.  This last one was to avoid breaking exisitng
      code, and should become an error, eventually.
      
      Test Plan:
      1. GHC can compile itself.
      2. I compiled a number of large libraries, including `lens`.
          - I had to make some small changes:
            `unordered-containers` uses internals of `TypeReps`, so I had to do a 1 line fix
          - `lens` needed one instance changed, due to a poly-kinded `Typeble` instance
      
      3. I also run some code that uses `syb` to traverse a largish datastrucutre.
      I didn't notice any signifiant performance difference between the 7.8.3 version,
      and this implementation.
      
      Reviewers: simonpj, simonmar, austin, hvr
      
      Reviewed By: austin, hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D652
      
      GHC Trac Issues: #9858
      
      (cherry picked from commit b359c886)
      6f46fe15
  5. Mar 11, 2015
  6. Mar 10, 2015
  7. Mar 09, 2015
  8. Mar 07, 2015
    • Herbert Valerio Riedel's avatar
      Re-export `<$>` from Prelude (#10113) · dc737056
      Herbert Valerio Riedel authored
      Whether to re-export the `<$>` non-method operator from `Prelude` wasn't
      explicitly covered in the original AMP proposal[1], but it turns out that
      not doing so forces most code that makes use of applicatives to import
      `Data.Functor` or `Control.Applicative` just to get that operator into
      scope.  To this end, it was proposed to add `<$>` to Prelude as well[2].
      
      The down-side is that this increases the amount of redundant-import
      warnings triggered, as well as the relatively minor issue of stealing
      the `<$>` operator from the default namespace for good (although at this
      point `<$>` is supposed to be ubiquitous anyway due to `Applicative`
      being implicitly required into the next Haskell Report)
      
       [1]: https://wiki.haskell.org/Functor-Applicative-Monad_Proposal
       [2]: http://thread.gmane.org/gmane.comp.lang.haskell.libraries/24161
      
      (cherry picked from commit eb3661f2)
      dc737056
  9. Feb 23, 2015
  10. Feb 12, 2015
  11. Feb 11, 2015
    • Richard Eisenberg's avatar
      Fix egregious typo in checkTauTvUpdate. · 99706266
      Richard Eisenberg authored
      The old code used an unzonked type in an occurs-check, which
      would sometimes lead to an infinite loop.
      
      Please merge to ghc-7.10.
      
      (cherry picked from commit d5cd94d7)
      99706266
    • Richard Eisenberg's avatar
      Fix #10079 by recurring after flattening exposes a TyConApp. · dfb6b9f8
      Richard Eisenberg authored
      Previously, try_decompose_nom_app was smart enough to recur if
      flattening exposed a TyConApp, but try_decompose_repr_app was
      not. Now, if neither type in try_decompose_repr_app is an AppTy,
      recur.
      
      Seems all straightforward enough to avoid a Note.
      
      (cherry picked from commit befe2d7c)
      dfb6b9f8
    • Simon Peyton Jones's avatar
      nameIsLocalOrFrom should include interactive modules · 4e25dc63
      Simon Peyton Jones authored
      The provoking cause was Trac #10019, but it revealed that nameIsLocalOrFrom
      should really include all interactive modules (ones from the 'interactive'
      package).  Previously we had some ad-hoc 'isInteractiveModule' tests with
      some (but not all) the calls to nameIsLocalOrFrom.
      
      See the new comments with Name.nameIsLocalOrFrom.
      
      (cherry picked from commit 6ff3db92)
      4e25dc63
    • Rufflewind's avatar
      Don't overwrite input file by default · ed4de443
      Rufflewind authored and thoughtpolice's avatar thoughtpolice committed
      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
      
      (cherry picked from commit 78833ca6)
      ed4de443
    • Simon Marlow's avatar
      Fix a profiling bug · 1d401b43
      Simon Marlow authored and thoughtpolice's avatar thoughtpolice committed
      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
      
      (cherry picked from commit daed18c3)
      1d401b43
  12. Feb 09, 2015
  13. Feb 05, 2015
  14. Jan 28, 2015
  15. Jan 23, 2015
    • Peter Wortmann's avatar
      Split stripTicks into expression editing and tick collection · 174082ff
      Peter Wortmann authored
      
      As with stripTicksTop, this is because we often need the stripped
      expression but not the ticks (at least not right away). This makes a big
      difference for CSE, see #9961.
      
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      (cherry picked from commit 55199a97)
    • Alan Zimmerman's avatar
      API Annotations documentation update, parsing issue, add example test · 5eae13b9
      Alan Zimmerman authored and thoughtpolice's avatar thoughtpolice committed
      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
      
      (cherry picked from commit 851ed721)
      5eae13b9
    • Alan Zimmerman's avatar
      API Annotations tweaks. · 1a7621a4
      Alan Zimmerman authored and thoughtpolice's avatar thoughtpolice committed
      Summary:
      HsTyLit now has SourceText
      
      Update documentation of HsSyn to reflect which annotations are attached to which element.
      
      Ensure that the parser always keeps HsSCC and HsTickPragma values, to
      be ignored in the desugar phase if not needed
      
      Bringing in SourceText for pragmas
      
      Add Location in NPlusKPat
      
      Add Location in FunDep
      
      Make RecCon payload Located
      
      Explicitly add AnnVal to RdrName where it is compound
      
      Add Location in IPBind
      
      Add Location to name in IEThingAbs
      
      Add Maybe (Located id,Bool) to Match to track fun_id,infix
        This includes converting Match into a record and adding a note about why
        the fun_id needs to be replicated in the Match.
      
      Add Location in KindedTyVar
      
      Sort out semi-colons for parsing
      
        - import statements
        - stmts
        - decls
        - decls_cls
        - decls_inst
      
      This updates the haddock submodule.
      
      Test Plan: ./validate
      
      Reviewers: hvr, austin, goldfire, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D538
      
      (cherry picked from commit 11881ec6)
      1a7621a4
    • Simon Peyton Jones's avatar
      Correct typos in comments to mkDataCon · 1f934a5b
      Simon Peyton Jones authored
      (cherry picked from commit 0afa37aa)
      1f934a5b
    • Simon Peyton Jones's avatar
      More comments on HsBang · 5651b41e
      Simon Peyton Jones authored
      In particular about the dcSrcBangs field of an imported DataCon
      
      (cherry picked from commit c506f254)
      5651b41e
    • Simon Peyton Jones's avatar
      Return a [HsImplBang] from dataConImplBangs even with NoDataConRep · ccb7d96d
      Simon Peyton Jones authored
      This fixes Trac #9969, a new crash in T7562 that I somehow missed when
      fiddling with HsBang
      
      (cherry picked from commit 327ce1d3)
      ccb7d96d
    • Simon Peyton Jones's avatar
      Improve HsBang · bba041e0
      Simon Peyton Jones authored
      Provoked by questions from Johan
      
       - Improve comments, fix misleading stuff
       - Add commented synonyms for HsSrcBang, HsImplBang, and use them throughout
       - Rename HsUserBang to HsSrcBang
       - Rename dataConStrictMarks to dataConSrcBangs
                dataConRepBangs    to dataConImplBangs
      
      This renaming affects Haddock in a trivial way, hence submodule update
      
      (cherry picked from commit 9564bb8c)
      bba041e0
    • Edward Z. Yang's avatar
      Respect package visibility when deciding wired in packages. · 57df7b31
      Edward Z. Yang authored
      
      Summary:
      Previously, we would consider ALL versions of a wired-in package,
      no matter if they were exposed or not, and pick the latest version.
      This patch is a minor refinement on the behavior: now we try to
      pick the wired in package from just the list of exposed packages,
      and if there are no candidates fall back on the full list.  This
      means that if you do:
      
          -hide-all-packages -package wired-in-OLD-VERSION
      
      it will actually work by default (whereas previously you needed
      to *explicitly* -ignore-package the newer version).  This is especially
      useful for the 'ghc' package.  Fixes #9955.
      
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, austin
      
      Reviewed By: austin
      
      Subscribers: carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D603
      
      GHC Trac Issues: #9955
      
      (cherry picked from commit 1f159519)
      57df7b31
  16. Jan 19, 2015
Loading