1. 18 Feb, 2017 1 commit
  2. 17 Feb, 2017 7 commits
    • Edward Z. Yang's avatar
      Improvements/bugfixes to signature reexport handling. · fd2d5b6d
      Edward Z. Yang authored
      
      
      Summary:
      A number of changes:
      
      - Keep the TcGblEnv from typechecking the local signature
        around when we do merging.  In particular, we setup
        tcg_imports and tcg_rdr_env according to the local
        signature.  This improves our error output (for example,
        see bkpfail04) and also fixes a bug with reexporting
        modules in signatures (see bkpreex07)
      
      - Fix a bug in thinning, where if we had signature A(module A),
        this previously would have *thinned out* all of the inherited
        signatures.  Now we treat every inherited signature as having
        come from an import like "import A", so a module A reexport
        will pick them up.
      
      - Recompilation checking now keeps track of dependent source files
        of the source signature; previously we forgot to retain this
        info.
      
      There's a manual update too.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3133
      fd2d5b6d
    • Edward Z. Yang's avatar
      Fix recompilation tracking on signatures. · 22dba98f
      Edward Z. Yang authored
      
      
      Summary:
      Previously we weren't tracking these dependencies at all,
      because we couldn't "find" the interface for {A.H}.  Now
      we've associated hole names to the correct module identity
      so we will pick them up.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Subscribers: thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3131
      22dba98f
    • Edward Z. Yang's avatar
      Fix a Backpack recompilation avoidance bug when signatures change. · ca543154
      Edward Z. Yang authored
      
      
      Summary:
      Recompilation avoidance checks if -this-unit-id has changed by relying
      on the "wanted module" check in readIface ("Something is amiss...").
      Unfortunately, this check didn't check if the instantiation made
      sense, which meant that if you changed the signatures of a Backpack
      package, we'd still treat the old signatures as up-to-date.
      
      The way I fixed this was by having findAndReadIface take in a 'Module'
      representing the /actual/ module we were intending to lookup.  We
      convert this into the 'Module' we expect to see in 'mi_module' and
      now do a more elaborate check that will also verify that instantiations
      make sense.
      
      Along the way, I robustified the logging infrastructure for
      recompilation checking, and folded wrongIfaceModErr (which
      was dead code) into the error message.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Subscribers: thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3130
      ca543154
    • Simon Peyton Jones's avatar
      Simplify OutputableBndr · 0e760174
      Simon Peyton Jones authored
      This replaces three methods in OutputableBndr with one,
      and adds comments.
      
      There's also a tiny change in the placement of equals signs in
      debug-prints.  I like it better that way, but if it complicates
      life for anyone we can put it back.
      0e760174
    • Simon Peyton Jones's avatar
      Fix a substitution bug in cseCase · e55986a9
      Simon Peyton Jones authored
      There was a missing substTy in cseCase!  Wow.  I'm surprised
      it has not caused problems.  Anyway, easily fixed.
      e55986a9
    • Simon Peyton Jones's avatar
      Honour -dsuppress-uniques more thoroughly · 8d401e50
      Simon Peyton Jones authored
      I found that tests
        parser/should_compile/DumpRenamedAst
      and friends were printing uniques, which makes the test fragile.
      But -dsuppress-uniques made no difference!  It turned out that
      pprName wasn't properly consulting Opt_SuppressUniques.
      
      This patch fixes the problem, and updates those three tests to
      use -dsuppress-uniques
      8d401e50
    • Simon Peyton Jones's avatar
      e52a335d
  3. 16 Feb, 2017 4 commits
  4. 15 Feb, 2017 1 commit
  5. 14 Feb, 2017 12 commits
    • Edward Z. Yang's avatar
      Don't warn about missing methods for instances in signatures. · 93e65c8a
      Edward Z. Yang authored
      Test Plan: validate
      
      Reviewers: bgamari, austin, dfeuer
      
      Reviewed By: dfeuer
      
      Subscribers: dfeuer, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3134
      93e65c8a
    • rwbarton's avatar
      Make deSugarExpr use runTcInteractive · f90e61ad
      rwbarton authored
      Preparation for #13102, which needs to add more logic to
      runTcInteractive, which would need to be duplicated in deSugarExpr.
      
      In order to break an import cycle, I had to move
      "Dependency/fingerprinting code" to a new module
      DsUsage; which seems sensible anyways.
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3125
      f90e61ad
    • rwbarton's avatar
      Check local type family instances against all imported ones · bedcb716
      rwbarton authored
      We previously checked type family instance declarations
      in a module for consistency with all instances that we happened
      to have read into the EPS or HPT. It was possible to arrange that
      an imported type family instance (used by an imported function)
      was in a module whose interface file was never read during
      compilation; then we wouldn't check consistency of local instances
      with this imported instance and as a result type safety was lost.
      
      With this patch, we still check consistency of local type family
      instances with all type family instances that we have loaded; but
      we make sure to load the interface files of all our imports that
      define family instances first. More selective consistency checking
      is left to #13102.
      
      On the other hand, we can now safely assume when we import a module
      that it has been checked for consistency with its imports. So we
      can save checking in checkFamInstConsistency, and overall we should
      have less work to do now.
      
      This patch also adds a note describing the Plan for ensuring type
      family consistency.
      
      Test Plan: Two new tests added; harbormaster
      
      Reviewers: austin, simonpj, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: ggreif, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2992
      bedcb716
    • Matthew Pickering's avatar
      Update .mailmap [skip ci] · 392cec4d
      Matthew Pickering authored
      392cec4d
    • Adam Gundry's avatar
      Implement HasField constraint solving and modify OverloadedLabels · da493897
      Adam Gundry authored
      This implements automatic constraint solving for the new HasField class
      and modifies the existing OverloadedLabels extension, as described in
      the GHC proposal
      (https://github.com/ghc-proposals/ghc-proposals/pull/6). Per the current
      form of the proposal, it does *not* currently introduce a separate
      `OverloadedRecordFields` extension.
      
      This replaces D1687.
      
      The users guide documentation still needs to be written, but I'll do
      that after the implementation is merged, in case there are further
      design changes.
      
      Test Plan: new and modified tests in overloadedrecflds
      
      Reviewers: simonpj, goldfire, dfeuer, bgamari, austin, hvr
      
      Reviewed By: bgamari
      
      Subscribers: maninalift, dfeuer, ysangkok, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2708
      da493897
    • vivid-synth's avatar
      Allow type defaulting for multi-param type classes with ExtendedDefaultRules · c3bbd1af
      vivid-synth authored
      Expressions like the following will now typecheck:
      
      ```
          data A x = A deriving Show
      
          class ToA a x where
             toA :: a -> A x
      
          instance ToA Integer x where
             toA _ = A
      
          main = print (toA 5 :: A Bool)
      ```
      
      The new defaulting rules are
      
      Find all the unsolved constraints. Then:
      
      * Find those that have exactly one free type variable, and partition
        that subset into groups that share a common type variable `a`.
      * Now default `a` (to one of the types in the default list) if at least
        one of the classes `Ci` is an interactive class
      
      Reviewers: goldfire, bgamari, austin, mpickering, simonpj
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: mpickering, simonpj, goldfire, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2822
      c3bbd1af
    • Tamar Christina's avatar
      Fix ExtraSymbols jump table on Windows. · 2f1017b9
      Tamar Christina authored
      This corrects the `jump islands` calculations for Windows.  The code was
      incorrectly creating a new entry for every `usage` of a symbol instead
      of every used symbol. e.g. if a symbol is used 5 times it used to create
      5 jump islands. This is incorrect and not in line with what the `ELF`
      and `Mach-O` linkers do. Also since we allocate `n` spaces where `n` is
      number of symbols, we would quickly run out of space and abort.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, hvr, erikd, bgamari, austin
      
      Reviewed By: bgamari
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D3026
      2f1017b9
    • Tamar Christina's avatar
      Expand list of always loaded Windows shared libs · 04f67c99
      Tamar Christina authored
      When the `GCC` driver envokes the pipeline a `SPEC` is used to determine
      how to configure the compiler and which libraries to pass along.
      
      For Windows/mingw, this specfile is
      https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/mingw32.h
      
      This expands the list of base DLLs with the ones that GCC always links,
      and adds extra sibling dlls of `stdc++` in case it is linked in.
      
      Following D3028 this patch only needs to load the always load only the
      top level individual shared libs.
      
      Test Plan: ./validate
      
      Reviewers: RyanGlScott, austin, bgamari, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: RyanGlScott, thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D3029
      04f67c99
    • Adam Gundry's avatar
      Refactor renaming of operators/sections to fix DuplicateRecordFields bugs · 2484d4da
      Adam Gundry authored
      A variety of panics were possible because the get_op function in
      RnTypes didn't handle the possibility that its argument might be an
      ambiguous record field. I've made its return type more informative to
      correctly handle occurrences of record fields.  Fixes Trac #13132.
      
      Test Plan: new test
      overloadedrecflds/should_fail/T13132_duplicaterecflds
      
      Reviewers: bgamari, simonpj, austin
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3126
      2484d4da
    • Ben Gamari's avatar
      TcUnify: Assert precondition of matchExpectedTyConApp · 6626242b
      Ben Gamari authored
      Test Plan: Validate
      
      Reviewers: simonpj, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3128
      6626242b
    • Siddharth's avatar
      Typecast covers entire expression to fix format warning. · 60c49861
      Siddharth authored
      - Fixes (#12636).
      - changes all the typecasts to _unsinged long long_ to
        have the format specifiers work.
      
      Reviewers: austin, bgamari, erikd, simonmar, Phyx
      
      Reviewed By: erikd, Phyx
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3129
      60c49861
    • Ben Gamari's avatar
      Debug: Use local symbols for unwind points (#13278) · 2d6e91ea
      Ben Gamari authored
      While this apparently didn't matter on Linux, the OS X toolchain seems
      to treat local and external symbols differently during linking. Namely,
      the linker assumes that an external symbol marks the beginning of a new,
      unused procedure, and consequently drops it.
      
      Fixes regression introduced in D2741.
      
      Test Plan: `debug` testcase on OS X
      
      Reviewers: austin, simonmar, rwbarton
      
      Reviewed By: rwbarton
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3135
      2d6e91ea
  6. 13 Feb, 2017 6 commits
  7. 12 Feb, 2017 9 commits
    • Ben Gamari's avatar
      Bump hoopl submodule to 3.10.2.2 · e46a2e16
      Ben Gamari authored
      e46a2e16
    • alexbiehl's avatar
      Binary: Correct endian issue when cross-compiling · d3ea38ef
      alexbiehl authored
      Using `WORDS_BIGENDIAN` wasn't such a great idea after all!
      When cross compiling host and target endianess may differ and
      `WORDS_BIGENDIAN` refers to host endianess.
      
      Reviewers: austin, bgamari, trofi
      
      Reviewed By: bgamari, trofi
      
      Subscribers: rwbarton, trofi, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3122
      d3ea38ef
    • olsner's avatar
      Apply SplitSections to all C compilations · a50082c1
      olsner authored
      Previously this was added only to the RTS's C files (those are the bulk
      of it though), but there are C bits in ghc-prim, integer-gmp and base
      too.
      
      Followup for #8405, allows the large table of character properties in
      base to be stripped when not used.
      
      Test Plan: validate
      
      Reviewers: austin, bgamari, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3121
      a50082c1
    • Niklas Hambüchen's avatar
      bufWrite: Save extra syscall when data fills handle buffer completely. · 6b4e46a1
      Niklas Hambüchen authored
      The bug is that the check `if (size - w > count)` should be
      `if (size - w >= count)` instead (`>=` instead of `>`),
      because we can do the write all fine if it fits exactly.
      This allows us to do 1 instead of 2 write syscalls the case it fits.
      
      An example of when this matters is when an application writes output
      in chunks that are a fraction of the handle buffer size.
      
      For example, assume the buffer size is 8 KB, and the application writes
      four 2 KB chunks.
      Until now, this would result in 3 copies to the handle buffer, but
      the 4th one would not be allowed in by `size - w > count`
      (because `size - w == count` is the case), so we'd end up with a write
      syscall of only 6 KB data instead of 8 KB, thus creating more syscalls
      overall.
      
      Implementing this fix (switching to `size - w >= count`), we also have
      to flush the buffer if we fill it completely.
      
      If we made only the changes described so far, that would have the
      unintended side effect that writes of the size equal to the handle
      buffer size (`count == size`) suddenly also go to the handle buffer
      first: The data would first be copied to the handle buffer, and then
      immediately get flushed to the underlying FD.  We don't want that extra
      `memcpy`, because it'd be unnecessary: The point of handle buffering is
      to coalesce smaller writes, and there are no smaller writes in this
      case.  For example, if you specify 8 KB buffers (which menas you want
      your data to be written out in 8 KB blocks), and you get data that's
      already 8 KB in size, you can write that out as an 8 KB straight away,
      zero-copy fashion.  For this reason, adding to the handle buffer now got
      an additional condition `count < size`.  That way, writes equal to the
      buffer size go straight to the FD, as they did before this commit.
      
      Reviewers: simonmar, austin, hvr, bgamari
      
      Reviewed By: simonmar
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3117
      6b4e46a1
    • Niklas Hambüchen's avatar
      Fix: hPutBuf issues unnecessary empty write syscalls for large writes (#13246) · 805db965
      Niklas Hambüchen authored
      Until now, any `hPutBuf` that wrote `>= the handle buffer size` would
      trigger an unnecessary `write("")` system call before the actual write
      system call.
      
      This is fixed by making sure that we never flush an empty handle buffer:
      Only flush `when (w > 0)`.
      
      Reviewers: simonmar, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3119
      805db965
    • Niklas Hambüchen's avatar
      Fix: Default FD buffer size is not a power of 2 (#13245) · 4e2e9b73
      Niklas Hambüchen authored
      Reviewers: simonmar, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3115
      4e2e9b73
    • David Feuer's avatar
      Avoid repeated list elem checks · 7938ef23
      David Feuer authored
      Convert a list to a set before testing membership multiple times.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3111
      7938ef23
    • alexbiehl's avatar
      Binary: Only allocate un-interned FastStrings · 64da671a
      alexbiehl authored
      Test Plan: Validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3109
      64da671a
    • Christiaan Baaij's avatar
      zonkCt tries to maintain the canonical form of a Ct. · 07292e95
      Christiaan Baaij authored
      For example,
       - a CDictCan should stay a CDictCan;
       - a CTyEqCan should stay a CTyEqCan (if the LHS stays as a variable.).
       - a CHoleCan should stay a CHoleCan
      
      Why?  For CDicteqCan see Trac #11525.
      
      Test Plan: Validate
      
      Reviewers: austin, adamgundry, simonpj, goldfire, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3105
      07292e95