1. 08 Mar, 2021 3 commits
    • Alfredo Di Napoli's avatar
      Get rid of reclassify in GHC.Tc.Errors · 8417debb
      Alfredo Di Napoli authored
      This commit removes the need for reclassify inside GHC.Tc.Errors,
      and also simplifies the implementation of `maybeReportError`.
      8417debb
    • Alfredo Di Napoli's avatar
      Compute Severity of diagnostics at birth · 98301449
      Alfredo Di Napoli authored
      This commit further expand on the design for #18516 by getting rid of
      the `defaultReasonSeverity` in favour of a function called
      `diagReasonSeverity` which correctly takes the `DynFlags` as input. The
      idea is to compute the `Severity` and the `DiagnosticReason` of each
      message "at birth", without doing any later re-classifications, which
      are potentially error prone, as the `DynFlags` might evolve during the
      course of the program.
      
      In preparation for a proper refactoring, now `pprWarning` from the
      Parser.Ppr module has been renamed to `mkParserWarn`, which now takes a
      `DynFlags` as input.
      
      Last but not least, we get rid of the reclassification we were
      performing inside `printOrThrowWarnings`.
      
      Update Haddock submodule
      98301449
    • Alfredo Di Napoli's avatar
      Add `MessageClass`, rework `Severity` and add `DiagnosticReason`. · f7b316cf
      Alfredo Di Napoli authored
      Other than that:
      
      * Fix T16167,json,json2,T7478,T10637 tests to reflect the introduction of
        the `MessageClass` type
      
      * Remove `makeIntoWarning`
      
      * Remove `warningsToMessages`
      
      * Refactor GHC.Tc.Errors
      
        1. Refactors GHC.Tc.Errors so that we use `DiagnosticReason` for "choices"
           (defer types errors, holes, etc);
      
        2. We get rid of `reportWarning` and `reportError` in favour of a general
           `reportDiagnostic`.
      
      * Introduce `DiagnosticReason`, `Severity` is an enum: This big commit makes
        `Severity` a simple enumeration, and introduces the concept of `DiagnosticReason`,
        which classifies the /reason/ why we are emitting a particular diagnostic.
        It also adds a monomorphic `DiagnosticMessage` type which is used for
        generic messages.
      
      * The `Severity` is computed (for now) from the reason, statically.
        Later improvement will add a `diagReasonSeverity` function to compute
        the `Severity` taking `DynFlags` into account.
      
      * Rename `logWarnings` into `logDiagnostics`
      
      * Add note and expand description of the `mkHoleError` function
      f7b316cf
  2. 07 Mar, 2021 2 commits
    • Ben Gamari's avatar
      Implement BoxedRep proposal · 3e082f8f
      Ben Gamari authored
      This implements the BoxedRep proposal, refactoring the `RuntimeRep`
      hierarchy from:
      
      ```haskell
      data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ...
      ```
      
      to
      
      ```haskell
      data RuntimeRep = BoxedRep Levity | ...
      data Levity = Lifted | Unlifted
      ```
      
      Updates binary, haddock submodules.
      
      Closes #17526.
      
      Metric Increase:
          T12545
      3e082f8f
    • Shayne Fletcher's avatar
      Implement record dot syntax · cf65cf16
      Shayne Fletcher authored
      cf65cf16
  3. 06 Mar, 2021 2 commits
  4. 05 Mar, 2021 12 commits
  5. 03 Mar, 2021 21 commits
    • Matthew Pickering's avatar
      IPE: Give all constructor and function tables locations · f943edb0
      Matthew Pickering authored
      During testing it was observed that quite a few info tables were not
      being given locations (due to not being assigned source locations,
      because they were not enclosed by a source note). We can at least give
      the module name and type for such closures even if no more accurate
      source information.
      
      Especially for constructors this helps find them in the STG dumps.
      f943edb0
    • Matthew Pickering's avatar
      7b9767b8
    • Matthew Pickering's avatar
      f121ffe4
    • Matthew Pickering's avatar
    • Matthew Pickering's avatar
      Add test for whereFrom# · db80a5cc
      Matthew Pickering authored
      db80a5cc
    • Matthew Pickering's avatar
      Add whereFrom and whereFrom# primop · 9087899e
      Matthew Pickering authored
      The `whereFrom` function provides a Haskell interface for using the
      information created by `-finfo-table-map`. Given a Haskell value, the
      info table address will be passed to the `lookupIPE` function in order
      to attempt to find the source location information for that particular closure.
      
      At the moment it's not possible to distinguish the absense of the map
      and a failed lookup.
      9087899e
    • Matthew Pickering's avatar
      Add option to give each usage of a data constructor its own info table · a7aac008
      Matthew Pickering authored
      The `-fdistinct-constructor-tables` flag will generate a fresh info
      table for the usage of any data constructor. This is useful for
      debugging as now by inspecting the info table, you can determine which
      usage of a constructor caused that allocation rather than the old
      situation where the info table always mapped to the definition site of
      the data constructor which is useless.
      
      In conjunction with `-hi` and `-finfo-table-map` this gives a more fine
      grained understanding of where constructor allocations arise from in a
      program.
      a7aac008
    • Matthew Pickering's avatar
      Add -finfo-table-map which maps info tables to source positions · 4b297979
      Matthew Pickering authored
      This new flag embeds a lookup table from the address of an info table
      to information about that info table.
      
      The main interface for consulting the map is the `lookupIPE` C function
      
      > InfoProvEnt * lookupIPE(StgInfoTable *info)
      
      The `InfoProvEnt` has the following structure:
      
      > typedef struct InfoProv_{
      >     char * table_name;
      >     char * closure_desc;
      >     char * ty_desc;
      >     char * label;
      >     char * module;
      >     char * srcloc;
      > } InfoProv;
      >
      > typedef struct InfoProvEnt_ {
      >     StgInfoTable * info;
      >     InfoProv prov;
      >     struct InfoProvEnt_ *link;
      > } InfoProvEnt;
      
      The source positions are approximated in a similar way to the source
      positions for DWARF debugging information. They are only approximate but
      in our experience provide a good enough hint about where the problem
      might be. It is therefore recommended to use this flag in conjunction
      with `-g<n>` for more accurate locations.
      
      The lookup table is also emitted into the eventlog when it is available
      as it is intended to be used with the `-hi` profiling mode.
      
      Using this flag will significantly increase the size of the resulting
      object file but only by a factor of 2-3x in our experience.
      4b297979
    • Matthew Pickering's avatar
      Profiling by info table mode (-hi) · 8402ea95
      Matthew Pickering authored
      This profiling mode creates bands by the address of the info table for
      each closure. This provides a much more fine-grained profiling output
      than any of the other profiling modes.
      
      The `-hi` profiling mode does not require a profiling build.
      8402ea95
    • Matthew Pickering's avatar
      Revert "Remove GHC.Types.Unique.Map module" · 2f7e879b
      Matthew Pickering authored
      This reverts commit 1c7c6f1a.
      2f7e879b
    • Ryan Scott's avatar
      User's Guide: document DefaultSignatures' interaction with subsumption · df74e95a
      Ryan Scott authored
      As reported in #19432, the rules governing how `DefaultSignatures` are
      typechecked became stricter in GHC 9.0 due to simplified subsumption.
      However, this was far from obvious to me after reading the User's Guide section
      on `DefaultSignatures`. In this patch, I spruce up the documentation in that
      section so that it mentions these nuances.
      
      Resolves #19432.
      df74e95a
    • Andreas Klebinger's avatar
      Build event logging rts in all flavours except GhcinGhci. · ad0c2073
      Andreas Klebinger authored
      This applies the fix for #19033 to all the other flavours as well.
      ad0c2073
    • Sylvain Henry's avatar
      Add a flag to dump the FastString table · 3f9af891
      Sylvain Henry authored
      3f9af891
    • Sebastian Graf's avatar
      DmdAnal: Better syntax for demand signatures (#19016) · 3630b9ba
      Sebastian Graf authored
      The update of the Outputable instance resulted in a slew of
      documentation changes within Notes that used the old syntax.
      The most important doc changes are to `Note [Demand notation]`
      and the user's guide.
      
      Fixes #19016.
      3630b9ba
    • Ben Gamari's avatar
      ghc-heap: Fix profiled build · 5c4dcc3e
      Ben Gamari authored
      Previously a255b4e3 failed to update the
      non-profiling codepath.
      5c4dcc3e
    • Ben Gamari's avatar
      hadrian: Fix profiled flavour transformer · e81f2e4e
      Ben Gamari authored
      Previously the profiled flavour transformer failed to add the profiled
      ways to the library and RTS ways lists, resulting in link failures.
      e81f2e4e
    • Sylvain Henry's avatar
      Fix leaks of the HscEnv with quick flavour (#19356) · 8a433a3c
      Sylvain Henry authored
      Thanks @mpickering for finding them!
      8a433a3c
    • Sylvain Henry's avatar
      Minor simplification for leak indicators · 38748d5f
      Sylvain Henry authored
      Avoid returning a lazy panic value when leak indicators are disabled.
      38748d5f
    • Sylvain Henry's avatar
      Always INLINE ($!) · fe4202ce
      Sylvain Henry authored
      ($) is INLINE so there is no reason ($!) shouldn't.
      fe4202ce
    • Matthew Pickering's avatar
      Profiling: Allow heap profiling to be controlled dynamically. · d89deeba
      Matthew Pickering authored
      This patch exposes three new functions in `GHC.Profiling` which allow
      heap profiling to be enabled and disabled dynamically.
      
      1. startHeapProfTimer - Starts heap profiling with the given RTS options
      2. stopHeapProfTimer  - Stops heap profiling
      3. requestHeapCensus  - Perform a heap census on the next context
                              switch, regardless of whether the timer is enabled or not.
      d89deeba
    • Sylvain Henry's avatar
      Fix array and cleanup conversion primops (#19026) · d8dc0f96
      Sylvain Henry authored
      The first change makes the array ones use the proper fixed-size types,
      which also means that just like before, they can be used without
      explicit conversions with the boxed sized types. (Before, it was Int# /
      Word# on both sides, now it is fixed sized on both sides).
      
      For the second change, don't use "extend" or "narrow" in some of the
      user-facing primops names for conversions.
      
        - Names like `narrowInt32#` are misleading when `Int` is 32-bits.
      
        - Names like `extendInt64#` are flat-out wrong when `Int is
          32-bits.
      
        - `narrow{Int,Word}<N>#` however map a type to itself, and so don't
          suffer from this problem. They are left as-is.
      
      These changes are batched together because Alex happend to use the array
      ops. We can only use released versions of Alex at this time, sadly, and
      I don't want to have to have a release thatwon't work for the final GHC
      9.2. So by combining these we get all the changes for Alex done at once.
      
      Bump hackage state in a few places, and also make that workflow slightly
      easier for the future.
      
      Bump minimum Alex version
      
      Bump Cabal, array, bytestring, containers, text, and binary submodules
      d8dc0f96