1. 19 May, 2017 5 commits
    • Simon Peyton Jones's avatar
      Account for IfUnpackCo in freeNamesIfDecl · 8fe37a02
      Simon Peyton Jones authored
      We were simply failing to recognise all the free variables of an
      IfaceDecl, notably the ones in the coercion of an IfUnpackCo.
      Result: the dependency analysis got messed up, so that fingerprint
      calculation went wrong.  Trac #13695 showed it up.
      
      A test case is tricky but the fix is a solid one.
      8fe37a02
    • Simon Peyton Jones's avatar
      Refactor freeNamesIfDecl · d06cb963
      Simon Peyton Jones authored
      This just switches to using pattern matching rather than field
      selectors, which I generally prefer.  No change in behaviour.
      d06cb963
    • Simon Peyton Jones's avatar
      Comments and white space only · 875159cc
      Simon Peyton Jones authored
      875159cc
    • Alexey Vagarenko's avatar
      Fix Haddock markup · c039624a
      Alexey Vagarenko authored
      c039624a
    • Simon Peyton Jones's avatar
      Ensure that insolubles are fully rewritten · 433b80de
      Simon Peyton Jones authored
      I was alerted to this by Trac #12468 and #11325.  We were treating
      insolubles (and "hole" constraints are treated as insoluble)
      inconsistently.  In some places we were carefully rewriting them
      e.g. Note [Make sure that insolubles are fully rewritten] in
      TcCanonical.  But in TcSimplify we weren't feeding them into
      the solver.
      
      As a result, "hole" constraints were not being rewritten, which
      some users found confusing, and I think rightly so.
      
      This patch also fixes a bug in TcSMonad.emitInsoluble, in which two
      different "hole" constriants could be treated (bogusly) as duplicates,
      thereby losing one.
      433b80de
  2. 18 May, 2017 1 commit
  3. 17 May, 2017 2 commits
    • Simon Peyton Jones's avatar
      Handle type-lets better · d6461f96
      Simon Peyton Jones authored
      Core allows non-recursive type-lets, thus
      
         let a = TYPE ty in ...
      
      They are substituted away very quickly, but it's convenient for
      some passes to produce them (rather than to have to substitute
      immediately).
      
      Trac #13708 tried the effect of not running the simplifer at all
      (a rather bizarre thing to do, but still).  That showed that some
      passes crashed because they always treated a let-bounder binder
      as an Id.  This patch adds some easy fixes.
      d6461f96
    • Edward Z. Yang's avatar
      Fix #13703 by correctly using munged names in ghc-pkg. · d9e9a9b3
      Edward Z. Yang authored
      
      
      Summary:
      Cabal internal libraries are implemented using a trick, where the 'name'
      field in ghc-pkg registration file is munged into a new form to keep
      each internal library looking like a distinct package to ghc-pkg and
      other tools; e.g. the internal library q from package p is named
      z-p-z-q.
      
      Later, Cabal library got refactored so that we made a closer distinction
      between these "munged" package names and the true package name of a
      package.  Unfortunately, this is an example of a refactor for clarity in
      the source code which ends up causing problems downstream, because the
      point of "munging" the package name was to make it so that ghc-pkg and
      similar tools transparently used MungedPackageName whereever they
      previously used PackageName (in preparation for them learning proper
      syntax for package name + component name).  Failing to do this meant
      that internal libraries from the same package (but with different
      names) clobber each other.
      
      This commit search-replaces most occurrences of PackageName in
      ghc-pkg and turns them into MungedPackageName. Otherwise there
      shouldn't be any functional differenes.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #13703
      
      Differential Revision: https://phabricator.haskell.org/D3590
      d9e9a9b3
  4. 16 May, 2017 4 commits
  5. 15 May, 2017 6 commits
  6. 14 May, 2017 5 commits
    • Sergei Trofimovich's avatar
      rts/linker/ElfTypes.h: restore powerps (and others) support · d5414dd6
      Sergei Trofimovich authored
      
      
      GHC build fails for powerpc-unknown-linux-gnu
      and hppa-unknown-linux-gnu targets as:
        rts_dist_HC rts/dist/build/RtsStartup.o
          rts/linker/ElfTypes.h:23:4: error:
               error: #error "Unsupported arch!"
      
      Before the change code tried to whitelist architectures
      and classify them into ELF32/ELF64. It does not work
      for UNREG arches like 'hppa', 'sparc64', 'm68k', 'mips'.
      
      It is nuanced for things like mips64 and x86_64:
          'mips64-unknown-linux-gnu-gcc -mabi=64' is ELFCLASS64
          'mips64-unknown-linux-gnu-gcc'          is ELFCLASS32
          'x86_64-pc-linux-gnu-gcc'               is ELFCLASS64
          'x86_64-pc-linux-gnu-gcc -mx32'         is ELFCLASS32
      Here it's not enough to know HOST_ARCH. We really need to
      know ABI.
      
      The change uses '__LP64__' as a proxy for ELFCLASS64.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Reviewers: angerman, simonmar, austin, bgamari, erikd
      
      Reviewed By: angerman, bgamari, erikd
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #13696
      
      Differential Revision: https://phabricator.haskell.org/D3583
      d5414dd6
    • Sergei Trofimovich's avatar
      rts: annotate switch/case with '/* fallthrough */' · 230416f8
      Sergei Trofimovich authored
      
      
      Fixes gcc-7.1.0 warnings of form:
      
        rts/sm/Scav.c:559:9: error:
           error: this statement may fall through [-Werror=implicit-fallthrough=]
                   scavenge_fun_srt(info);
                   ^~~~~~~~~~~~~~~~~~~~~~
      
      Many of places are indeed unobvious and some are
      already annotated by comments.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      230416f8
    • Sergei Trofimovich's avatar
      ProfilerReportJson.c: fix out-of-bounds access · 20c39b77
      Sergei Trofimovich authored
      
      
      Found by gcc-7.1 which reported build error as:
      
      rts/ProfilerReportJson.c:23:16: error:
           error: comparison between pointer and zero
             character constant [-Werror=pointer-compare]
               for (; str != '\0' && len > 0; str++) {
                          ^~
         |
      23 |     for (; str != '\0' && len > 0; str++) {
         |                ^
      
      Unfixed code in context:
      
      ```c
        static void escapeString(char const* str, char *out, int len)
        {
           len--; // reserve character in output for terminating NUL
           for (; str != '\0' && len > 0; str++) {
               char c = *str;
      ```
      
      The intent here is to process 'len' (if positive) or '\0'-terminator
      in 'str' but dereference was missing.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      20c39b77
    • Ben Gamari's avatar
      Update unix submodule · 2a971e35
      Ben Gamari authored
      2a971e35
    • Sergei Trofimovich's avatar
  7. 13 May, 2017 2 commits
  8. 12 May, 2017 10 commits
  9. 11 May, 2017 5 commits