1. 26 Jun, 2015 4 commits
    • Simon Peyton Jones's avatar
      Allow recursive unwrapping of data families · 0b7e538a
      Simon Peyton Jones authored
      When doing strictness analysis, we need to look inside products.
      To avoid unpacking infinitely, we must be careful about
      infinite types.  That in turn is controlled by TyCon.checkRecTc.
      For data families like
         data instance T (a,b) = MkT a (T b)
      we want to unpack the thing recursively for types like
        T (Int, (Int, (Int, Int)))
      This patch elaborates the checkRecTc mechanism in TyCon, to
      maintain a *count* of how many times a TyCon has shown up,
      rather than just a boolean.
      A simple change, and a useful one.  Fixes Trac #10482.
    • Simon Peyton Jones's avatar
      Use a Representaional coercion for data families · ff8a6716
      Simon Peyton Jones authored
      When we have
        data instance T (a,b) = MkT a b
      we make a represntation type
        data TPair a b = MkT a b
      plus an axiom to connect the two
        ax a b :: T (a,b)  ~R  TPair a b
      Previously this was a Nominal equality, and that worked ok
      but seems illogical since Nominal equalities are between
      types that the programmer thinks of as being equal.  But
      TPair is not visible to the programmer; indeed we call it
      the "representation TyCon".  So a Representational equality
      seems more suitable here.
    • Simon Peyton Jones's avatar
      Improve pretty-printing for CoPat · 9195927d
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      White space only · 3edc1868
      Simon Peyton Jones authored
  2. 25 Jun, 2015 4 commits
  3. 24 Jun, 2015 3 commits
    • Sergei Trofimovich's avatar
      driver: pass '-fPIC' option to all CC invocations · 4d1316a5
      Sergei Trofimovich authored
      Reported by mitchty:
        When porting ghc to alpine linux (rumors say they build
        all binaries as Position Independent Executables
        to leverage global ASLR) linker issued obscure errors:
      Tiny example:
          $ echo 'main = print "hello"' > a.hs
          $ ghc -fforce-recomp a.hs -fPIC -dynamic -optl-pie -o a
              ld: /tmp/ghc2142_0/ghc2142_5.o: relocation R_X86_64_32 against `ZCMain_main_closure'
                  can not be used when making a shared object; recompile with -fPIC
              /tmp/ghc2142_0/ghc2142_5.o: error adding symbols: Bad value
              collect2: error: ld returned 1 exit status
      There is two entry points in CC driver:
          'runPhase' (CC) and 'mkExtraObj'
      'mkExtraObj' does not handle most of 'runPhase's complexity.
      Ideally it should.
      This patch only adds -fPIC propagation to 'mkExtraObj'.
      Please merge to stable branch.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
    • Sergei Trofimovich's avatar
    • Edward Z. Yang's avatar
      Drop prefix from package keys. · ece2c434
      Edward Z. Yang authored
      Contains Cabal submodule update, as Cabal is responsible
      generating package keys.  We also have to update some output.
      Also comes with a documentation update for ghc-pkg in the
      user manual for --package-key.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      Test Plan: validate
      Reviewers: simonpj, austin
      Subscribers: thomie, bgamari
      Differential Revision: https://phabricator.haskell.org/D1011
      GHC Trac Issues: #10550
  4. 23 Jun, 2015 4 commits
    • thomie's avatar
      Build system: delete unused variables in config.mk.in · 95d50310
      thomie authored
      GhcStage1DefaultNewCodegen, GhcStage2DefaultNewCodegen,
      GhcStage3DefaultNewCodegen and GhcCompilerWays are not used anywhere.
    • Edward Z. Yang's avatar
      Make $1 in $1_$2_$3_FOO actually be directory. · 73a6265e
      Edward Z. Yang authored
      Previously, we used $1_$2_PACKAGE_KEY to parametrize $1.  But the
      documentation says that $1 should be the directory...  and we're now
      putting the libraries in $1_$2_LIB_NAME.  So use /that/.  This is just
      alpha-renaming, so as long as we're consistent, there's no material
      I also fixed a bug of a package ID calculation which I missed first
      time around, which was tickled by this change.
      BTW, this means DEP_KEYS and TRANSITIVE_DEP_KEYS are unused, so
      remove them from ghc-cabal.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      Test Plan: validate
      Reviewers: austin
      Subscribers: thomie, bgamari
      Differential Revision: https://phabricator.haskell.org/D1010
    • Sergei Trofimovich's avatar
      powerpc: add basic support for PLT relocations (#10402) · c0847967
      Sergei Trofimovich authored
      Commit a93ab43a
      enabled support for proper PIC relocations from
      Commit adds support for relocations of type:
      They are used only when GHC is built in
      Verified by running the following test:
          // cat a.c
          #include <stdio.h>
          void ffi_a_hello (int i) {
              fprintf (stderr, "WEEEEEEEE: i=%d\n", i);
          -- cat A.hs
          {-# LANGUAGE ForeignFunctionInterface #-}
          module A where
          import Foreign.C
          foreign import ccall "ffi_a_hello" a :: CInt -> IO ()
          # ghc -fPIC -c a.c -fforce-recomp
          # ghc -fPIC -c A.hs -fforce-recomp
          # ghc --interactive ./a.o A
          *A> a 42
          WEEEEEEEE: i=42
      See gory details in Trac #10402.
      Signed-off-by: default avatarColin Watson <cjwatson@debian.org>
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      Reviewed By: bgamari, austin
      Differential Revision: https://phabricator.haskell.org/D996
      GHC Trac Issues: #10402
    • Simon Peyton Jones's avatar
      Further elaborate Trac #10403 test · 55843f1c
      Simon Peyton Jones authored
      Adding app1, app2, as requested in the ticket
  5. 22 Jun, 2015 5 commits
  6. 21 Jun, 2015 2 commits
  7. 20 Jun, 2015 10 commits
  8. 19 Jun, 2015 4 commits
  9. 18 Jun, 2015 4 commits
    • Simon Peyton Jones's avatar
      Elaborate test for Trac #10403 · c45f8ceb
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Test Trac #10503 · ba7c8e59
      Simon Peyton Jones authored
    • Alan Zimmerman's avatar
      Parser: commas_tup_tail duplicate SrcSpan on "Missing" value · 72b21c39
      Alan Zimmerman authored
          {-# LANGUAGE TupleSections #-}
          baz = (1, "hello", 6.5,,) 'a' (Just ())
      Results in the following AST fragment
          (L tests/examples/Tuple.hs:3:7-25
                [ L tests/examples/Tuple.hs:3:8
                       (L tests/examples/Tuple.hs:3:8
                                (HsIntegral [ '1' ] 1)
                , L tests/examples/Tuple.hs:3:11-17
                       (L tests/examples/Tuple.hs:3:11-17
                                [ '"'
                                , 'h'
                                , 'e'
                                , 'l'
                                , 'l'
                                , 'o'
                                , '"'
                , L tests/examples/Tuple.hs:3:20-22
                       (L tests/examples/Tuple.hs:3:20-22
                                      [ '6' , '.' , '5' ]
                                      (:% 13 2)))
                , L tests/examples/Tuple.hs:3:24
                    (Missing PlaceHolder)
                , L tests/examples/Tuple.hs:3:24
                    (Missing PlaceHolder)
      The final `Missing PlaceHolder` has a duplicated `SrcSpan`
      Test Plan: ./validate
      Reviewers: austin, hvr, bgamari
      Reviewed By: bgamari
      Subscribers: thomie, bgamari, mpickering
      Differential Revision: https://phabricator.haskell.org/D995
      GHC Trac Issues: #10537
    • Simon Peyton Jones's avatar
      Trac #4945 is working again · 5d98b682
      Simon Peyton Jones authored
      This test greps in the ouput of -ddump-simpl, so it's fragile.
      It stopped working for a while, but now works again. I don't know
      why, but I don't have time to investigate, so I'll just mark it
      as ok.