[Git][ghc/ghc][wip/T21623-tycon] 16 commits: Add unsafePtrEquality# restricted to UnliftedTypes

Andreas Klebinger (@AndreasK) gitlab at gitlab.haskell.org
Fri Nov 25 12:51:31 UTC 2022



Andreas Klebinger pushed to branch wip/T21623-tycon at Glasgow Haskell Compiler / GHC


Commits:
9d61c182 by Oleg Grenrus at 2022-11-22T15:59:34-05:00
Add unsafePtrEquality# restricted to UnliftedTypes

- - - - -
e817c871 by Jonathan Dowland at 2022-11-22T16:00:14-05:00
utils/unlit: adjust parser to match Report spec

The Haskell 2010 Report says that, for Latex-style Literate format,
"Program code begins on the first line following a line that begins
\begin{code}". (This is unchanged from the 98 Report)

However the unlit.c implementation only matches a line that contains
"\begin{code}" and nothing else. One consequence of this is that one
cannot suffix Latex options to the code environment. I.e., this does
not work:

\begin{code}[label=foo,caption=Foo Code]

Adjust the matcher to conform to the specification from the Report.

The Haskell Wiki currently recommends suffixing a '%' to \begin{code}
in order to deliberately hide a code block from Haskell. This is bad
advice, as it's relying on an implementation quirk rather than specified
behaviour. None-the-less, some people have tried to use it, c.f.
<https://mail.haskell.org/pipermail/haskell-cafe/2009-September/066780.html>

An alternative solution is to define a separate, equivalent Latex
environment to "code", that is functionally identical in Latex but
ignored by unlit. This should not be a burden: users are required to
manually define the code environment anyway, as it is not provided
by the Latex verbatim or lstlistings packages usually used for
presenting code in documents.

Fixes #3549.

- - - - -
0b7fef11 by Teo Camarasu at 2022-11-23T12:44:33-05:00
Fix eventlog all option

Previously it didn't enable/disable nonmoving_gc and ticky event types

Fixes #21813

- - - - -
04d0618c by Arnaud Spiwack at 2022-11-23T12:45:14-05:00
Expand Note [Linear types] with the stance on linting linearity

Per the discussion on #22123

- - - - -
e1538516 by Lawton Nichols at 2022-11-23T12:45:55-05:00
Add documentation on custom Prelude modules (#22228)

Specifically, custom Prelude modules that are named `Prelude`.

- - - - -
b5c71454 by Sylvain Henry at 2022-11-23T12:46:35-05:00
Don't let configure perform trivial substitutions (#21846)

Hadrian now performs substitutions, especially to generate .cabal files
from .cabal.in files. Two benefits:

1. We won't have to re-configure when we modify thing.cabal.in. Hadrian
   will take care of this for us.

2. It paves the way to allow the same package to be configured
   differently by Hadrian in the same session. This will be useful to
   fix #19174: we want to build a stage2 cross-compiler for the host
   platform and a stage1 compiler for the cross target platform in the
   same Hadrian session.

- - - - -
99aca26b by nineonine at 2022-11-23T12:47:11-05:00
CApiFFI: add ConstPtr for encoding const-qualified pointer return types (#22043)

Previously, when using `capi` calling convention in foreign declarations,
code generator failed to handle const-cualified pointer return types.
This resulted in CC toolchain throwing `-Wincompatible-pointer-types-discards-qualifiers`
warning.

`Foreign.C.Types.ConstPtr` newtype was introduced to handle these cases -
special treatment was put in place to generate appropritetly qualified C
wrapper that no longer triggers the above mentioned warning.

Fixes #22043

- - - - -
040bfdc3 by M Farkas-Dyck at 2022-11-23T21:59:03-05:00
Scrub some no-warning pragmas.

- - - - -
178c1fd8 by Vladislav Zavialov at 2022-11-23T21:59:39-05:00
Check if the SDoc starts with a single quote (#22488)

This patch fixes pretty-printing of character literals
inside promoted lists and tuples.

When we pretty-print a promoted list or tuple whose first element
starts with a single quote, we want to add a space between the opening
bracket and the element:

	'[True]    -- ok
	'[ 'True]  -- ok
	'['True]   -- not ok

If we don't add the space, we accidentally produce a character
literal '['.

Before this patch, pprSpaceIfPromotedTyCon inspected the type as an AST
and tried to guess if it would be rendered with a single quote. However,
it missed the case when the inner type was itself a character literal:

	'[ 'x']  -- ok
	'['x']   -- not ok

Instead of adding this particular case, I opted for a more future-proof
solution: check the SDoc directly. This way we can detect if the single
quote is actually there instead of trying to predict it from the AST.
The new function is called spaceIfSingleQuote.

- - - - -
11627c42 by Matthew Pickering at 2022-11-23T22:00:15-05:00
notes: Fix references to HPT space leak note

Updating this note was missed when updating the HPT to the HUG.

Fixes #22477

- - - - -
86ff1523 by Andrei Borzenkov at 2022-11-24T17:24:51-05:00
Convert diagnostics in GHC.Rename.Expr to proper TcRnMessage (#20115)

Problem: avoid usage of TcRnMessageUnknown

Solution:
The following `TcRnMessage` messages has been introduced:
  TcRnNoRebindableSyntaxRecordDot
  TcRnNoFieldPunsRecordDot
  TcRnIllegalStaticExpression
  TcRnIllegalStaticFormInSplice
  TcRnListComprehensionDuplicateBinding
  TcRnEmptyStmtsGroup
  TcRnLastStmtNotExpr
  TcRnUnexpectedStatementInContext
  TcRnIllegalTupleSection
  TcRnIllegalImplicitParameterBindings
  TcRnSectionWithoutParentheses

Co-authored-by: sheaf <sam.derbyshire at gmail.com>

- - - - -
d198a19a by Cheng Shao at 2022-11-24T17:25:29-05:00
rts: fix missing Arena.h symbols in RtsSymbols.c

It was an unfortunate oversight in !8961 and broke devel2 builds.

- - - - -
5943e739 by Bodigrim at 2022-11-25T04:38:28-05:00
Assorted fixes to avoid Data.List.{head,tail}

- - - - -
1f1b99b8 by sheaf at 2022-11-25T04:38:28-05:00
Review suggestions for assorted fixes to avoid Data.List.{head,tail}

- - - - -
13d627bb by Vladislav Zavialov at 2022-11-25T04:39:04-05:00
Print unticked promoted data constructors (#20531)

Before this patch, GHC unconditionally printed ticks before promoted
data constructors:

	ghci> type T = True  -- unticked (user-written)
	ghci> :kind! T
	T :: Bool
	= 'True              -- ticked (compiler output)

After this patch, GHC prints ticks only when necessary:

	ghci> type F = False    -- unticked (user-written)
	ghci> :kind! F
	F :: Bool
	= False                 -- unticked (compiler output)

	ghci> data False        -- introduce ambiguity
	ghci> :kind! F
	F :: Bool
	= 'False                -- ticked by necessity (compiler output)

The old behavior can be enabled by -fprint-redundant-promotion-ticks.

Summary of changes:
* Rename PrintUnqualified to NamePprCtx
* Add QueryPromotionTick to it
* Consult the GlobalRdrEnv to decide whether to print a tick (see mkPromTick)
* Introduce -fprint-redundant-promotion-ticks

Co-authored-by: Artyom Kuznetsov <hi at wzrd.ht>

- - - - -
948fc803 by Simon Peyton Jones at 2022-11-25T13:49:34+01:00
Refactor TyCon to have a top-level product

This patch changes the representation of TyCon so that it has
a top-level product type, with a field that gives the details
(newtype, type family etc), #22458.

Not much change in allocation, but execution seems to be a bit
faster.

- - - - -


30 changed files:

- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/ContFlowOpt.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/ProcPoint.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Core/Multiplicity.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CSE.hs
- compiler/GHC/Core/Opt/Monad.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Core/Tidy.hs
- + compiler/GHC/Core/TyCo/FVs.hs-boot
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCo/Tidy.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Data/FastString.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Config/Core/Lint.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9bef4adbb5bcf4c94d45a28b48f701cc2a6d1983...948fc803950236be32b9103384af0b0e4386f0b4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9bef4adbb5bcf4c94d45a28b48f701cc2a6d1983...948fc803950236be32b9103384af0b0e4386f0b4
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/20221125/1c324fe6/attachment-0001.html>


More information about the ghc-commits mailing list