Skip to content
Snippets Groups Projects
  1. Feb 04, 2024
  2. Feb 03, 2024
    • Apoorv Ingle's avatar
      Expand `do` blocks right before typechecking using the `HsExpansion` philosophy. · 5ff7cc26
      Apoorv Ingle authored
      - Fixes #18324 #20020 #23147 #22788 #15598 #22086 #21206
      
      - The change is detailed in
        - Note [Expanding HsDo with HsExpansion] in `GHC.Tc.Gen.Do`
        - Note [Doing HsExpansion in the Renamer vs Typechecker] in `GHC.Rename.Expr`
               expains the rational of doing expansions in type checker as opposed to in the renamer
      
      - Adds new datatypes:
        - `GHC.Hs.Expr.XXExprGhcRn`: new datatype makes this expansion work easier
          1. Expansion bits for Expressions, Statements and Patterns in (`ExpandedThingRn`)
          2. `PopErrCtxt` a special GhcRn Phase only artifcat to pop the previous error message in the error context stack
      
        - `GHC.Basic.Origin` now tracks the reason for expansion in case of Generated
          This is useful for type checking cf. `GHC.Tc.Gen.Expr.tcExpr` case for `HsLam`
      
        - Kills `HsExpansion` and `HsExpanded` as we have inlined them in `XXExprGhcRn` and `XXExprGhcTc`
      
      - Ensures warnings such as
        1. Pattern match checks
        2. Failable patterns
        3. non-() return in body statements are preserved
      
      - Kill `HsMatchCtxt` in favor of `TcMatchAltChecker`
      
      - Testcases:
        * T18324 T20020 T23147 T22788 T15598 T22086
        * T23147b (error message check),
        * DoubleMatch (match inside a match for pmc check)
        * pattern-fails (check pattern match with non-refutable pattern, eg. newtype)
        * Simple-rec (rec statements inside do statment)
        * T22788 (code snippet from #22788)
        * DoExpanion1 (Error messages for body statments)
        * DoExpansion2 (Error messages for bind statements)
        * DoExpansion3 (Error messages for let statements)
      
      Also repoint haddock to the right submodule so that the test (haddockHypsrcTest) pass
      
      Metric Increase 'compile_time/bytes allocated':
          T9020
      
      The testcase is a pathalogical example of a `do`-block with many statements that do nothing.
      Given that we are expanding the statements into function binds, we will have to bear
      a (small) 2% cost upfront in the compiler to unroll the statements.
      5ff7cc26
    • Rodrigo Mesquita's avatar
      Work around autotools setting C11 standard in CC/CXX · cdddeb0f
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      In autoconf >=2.70, C11 is set by default for $CC and $CXX via the
      -std=...11 flag. In this patch, we split the "-std" flag out of the $CC
      and $CXX variables, which we traditionally assume to be just the
      executable name/path, and move it to $CFLAGS/$CXXFLAGS instead.
      
      Fixes #24324
      cdddeb0f
    • Matthew Craven's avatar
      Bump bytestring submodule to something closer to 0.12.1 · 27020458
      Matthew Craven authored and Marge Bot's avatar Marge Bot committed
      ...mostly so that 16d6b7e835ffdcf9b894e79f933dd52348dedd0c
      (which reworks unaligned writes in Builder) and the stuff in
      https://github.com/haskell/bytestring/pull/631 can see wider testing.
      
      The less-terrible code for unaligned writes used in Builder on
      hosts not known to be ulaigned-friendly also takes less effort
      for GHC to compile, resulting in a metric decrease for T21839c
      on some platforms.
      
      The metric increase on T21839r is caused by the unrelated commit
      750dac33465e7b59100698a330b44de7049a345c.  It perhaps warrants
      further analysis and discussion (see #23822) but is not critical.
      
      Metric Decrease:
      T21839c
      Metric Increase:
      T21839r
      27020458
  3. Feb 01, 2024
  4. Jan 31, 2024
  5. Jan 29, 2024
  6. Jan 26, 2024
  7. Jan 25, 2024
Loading