[Git][ghc/ghc][wip/expand-do] 5 commits: base: with{Binary}File{Blocking} only annotates own exceptions
Apoorv Ingle (@ani)
gitlab at gitlab.haskell.org
Mon Jan 29 13:24:37 UTC 2024
Apoorv Ingle pushed to branch wip/expand-do at Glasgow Haskell Compiler / GHC
Commits:
82a1c656 by Sebastian Nagel at 2024-01-29T02:32:40-05:00
base: with{Binary}File{Blocking} only annotates own exceptions
Fixes #20886
This ensures that inner, unrelated exceptions are not misleadingly
annotated with the opened file.
- - - - -
9294a086 by Andreas Klebinger at 2024-01-29T02:33:15-05:00
Fix fma warning when using llvm on aarch64.
On aarch64 fma is always on so the +fma flag doesn't exist for that
target. Hence no need to try and pass +fma to llvm.
Fixes #24379
- - - - -
51b10eba by Apoorv Ingle at 2024-01-29T07:22:20-06:00
Expand `do` blocks right before typechecking using the `HsExpansion` philosophy.
- A step towards killing `tcSyntaxOp`
- Fixes #18324 #20020 #23147 #22788 #15598 #22086 #21206
- Note [Expanding HsDo with HsExpansion] in `GHC.Tc.Gen.Do` explains change in detail
- Note 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
- New datatype to make this expansion work `GHC.Hs.Expr.XXExprGhcRn`:
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
- Kills `HsExpansion` and `HsExpanded` as we have inlined them in `XXExprGhcRn` and `XXExprGhcTc`
- `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`
- Ensures warnings such as
1. Pattern mach checks
2. Failable patterns
3. non-() return in body statements are preserved
- Expansions inside Template haskell also work without issues.
- Kill `HsMatchCtxt` in favor of `TcMatchAltChecker`
- Make records Expand and not desugar before typechecking.
- 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)
- - - - -
e531f9e0 by Apoorv Ingle at 2024-01-29T07:22:54-06:00
- hpc ticks, Do not count pattern match failures, update hpc tests
- - - - -
5fdfda8f by Apoorv Ingle at 2024-01-29T07:24:11-06:00
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.
- - - - -
30 changed files:
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- + compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cf9f49f36ea6acae9c2772571fd719b3ac827579...5fdfda8f92cef683081c70815f817aaced69384a
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cf9f49f36ea6acae9c2772571fd719b3ac827579...5fdfda8f92cef683081c70815f817aaced69384a
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240129/165bbf29/attachment-0001.html>
More information about the ghc-commits
mailing list