1. 16 Jan, 2019 14 commits
    • Alec Theriault's avatar
      Fix tests for `integer-simple` · d2eb344a
      Alec Theriault authored
      A bunch of tests for `integer-simple` were now broken for a foolish reason:
      unlike the `integer-gmp` case, there is no CorePrep optimization for turning
      small integers directly into applications of `S#`.
      
      Rather than port this optimization to `integer-simple` (which would involve
      moving a bunch of `integer-simple` names into `PrelNames`), I switched
      as many tests as possible to use `Int`.
      
      The printing of `Integer` is already tested in `print037`.
      d2eb344a
    • Alec Theriault's avatar
      Remove from `base` obsolete CPP for `integer-gmp` · f7def747
      Alec Theriault authored
        * `GHC.Natural` now exports the same functions (regardless of integer backend)
        * remove unnecessary CPP around instances
        * remove the 'OPTIMISE_INTEGER_GCD_LCM' flag - almost all of those optimizations
          now work regardless of which integer backend is used
      
      Note that some CPP still remains for situations where there are backend-specific
      optimization hacks (like a more efficient GMP-only `gcd` for `Int#` and `Word#`).
      f7def747
    • Alec Theriault's avatar
      Match `integer-simple`'s API with `integer-gmp` · 6e320c27
      Alec Theriault authored
      In `integer-simple`:
      
        * Added an efficient `popCountInteger` and `bitInteger`
        * Added an efficient `gcdInteger` and `lcmInteger`
        * Made `testBitInteger` more efficient
      6e320c27
    • Alec Theriault's avatar
      Support printing `integer-simple` Integers in GHCi · 582a96f4
      Alec Theriault authored
      This means that `:p` no longer leaks the implementation details of
      `Integer` with `integer-simple`. The `print037` test case should
      exercise all possible code paths for GHCi's code around printing
      `Integer`s (both in `integer-simple` and `integer-gmp`).
      
      `ghc` the package now also has a Cabal `integer-simple` flag (like the
      `integer-gmp` one).
      582a96f4
    • Alec Theriault's avatar
      Create folder if missing for .hie files · 9fb2702d
      Alec Theriault authored
      Summary:
      This matches the existing behaviour for .hi files: if the user requests
      the interface file be written in some location, we should create the
      parent folder if it doesn't already exist.
      
      Reviewers: bgamari, sjakobi
      
      Reviewed By: sjakobi
      
      Subscribers: sjakobi, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5463
      9fb2702d
    • Alec Theriault's avatar
      Hadrian: support extra libraries + OSX rpath · 2f65025e
      Alec Theriault authored
      Summary:
      This fixes some of the issues that surfaced when trying to build
      dynamic GHC on OSX. Unfortunately, due some other `libffi`
      issues, this doesn't completely fix dynamic builds on OSX.
      
        - Use 'extra-libraries' from .cabal files instead of hardcoding
          which packages need which extra libs. Also add support for
          'extra-lib-dirs'.
      
        - Make sure Hadrian looks in the right places to support both
          plain '<pkg>.buildinfo' and '<pkg>.buildinfo.in' files.
      
        - Make the '-rpath' support more robust across OS's (it previously
          didn't work on OSX and possibly windows either).
      
      Reviewers: angerman, alpmestan, adamse, DavidEichmann, bgamari, Phyx
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15990
      
      Differential Revision: https://phabricator.haskell.org/D5409
      2f65025e
    • Zejun Wu's avatar
      Introduce ghci command wrapper · 6a7a6b86
      Zejun Wu authored
      Introduce ghci command wrapper, which can be used to cutomize ghci:
      * process additionals actions before/after the command
      * handle particular exceptions in given ways
      * logging stats
      
      We also split the timing and printing part of `timeIt` into different
      functions.
      6a7a6b86
    • Peter Trommler's avatar
      Fix filename in comment again · c155ac9c
      Peter Trommler authored
      c155ac9c
    • Peter Trommler's avatar
      Fix reference to stack code in comment · ea79978b
      Peter Trommler authored
      ea79978b
    • Peter Trommler's avatar
      PPC NCG: Refactor stack allocation code · 3f46cffc
      Peter Trommler authored
      There is only one place where UPDATE_SP was used. Instead of the
      UPDATE_SP pseudo instruction build the list of instructions directly.
      3f46cffc
    • Alec Theriault's avatar
      Hadrian: configure packages with right 'htmldir' · da2d9cf8
      Alec Theriault authored
      This means that we can query the package DB for haddock interfaces.
      Haddock uses this in its testsuite. 'cabal {v1-,v2,}-haddock' also
      uses this.
      
      Also thread through to Haddock package-specific overrides of GHC
      warnings.
      da2d9cf8
    • Roland Senn's avatar
      f78048f6
    • Roland Senn's avatar
    • syd@cs-syd.eu's avatar
      hWaitForInput-accurate-socket test · ce2f77d5
      syd@cs-syd.eu authored
      ce2f77d5
  2. 15 Jan, 2019 5 commits
  3. 14 Jan, 2019 8 commits
  4. 13 Jan, 2019 4 commits
  5. 12 Jan, 2019 3 commits
    • Ömer Sinan Ağacan's avatar
      Fix negative mutator time in GC stats in prof builds · 19670bc3
      Ömer Sinan Ağacan authored
      Because garbage collector calls `retainerProfile()` and `heapCensus()`,
      GC times normally include some of PROF times too. To fix this we have
      these lines:
      
          // heapCensus() is called by the GC, so RP and HC time are
          // included in the GC stats.  We therefore subtract them to
          // obtain the actual GC cpu time.
          stats.gc_cpu_ns      -=  prof_cpu;
          stats.gc_elapsed_ns  -=  prof_elapsed;
      
      These variables are later used for calculating GC time excluding the
      final GC (which should be attributed to EXIT).
      
          exit_gc_elapsed      = stats.gc_elapsed_ns - start_exit_gc_elapsed;
      
      The problem is if we subtract PROF times from `gc_elapsed_ns` and then
      subtract `start_exit_gc_elapsed` from the result, we end up subtracting
      PROF times twice, because `start_exit_gc_elapsed` also includes PROF
      times.
      
      We now subtract PROF times from GC after the calculations for EXIT and
      MUT times. The existing assertion that checks
      
          INIT + MUT + GC + EXIT = TOTAL
      
      now holds. When we subtract PROF numbers from GC, and a new assertion
      
          INIT + MUT + GC + PROF + EXIT = TOTAL
      
      also holds.
      
      Fixes #15897. New assertions added in this commit also revealed #16102,
      which is also fixed by this commit.
      19670bc3
    • Ömer Sinan Ağacan's avatar
      Fix raiseAsync() UNDERFLOW_FRAME handling in profiling runtime · 74cd4ec5
      Ömer Sinan Ağacan authored
      UNDERFLOW_FRAMEs don't have profiling headers so we have to use the
      AP_STACK's function's CCS as the new frame's CCS.
      
      Fixes one of the many bugs caught by concprog001 (#15508).
      74cd4ec5
    • Ömer Sinan Ağacan's avatar
      Documentation and refactoring in CCS related code · cb2349a4
      Ömer Sinan Ağacan authored
      - Remove REGISTER_CC and REGISTER_CCS macros, add functions registerCC
        and registerCCS to Profiling.c.
      
      - Reduce scope of symbols: CC_LIST, CCS_LIST, CC_ID, CCS_ID
      
      - Document CC_LIST and CCS_LIST
      cb2349a4
  6. 11 Jan, 2019 2 commits
  7. 10 Jan, 2019 1 commit
  8. 09 Jan, 2019 1 commit
    • Matthew Pickering's avatar
      Hadrian: Add support for building stage3 · 6486c6e4
      Matthew Pickering authored
      This ticket enables the building of a `stage3` compiler by making the
      build logic more consistent and predictable in Hadrian.
      
      Two of the main changes are:
      
      1. In order to build anything at stageN we use the package database
      present at stageN. Fixing #16069
      2. `haddock` and `ghc-tags` are built
      as stage1 executables (with the stage1 compiler) rather than as
      stage2 compiler. Fixing
      [hadrian#661](https://github.com/snowleopard/hadrian/issues/661)
      
      In order to build a stage3 compiler, you have to set the new `finalStage` hadrian option to `Stage3`.
      6486c6e4
  9. 08 Jan, 2019 1 commit
    • Ryan Scott's avatar
      Be pickier about unsaturated synonyms in :kind · 6b70cf61
      Ryan Scott authored
      Summary:
      We currently permit any and all uses of unsaturated type
      synonyms and type families in GHCi's `:kind` command, which allows
      strange interactions like this one:
      
      ```
      > :set -XTypeFamilies -XPolyKinds
      > type family Id (a :: k)
      > type instance Id a = a
      > type Foo x = Maybe
      > :kind! Id Foo
      ```
      
      This is probably a stretch too far, so this patch moves to disallow
      unsaturated synonyms that aren't at the top level (we still want to
      allow `:kind Id`, for instance). We do this by augmenting `GhciCtxt`
      with an additional `Bool` field to indicate if we are at the
      outermost level of the type being passed to `:kind` or not. See
      `Note [Unsaturated type synonyms in GHCi]` in `TcValidity` for the
      full story.
      
      Test Plan: make test TEST=T16013
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: goldfire
      
      Subscribers: simonpj, goldfire, rwbarton, carter
      
      GHC Trac Issues: #16013
      
      Differential Revision: https://phabricator.haskell.org/D5471
      6b70cf61
  10. 07 Jan, 2019 1 commit
    • Alec Theriault's avatar
      Check that libs found by GCC aren't folders · 6b5ec08a
      Alec Theriault authored
      Summary:
      We use 'gcc -B<base-location> --print-file-name mylib.a' as a way of
      checking if 'gcc' can discover 'mylib.a' at the given location. However,
      this can break down if there is a folder caller 'mylib.a' that 'gcc' can
      discover. We can guard against this by explicitly checking that the path
      returned by 'gcc' is a file.
      
      This may seem like a far-fetched scenario, but since
      3d17f1f1, we look for libraries without
      any prefix or suffix (ie. 'extra-libraries: softfloat', we look for just
      'softfloat' as well as 'softloat.a', 'softfloat.dll.a', etc.) which means
      that there might actusally be a folder of that name in one of the base
      locations.
      
      Reviewers: Phyx, bgamari, hvr, angerman
      
      Reviewed By: Phyx, angerman
      
      Subscribers: angerman, rwbarton, carter
      
      GHC Trac Issues: #16063
      
      Differential Revision: https://phabricator.haskell.org/D5462
      6b5ec08a