1. 16 Jan, 2015 5 commits
    • Alan Zimmerman's avatar
      API Annotations tweaks. · 11881ec6
      Alan Zimmerman authored
      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
    • Alexander Vershilov's avatar
      Trac #9878: Make the static form illegal in interpreted mode. · fffbf062
      Alexander Vershilov authored
      The entries of the static pointers table are expected to exist as
      object code. Thus we have ghci complain with an intelligible error
      message if the static form is used in interpreted mode.
      It also includes a fix to keysHashTable in Hash.c which could cause a
      crash. The iteration of the hashtable internals was incorrect. This
      patch has the function keysHashTable imitate the iteration in
      Finally, we submit here some minor edits to comments and
      GHC.StaticPtr.StaticPtrInfo field names.
      Authored-by: Alexander Vershilov <alexander.vershilov@tweag.
      Authored-by: default avatarFacundo Domínguez <facundo.dominguez@tweag.io>
      Test Plan: ./validate
      Reviewers: simonpj, hvr, austin
      Reviewed By: austin
      Subscribers: carter, thomie, qnikst, mboes
      Differential Revision: https://phabricator.haskell.org/D586
      GHC Trac Issues: #9878
    • Edsko de Vries's avatar
      Don't hardcode the name "ghc" in versionedAppDir · 6392df07
      Edsko de Vries authored
      Reviewers: austin
      Reviewed By: austin
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D618
    • Simon Peyton Jones's avatar
      Fix a terrible bug in the canonicaliser which led to an infinite loop · 854e7b8e
      Simon Peyton Jones authored
      This fixes Trac #9971
      Merge into the 7.10 branch
    • Simon Peyton Jones's avatar
      Repsect the package name when checking for self-import · fb7c3117
      Simon Peyton Jones authored
      Fixes Trac #9997.
      In doing this I tripped across the specialness of "this" in
      PackageImports.  The magic constant (fsLit "this") is scattered across
      the compiler and ought to be put in one place.  But where?
  2. 14 Jan, 2015 4 commits
  3. 13 Jan, 2015 5 commits
    • Peter Wortmann's avatar
      Dwarf generation fixed pt 2 · 36df0988
      Peter Wortmann authored
      - Don't bracket HsTick expression uneccessarily
      - Generate debug information in UTF8
      - Reduce amount of information generated - we do not currently need
        block information, for example.
      Special thanks to slyfox for the reports!
    • thomasw's avatar
      Fix panics of PartialTypeSignatures combined with extensions · c9532f81
      thomasw authored
      Disallow wildcards in stand-alone deriving instances
      (StandaloneDeriving), default signatures (DefaultSignatures) and
      instances signatures (InstanceSigs).
      Test Plan: validate
      Reviewers: austin
      Reviewed By: austin
      Subscribers: carter, thomie, monoidal
      Differential Revision: https://phabricator.haskell.org/D595
      GHC Trac Issues: #9922
    • Alexander Vershilov's avatar
      Trac #9878: Have StaticPointers support dynamic loading. · 7637810a
      Alexander Vershilov authored
      A mutex is used to protect the SPT.
      unsafeLookupStaticPtr and staticPtrKeys in GHC.StaticPtr are made
      SPT entries are removed in a destructor function of modules.
      Authored-by: default avatarFacundo Domínguez <facundo.dominguez@tweag.io>
      Authored-by: default avatarAlexander Vershilov <alexander.vershilov@tweag.io>
      Test Plan: ./validate
      Reviewers: austin, simonpj, hvr
      Subscribers: carter, thomie, qnikst, mboes
      Differential Revision: https://phabricator.haskell.org/D587
      GHC Trac Issues: #9878
    • Edsko de Vries's avatar
      Package environments · 099b7676
      Edsko de Vries authored
      Summary: Package environments are files with package IDs that indicate which packages should be visible; see entry in user guide for details.
      Reviewers: duncan, austin
      Reviewed By: duncan, austin
      Subscribers: carter, thomie
      Differential Revision: https://phabricator.haskell.org/D558
    • GregWeber's avatar
      add -th-file which generates a th.hs file · 07ace5c2
      GregWeber authored
      see Trac #8624
      similar functionality is now available
      with -ddump-to-file -ddump-splices
      However, users are already accustomed to -ddump-splices
      having a particular format, and this format is not completely valid code
      The goal of -th-file is to dump valid Haskell code
      Additionally, the convention of -ddump-to-file is to name the file after
      the flag, so the file is .dump-splices
      Given that the goal of the new flag is to generate valid Haskell,
      The extension should be .hs
      Additionally, -ddump-to-file effects all other dump flags
      Test Plan:
      look at the output of using the -th-file flag
      and compare it to the output of using -ddump-to-file and -ddump-splices
      I want to add test cases, but just need some pointers on getting started there
      Reviewers: thomie, goldfire, simonpj, austin
      Reviewed By: simonpj, austin
      Subscribers: thomie, carter
      Differential Revision: https://phabricator.haskell.org/D518
      GHC Trac Issues: #8624
  4. 11 Jan, 2015 1 commit
  5. 09 Jan, 2015 10 commits
  6. 08 Jan, 2015 5 commits
    • Edward Z. Yang's avatar
      Apply GenMap to CoreMap and CoercionMap. · 0bef02e4
      Edward Z. Yang authored
      The biggest chore is the Eq (DeBrujin a) instances (all the more a chore
      because we already have an implementation of them, but a CmEnv is not an
      RnEnv2), but otherwise a fairly mechanical transformation.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      Test Plan: validate
      Reviewers: simonpj, austin
      Subscribers: carter, thomie
      Differential Revision: https://phabricator.haskell.org/D609
      GHC Trac Issues: #9960
    • Edward Z. Yang's avatar
      Add 'DeBruijn' constructor, which generalizes "key modulo alpha-renaming." · ccef0146
      Edward Z. Yang authored
      We need equality over Types, etc; and this equality has to be modulo alpha
      renaming. Previously, we baked CmEnv into the generic "empty, singleton, many"
      structure. This isn't great, really GenMap should be more generic than that.
      The insight: we've defined the key wrong: the key should be *equipped*
      with the alpha-renaming information (CmEnv) and a TrieMap queried with this.
      This is what the DeBruijn constructor does.
      Now, when we define TrieMap instances, we don't have to synthesize an emptyCME
      to pass to the helper functions: we have all the information we need. To make a
      recursive call, we construct a new DeBruijn with the updated CME and then
      call lookupTM on that. We can even define a plain old Eq instance on DeBruijn
      respecting alpha-renaming.  There are number of other good knock-on effects.
      This patch does add a bit of boxing and unboxing, but nothing the optimizer
      shouldn't be able to eliminate.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      Test Plan: validate
      Reviewers: simonpj, austin
      Subscribers: carter, thomie
      Differential Revision: https://phabricator.haskell.org/D608
      GHC Trac Issues: #9960
    • Simon Peyton Jones's avatar
      Improve HsBang · 9564bb8c
      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
    • Simon Peyton Jones's avatar
      Spelling error in comment · 43e5a221
      Simon Peyton Jones authored
    • Edward Z. Yang's avatar
      Fix out of date comment. · b14dae3c
      Edward Z. Yang authored
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
  7. 07 Jan, 2015 2 commits
    • Edward Z. Yang's avatar
      Generalize TrieMap compression to GenMap. · 197f4e5a
      Edward Z. Yang authored
      I still haven't applied the optimization to anything besides TypeMap.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      Depends On: D606
      Reviewers: simonpj, austin
      Subscribers: carter, thomie
      Differential Revision: https://phabricator.haskell.org/D607
      GHC Trac Issues: #9960
    • Edward Z. Yang's avatar
      Compress TypeMap TrieMap leaves with singleton constructor. · da64ab53
      Edward Z. Yang authored
      Suppose we have a handful H of entries in a TrieMap, each with a very large
      key, size K. If you fold over such a TrieMap you'd expect time O(H). That would
      certainly be true of an association list! But with TrieMap we actually have to
      navigate down a long singleton structure to get to the elements, so it takes
      time O(K*H).  The point of a TrieMap is that you need to navigate to the point
      where only one key remains, and then things should be fast.
      This is a starting point: we can improve the patch by generalizing the
      singleton constructor so it applies to CoercionMap and CoreMap; I'll do this
      in a later commit.
      Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
      Test Plan: validate
      Reviewers: simonpj, austin
      Subscribers: carter, thomie
      Differential Revision: https://phabricator.haskell.org/D606
      GHC Trac Issues: #9960
  8. 06 Jan, 2015 8 commits
    • Simon Peyton Jones's avatar
    • Simon Peyton Jones's avatar
      Test Trac #9939 · c790fe87
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
    • Simon Peyton Jones's avatar
      Major patch to add -fwarn-redundant-constraints · 32973bf3
      Simon Peyton Jones authored
      The idea was promted by Trac #9939, but it was Christmas, so I did
      some recreational programming that went much further.
      The idea is to warn when a constraint in a user-supplied context is
      redundant.  Everything is described in detail in
        Note [Tracking redundant constraints]
      in TcSimplify.
      Main changes:
       * The new ic_status field in an implication, of type ImplicStatus.
         It replaces ic_insol, and includes information about redundant
       * New function TcSimplify.setImplicationStatus sets the ic_status.
       * TcSigInfo has sig_report_redundant field to say whenther a
         redundant constraint should be reported; and similarly
         the FunSigCtxt constructor of UserTypeCtxt
       * EvBinds has a field eb_is_given, to record whether it is a given
         or wanted binding. Some consequential chagnes to creating an evidence
         binding (so that we record whether it is given or wanted).
       * AbsBinds field abs_ev_binds is now a *list* of TcEvBiinds;
         see Note [Typechecking plan for instance declarations] in
       * Some significant changes to the type checking of instance
         declarations; Note [Typechecking plan for instance declarations]
         in TcInstDcls.
       * I found that TcErrors.relevantBindings was failing to zonk the
         origin of the constraint it was looking at, and hence failing to
         find some relevant bindings.  Easy to fix, and orthogonal to
         everything else, but hard to disentangle.
      Some minor refactorig:
       * TcMType.newSimpleWanteds moves to Inst, renamed as newWanteds
       * TcClassDcl and TcInstDcls now have their own code for typechecking
         a method body, rather than sharing a single function. The shared
         function (ws TcClassDcl.tcInstanceMethodBody) didn't have much code
         and the differences were growing confusing.
       * Add new function TcRnMonad.pushLevelAndCaptureConstraints, and
         use it
       * Add new function Bag.catBagMaybes, and use it in TcSimplify
    • Simon Peyton Jones's avatar
      Print singleton consraints without parens · da9b2ec3
      Simon Peyton Jones authored
      The main change is in TypeRep.pprTheta, so we print
             Eq a
      for a singleton, but
            (Eq a, Show a)
      for multiple constraints.
      There are lots of trivial knock-on changes to error messages
    • Simon Peyton Jones's avatar
      Use a less fragile method for defaulting · d4f460fe
      Simon Peyton Jones authored
      When doing top-level defaulting, in TcSimplify.applyDefaultingRules, we
      were temporarily making a unification variable equal to the default type
      (Integer, say, or Float), as a 'given', and trying to solve. But this
      relied on the unification variable being untouchable, which seems
      complicated.  It's much simpler just to generate a new set of
      constraints to solve, using newWantedEvVarNC in disambigGroup.
      (I tripped over an ASSERT failure, and this solved it in a robust way.)
    • Simon Peyton Jones's avatar
      Always generalise a partial type signature · 28299d68
      Simon Peyton Jones authored
      This fixes an ASSERT failure in TcBinds.  The problem was that we
      were generating NoGen plan for a function with a partial type signature,
      and that led to confusion and lost invariants.
      See Note [Partial type signatures and generalisation] in TcBinds
    • Simon Peyton Jones's avatar
      Replace fixVarSet with transCloVarSet · 8e2ed2c7
      Simon Peyton Jones authored
      I think the new implementation is a bit more efficient, because
      it uses a work-list, rather than iterating over the entire set
      every time