[Git][ghc/ghc][wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax] 15 commits: compiler: Fix CPP guards around ghc_unique_counter64
Patrick (@soulomoon)
gitlab at gitlab.haskell.org
Wed Jan 22 16:06:06 UTC 2025
Patrick pushed to branch wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax at Glasgow Haskell Compiler / GHC
Commits:
595013d4 by Ben Gamari at 2025-01-21T09:57:23-05:00
compiler: Fix CPP guards around ghc_unique_counter64
The `ghc_unique_counter64` symbol was introduced in the RTS in the
64-bit unique refactor (!10568) which has been backported to %9.6.7 and
%9.8.4. Update the CPP to reflect this.
Fixes #25576.
- - - - -
09ee3247 by Ryan Scott at 2025-01-21T09:58:00-05:00
Fix :info pretty-printing of UNPACKed fields
This patch:
* Ensures that we do not pretty-print a field like `foo :: {-# UNPACK #-} !Int`
as `foo :: ! {-# UNPACK -#} Int` (as we were doing before) when running the
`:info` command.
* Prevents coercions that arise from `UNPACK`ed fields (e.g., such as when one
unpacks a newtype) from being printed in `:info` output unless `-dppr-debug`
is enabled.
Fixes #25651.
- - - - -
6b7ea592 by Rodrigo Mesquita at 2025-01-21T16:10:35-05:00
driver: Store the HomePackageTable in a mutable reference
This commit refactors the HomePackageTable and HomeUnitGraph:
(1) It fixes a quadratic-in-the-number-of-modules space leak in upsweep (#25511)
(2) And it reworks these structures into their own modules to simplify
the driver. The refactor is driven by the introduction of IO in the HPT
interface, but is a bit more aggressive in simplifying the
interfaces to enforce correct usage (ie to avoid performance
pitfalls).
Specifically:
- The `HomeUnitGraph` (HUG) is now in `GHC.Unit.Home.Graph`
- The `HomePackageTable` (HPT) is now in `GHC.Unit.Home.PackageTable`
- The HPT now stores an `IORef` with the table of loaded home package modules.
- The interface to the HPT now requires IO
- The interface now enforces that the HPT is a datastructure that
only grows
- This is not enforced in the interface, but, clients of the HPT
should never care about there being more or less entries in the
HPT when these additional entries are not relevant to their result.
- The exception to the invariant that the HPT is monotonically
increasing is `restrictHpt`, a function which is called at a
"barrier point" (during which there are no other threads
inspecting or inserting in the HPT). The invariant can be
temporarily broken at this point (currently, after upsweep).
This is safe because a single thread holds control over the
structure (thus the invariant being broken is never observed).
The hug_var and associated structures in the driver, which aimed to
improve memory usage in the driver by updating in place a HUG during
upsweep, are no longer required as the HPT entries in the HUG are now
themselves mutable by construction. This was previously explained in
Note [ModuleNameSet, efficiency and space leaks], which is no longer
relevant and was deleted.
Fixes #25511
Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com>
-------------------------
Metric Decrease:
MultiComponentModulesRecomp
MultiLayerModulesRecomp
-------------------------
- - - - -
f983a00f by Jens Petersen at 2025-01-21T16:11:12-05:00
hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23
Fix build with gcc-15 which defaults to C23 standard (-std=gnu23)
Fixes #25662
```
utils/hp2ps/Utilities.c:6:14: error:
warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch]
6 | extern void* malloc();
| ^~~~~~
|
6 | extern void* malloc();
| ^
utils/hp2ps/Utilities.c:5:1: error:
note: ‘malloc’ is declared in header ‘<stdlib.h>’
4 | #include "Error.h"
+++ |+#include <stdlib.h>
5 |
|
5 |
| ^
utils/hp2ps/Utilities.c: In function ‘xmalloc’:
utils/hp2ps/Utilities.c:80:17: error:
error: too many arguments to function ‘malloc’; expected 0, have 1
80 | r = (void*) malloc(n);
| ^~~~~~ ~
|
80 | r = (void*) malloc(n);
| ^
utils/hp2ps/Utilities.c:6:14: error:
note: declared here
6 | extern void* malloc();
| ^~~~~~
|
6 | extern void* malloc();
| ^
utils/hp2ps/Utilities.c: In function ‘xrealloc’:
utils/hp2ps/Utilities.c:92:18: error:
warning: conflicting types for built-in function ‘realloc’; expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch]
92 | extern void *realloc();
| ^~~~~~~
|
92 | extern void *realloc();
| ^
utils/hp2ps/Utilities.c:92:18: error:
note: ‘realloc’ is declared in header ‘<stdlib.h>’
|
92 | extern void *realloc();
| ^
utils/hp2ps/Utilities.c:94:9: error:
error: too many arguments to function ‘realloc’; expected 0, have 2
94 | r = realloc(p, n);
| ^~~~~~~ ~
|
94 | r = realloc(p, n);
| ^
utils/hp2ps/Utilities.c:92:18: error:
note: declared here
92 | extern void *realloc();
| ^~~~~~~
|
92 | extern void *realloc();
| ^
```
- - - - -
62e24547 by Patrick at 2025-01-23T00:05:35+08:00
update kcConDecl to also consider the result type
in newtype GADT instance
- - - - -
3545b055 by Patrick at 2025-01-23T00:05:35+08:00
peek at the result kind
- - - - -
063ca3d3 by Patrick at 2025-01-23T00:05:35+08:00
test if gadt has UserSuppliedResultKind in lhs, we let tc_res_kind to unify with rhs result kind if not to gain more inference
- - - - -
c6a6509b by Patrick at 2025-01-23T00:05:35+08:00
format and remove getTyConResultKind
- - - - -
4fccd34b by Patrick at 2025-01-23T00:05:35+08:00
format
- - - - -
c4089c8a by Patrick at 2025-01-23T00:05:35+08:00
add comment
- - - - -
216fd425 by Patrick at 2025-01-23T00:05:36+08:00
cleanup
- - - - -
af1497c8 by Patrick at 2025-01-23T00:05:36+08:00
cleanup
- - - - -
20f0006a by Patrick at 2025-01-23T00:05:36+08:00
update T25611a
- - - - -
a9d85561 by Patrick at 2025-01-23T00:05:36+08:00
rename and add note
- - - - -
193fe271 by Patrick at 2025-01-23T00:05:36+08:00
update note
- - - - -
30 changed files:
- compiler/GHC.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Data/IOEnv.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Usage.hs
- compiler/GHC/Iface/Errors.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Linker/ExtraObj.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Static.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Runtime/Interpreter/JS.hs
- compiler/GHC/Runtime/Loader.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Module.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1cdef6841ac7d3ce7753df7125f70e5e509f3b5f...193fe27100b476e930292ab22ee527f6e93e4d9f
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1cdef6841ac7d3ce7753df7125f70e5e509f3b5f...193fe27100b476e930292ab22ee527f6e93e4d9f
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/20250122/22dda8ec/attachment-0001.html>
More information about the ghc-commits
mailing list