Skip to content
Commits on Source (302)
......@@ -30,6 +30,7 @@ BuildFlavour=$BUILD_FLAVOUR
ifneq "\$(BuildFlavour)" ""
include mk/flavours/\$(BuildFlavour).mk
endif
GhcLibHcOpts+=-haddock
EOF
case "$(uname)" in
......
--command utils/ghc-in-ghci/run.sh
--command ./hadrian/ghci.sh
--reload compiler
--reload ghc
--reload includes
--restart utils/ghc-in-ghci/run.sh
--restart utils/ghc-in-ghci/load-main.ghci
--restart utils/ghc-in-ghci/settings.ghci
--restart hadrian/
......@@ -123,6 +123,7 @@ _darcs/
/settings
/ghc.spec
/ghc/ghc-bin.cabal
/includes/dist/
/includes/ghcautoconf.h
/includes/ghcplatform.h
/includes/ghcversion.h
......
......@@ -2,7 +2,11 @@ variables:
GIT_SSL_NO_VERIFY: "1"
# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV: cefaee3c742af193e0f7783f87edb0d35374515c
DOCKER_REV: ac65f31dcffb09cd7ca7aaa70f447fcbb19f427f
# Sequential version number capturing the versions of all tools fetched by
# .gitlab/win32-init.sh.
WINDOWS_TOOLCHAIN_VERSION: 1
before_script:
- python3 .gitlab/fix-submodules.py
......@@ -15,7 +19,7 @@ stages:
- lint # Source linting
- build # A quick smoke-test to weed out broken commits
- full-build # Build all the things
- cleanup # See Note [Cleanup on Windows]
- cleanup # See Note [Cleanup after the shell executor]
- packaging # Source distribution, etc.
- hackage # head.hackage testing
- deploy # push documentation
......@@ -26,6 +30,7 @@ stages:
- /ghc-[0-9]+\.[0-9]+/
- merge_requests
- tags
- web
############################################################
# Runner Tags
......@@ -44,17 +49,23 @@ stages:
############################################################
ghc-linters:
allow_failure: true
stage: lint
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
script:
- git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
# Note [Unshallow clone for linting]
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# GitLab creates a shallow clone which means that we may not have the base
# commit of the MR being tested (e.g. if the MR is quite old), causing `git
# merge-base` to fail. Passing `--unshallow` to `git fetch` ensures that
# we have the entire history.
- git fetch --unshallow "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
- "echo Merge base $base"
- "echo Linting changes between $base..$CI_COMMIT_SHA"
# - validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
- validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA)
- .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA
- .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA
- .gitlab/linters/check-version-number.sh
dependencies: []
tags:
- lint
......@@ -69,6 +80,10 @@ ghc-linters:
stage: lint
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
script:
# See Note [Unshallow clone for linting]
- git fetch --unshallow "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
- "echo Linting changes between $base..$CI_COMMIT_SHA"
- submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA)
dependencies: []
tags:
......@@ -80,14 +95,26 @@ lint-submods:
refs:
- master
- /ghc-[0-9]+\.[0-9]+/
- wip/marge_bot_batch_merge_job
lint-submods-marge:
extends: .lint-submods
only:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_LABELS =~ /.*wip/marge_bot_batch_merge_job.*/
lint-submods-mr:
extends: .lint-submods
# Allow failure since any necessary submodule patches may not be upstreamed
# yet.
allow_failure: true
only:
refs:
- merge_requests
except:
variables:
- $CI_MERGE_REQUEST_LABELS =~ /.*wip/marge_bot_batch_merge_job.*/
.lint-changelogs:
stage: lint
......@@ -104,6 +131,7 @@ lint-submods-mr:
lint-changelogs:
extends: .lint-changelogs
# Allow failure since this isn't a final release.
allow_failure: true
only:
refs:
......@@ -112,7 +140,8 @@ lint-changelogs:
lint-release-changelogs:
extends: .lint-changelogs
only:
- tags
refs:
- /ghc-[0-9]+\.[0-9]+\.[0-9]+-.*/
############################################################
......@@ -130,20 +159,24 @@ lint-release-changelogs:
- ./boot
- ./configure $CONFIGURE_ARGS
- hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --docs=no-sphinx binary-dist
- hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --docs=no-sphinx test --summary-junit=./junit.xml
- mv _build/bindist/ghc*.tar.xz ghc.tar.xz
cache:
key: hadrian
paths:
- cabal-cache
artifacts:
when: always
reports:
junit: junit.xml
expire_in: 2 week
paths:
- ghc.tar.xz
- junit.xml
validate-x86_64-linux-deb8-hadrian:
validate-x86_64-linux-deb9-hadrian:
extends: .validate-hadrian
stage: build
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb8:$DOCKER_REV"
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
before_script:
# workaround for docker permissions
- sudo chown ghc:ghc -R .
......@@ -158,7 +191,7 @@ validate-x86_64-linux-deb8-hadrian:
hadrian-ghc-in-ghci:
<<: *only-default
stage: build
image: ghcci/x86_64-linux-deb8:0.1
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
before_script:
# workaround for docker permissions
- sudo chown ghc:ghc -R .
......@@ -170,6 +203,7 @@ hadrian-ghc-in-ghci:
- x86_64-linux
script:
- cabal update
- cd hadrian; cabal new-build --project-file=ci.project; cd ..
- git clean -xdf && git submodule foreach git clean -xdf
- bash .circleci/prepare-system.sh
- if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
......@@ -198,6 +232,8 @@ hadrian-ghc-in-ghci:
- |
THREADS=`mk/detect-cpu-count.sh`
make V=0 -j$THREADS WERROR=-Werror
- |
make bindisttest
- |
make binary-dist TAR_COMP_OPTS="-1"
- |
......@@ -259,6 +295,47 @@ validate-x86_64-darwin:
- cabal-cache
- toolchain
# Disabled because of OS X CI capacity
.validate-x86_64-darwin-hadrian:
<<: *only-default
stage: full-build
tags:
- x86_64-darwin
variables:
GHC_VERSION: 8.6.3
MACOSX_DEPLOYMENT_TARGET: "10.7"
ac_cv_func_clock_gettime: "no"
LANG: "en_US.UTF-8"
CONFIGURE_ARGS: --with-intree-gmp
TEST_ENV: "x86_64-darwin"
before_script:
- git clean -xdf && git submodule foreach git clean -xdf
- python3 .gitlab/fix-submodules.py
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
- "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
- bash .gitlab/darwin-init.sh
- PATH="`pwd`/toolchain/bin:$PATH"
script:
- cabal update
- ./boot
- ./configure $CONFIGURE_ARGS
- hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --docs=no-sphinx binary-dist
- hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --docs=no-sphinx test --summary-junit=./junit.xml
- mv _build/bindist/ghc*.tar.xz ghc.tar.xz
after_script:
- cp -Rf $HOME/.cabal cabal-cache
artifacts:
when: always
expire_in: 2 week
reports:
junit: junit.xml
paths:
- ghc.tar.xz
- junit.xml
.validate-linux:
extends: .validate
tags:
......@@ -270,6 +347,11 @@ validate-x86_64-darwin:
- git submodule update --init --recursive
- git checkout .gitmodules
- "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
# Build hyperlinked sources for documentation when building releases
- |
if [[ -n "$CI_COMMIT_TAG" ]]; then
echo "EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump" >> mk/build.mk
fi
- bash .circleci/prepare-system.sh
# workaround for docker permissions
......@@ -419,6 +501,21 @@ validate-x86_64-linux-deb9-unreg:
CONFIGURE_ARGS: --enable-unregisterised
TEST_ENV: "x86_64-linux-deb9-unreg"
release-x86_64-linux-deb9-dwarf:
extends: .validate-linux
stage: build
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
allow_failure: true
variables:
CONFIGURE_ARGS: "--enable-dwarf-unwind"
BUILD_FLAVOUR: dwarf
TEST_ENV: "x86_64-linux-deb9"
artifacts:
when: always
expire_in: 2 week
cache:
key: linux-x86_64-deb9
#################################
# x86_64-linux-deb8
......@@ -439,6 +536,27 @@ release-x86_64-linux-deb8:
when: always
expire_in: 2 week
#################################
# x86_64-linux-centos7
#################################
release-x86_64-linux-centos7:
extends: .validate-linux
stage: full-build
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-centos7:$DOCKER_REV"
variables:
# The sphinx release shipped with Centos 7 fails to build out documentation
BUILD_SPHINX_HTML: "NO"
BUILD_SPHINX_PDF: "NO"
TEST_ENV: "x86_64-linux-centos7"
BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-centos7-linux.tar.xz"
only:
- tags
cache:
key: linux-x86_64-centos7
artifacts:
when: always
expire_in: 2 week
#################################
# x86_64-linux-fedora27
......@@ -492,14 +610,16 @@ validate-x86_64-linux-fedora27:
cache:
paths:
- cabal-cache
- ghc-8.6.2
- ghc-8.6.5
- ghc-tarballs
.build-windows-hadrian:
extends: .build-windows
stage: full-build
variables:
GHC_VERSION: "8.6.2"
GHC_VERSION: "8.6.5"
# due to #16574 this currently fails
allow_failure: true
script:
- |
python boot
......@@ -520,7 +640,7 @@ validate-x86_64-windows-hadrian:
variables:
MSYSTEM: MINGW64
cache:
key: x86_64-windows-hadrian
key: "x86_64-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
nightly-i386-windows-hadrian:
extends: .build-windows-hadrian
......@@ -530,7 +650,7 @@ nightly-i386-windows-hadrian:
variables:
- $NIGHTLY
cache:
key: i386-windows-hadrian
key: "i386-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
.build-windows-make:
extends: .build-windows
......@@ -539,14 +659,16 @@ nightly-i386-windows-hadrian:
allow_failure: true
variables:
BUILD_FLAVOUR: "quick"
GHC_VERSION: "8.6.2"
GHC_VERSION: "8.6.5"
BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-mingw32.tar.xz"
script:
- |
python boot
bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex $CONFIGURE_ARGS'
- bash -c "echo include mk/flavours/${BUILD_FLAVOUR}.mk > mk/build.mk"
- bash -c "echo 'GhcLibHcOpts+=-haddock' >> mk/build.mk"
- bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
- bash -c "PATH=`pwd`/toolchain/bin:$PATH make bindisttest"
- bash -c "PATH=`pwd`/toolchain/bin:$PATH make binary-dist TAR_COMP_OPTS=-1"
- bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
tags:
......@@ -566,7 +688,7 @@ validate-x86_64-windows:
MSYSTEM: MINGW64
CONFIGURE_ARGS: "--target=x86_64-unknown-mingw32"
cache:
key: x86_64-windows
key: "x86_64-windows-$WINDOWS_TOOLCHAIN_VERSION"
# Normal Windows validate builds are profiled; that won't do for releases.
release-x86_64-windows:
......@@ -586,8 +708,10 @@ release-i386-windows:
MSYSTEM: MINGW32
BUILD_FLAVOUR: "perf"
CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
# Due to #15934
BUILD_PROF_LIBS: "NO"
cache:
key: i386-windows
key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
nightly-i386-windows:
extends: .build-windows-make
......@@ -597,8 +721,10 @@ nightly-i386-windows:
variables:
MSYSTEM: MINGW32
CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
# Due to #15934
BUILD_PROF_LIBS: "NO"
cache:
key: i386-windows
key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
############################################################
# Cleanup
......@@ -609,35 +735,18 @@ nightly-i386-windows:
#
# As noted in [1], gitlab-runner's shell executor doesn't clean up its working
# directory after builds. Unfortunately, we are forced to use the shell executor
# on Windows. To avoid running out of disk space we add a stage at the end of
# the build to remove the \GitLabRunner\builds directory. Since we only run a
# single build at a time on Windows this should be safe.
# on Darwin. To avoid running out of disk space we add a stage at the end of
# the build to remove the /.../GitLabRunner/builds directory. Since we only run a
# single build at a time on Darwin this should be safe.
#
# We used to have a similar cleanup job on Windows as well however it ended up
# being quite fragile as we have multiple Windows builders yet there is no
# guarantee that the cleanup job is run on the same machine as the build itself
# was run. Consequently we were forced to instead handle cleanup with a separate
# cleanup cron job on Windows.
#
# [1] https://gitlab.com/gitlab-org/gitlab-runner/issues/3856
# See Note [Cleanup after shell executor]
cleanup-windows:
<<: *only-default
stage: cleanup
tags:
- x86_64-windows
when: always
dependencies: []
before_script:
- echo "Time to clean up"
script:
- echo "Let's go"
after_script:
- set "BUILD_DIR=%CI_PROJECT_DIR%"
- set "BUILD_DIR=%BUILD_DIR:/=\%"
- echo "Cleaning %BUILD_DIR%"
- cd \GitLabRunner
# This is way more complicated than it should be:
# See https://stackoverflow.com/questions/1965787
- del %BUILD_DIR%\* /F /Q
- for /d %%p in (%BUILD_DIR%\*) do rd /Q /S "%%p"
- exit /b 0
# See Note [Cleanup after shell executor]
cleanup-darwin:
<<: *only-default
......@@ -670,6 +779,11 @@ doc-tarball:
dependencies:
- validate-x86_64-linux-deb9
- validate-x86_64-windows
variables:
LINUX_BINDIST: "ghc-x86_64-deb9-linux.tar.xz"
WINDOWS_BINDIST: "ghc-x86_64-mingw32.tar.xz"
# Due to Windows allow_failure
allow_failure: true
artifacts:
paths:
- haddock.html.tar.xz
......@@ -678,8 +792,17 @@ doc-tarball:
- index.html
- "*.pdf"
script:
- |
if [ ! -f "$LINUX_BINDIST" ]; then
echo "Error: $LINUX_BINDIST does not exist. Did the Debian 9 job fail?"
exit 1
fi
if [ ! -f "$WINDOWS_BINDIST" ]; then
echo "Error: $WINDOWS_BINDIST does not exist. Did the 64-bit Windows job fail?"
exit 1
fi
- rm -Rf docs
- bash -ex distrib/mkDocs/mkDocs ghc-x86_64-deb9-linux.tar.xz ghc-x86_64-mingw32.tar.xz
- bash -ex distrib/mkDocs/mkDocs $LINUX_BINDIST $WINDOWS_BINDIST
- ls -lh
- mv docs/*.tar.xz docs/index.html .
......@@ -688,6 +811,7 @@ source-tarball:
tags:
- x86_64-linux
image: ghcci/x86_64-linux-deb9:0.2
dependencies: []
only:
- tags
artifacts:
......@@ -746,6 +870,8 @@ pages:
dependencies:
- doc-tarball
image: ghcci/x86_64-linux-deb9:0.2
# Due to Windows allow_failure
allow_failure: true
tags:
- x86_64-linux
script:
......@@ -753,10 +879,15 @@ pages:
- tar -xf haddock.html.tar.xz -C public/doc
- tar -xf libraries.html.tar.xz -C public/doc
- tar -xf users_guide.html.tar.xz -C public/doc
- |
cat >public/index.html <<EOF
<!DOCTYPE HTML>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=doc/">
EOF
- cp -f index.html public/doc
only:
- master
artifacts:
paths:
- public
......@@ -20,5 +20,5 @@ Optional:
* System Architecture:
/label %bug
/label %"needs triage"
/label ~bug
/label ~"needs triage"
......@@ -8,6 +8,6 @@ be solved.
Describe your proposed feature here.
/label %"feature request"
/label %"needs triage"
/label ~"feature request"
/label ~"needs triage"
#!/usr/bin/env bash
set -e
grep -E -q '\[[0-9]+\.[0-9]+\.[0-9]+\]' configure.ac ||
( echo "error: configure.ac: GHC version number must have three components."; exit 1 )
......@@ -27,7 +27,8 @@ if [ ! -e $toolchain/bin/ghc ]; then
fi
if [ ! -e $toolchain/bin/cabal ]; then
curl https://www.haskell.org/cabal/release/cabal-install-2.2.0.0/cabal-install-2.2.0.0-i386-unknown-mingw32.zip > /tmp/cabal.zip
url="https://downloads.haskell.org/~cabal/cabal-install-latest/cabal-install-2.4.1.0-x86_64-unknown-mingw32.zip"
curl $url > /tmp/cabal.zip
unzip /tmp/cabal.zip
mv cabal.exe $toolchain/bin
fi
......
===============================================
The Glasgow Haskell Compiler -- version 8.2.2
===============================================
The GHC Team is pleased to announce a new minor release of GHC. This release
builds on the performance and stability improvements of 8.2.1, fixing a variety
of correctness bugs, improving error messages, and making the compiler more
portable.
Notable bug-fixes include
* A correctness issue resulting in segmentation faults in some
FFI-users (#13707, #14346)
* A correctness issue resulting in undefined behavior in some programs
using STM (#14171)
* A bug which may have manifested in segmentation faults in
out-of-memory condition (#14329)
* clearBit of Natural no longer bottoms (#13203)
* A specialisation bug resulting in exponential blowup of compilation
time in some specialisation-intensive programs (#14379)
* ghc-pkg now works even in environments with misconfigured NFS mounts
(#13945)
* GHC again supports production of position-independent executables
(#13702)
* Better error messages around kind mismatches (#11198, #12373, #13530,
#13610)
A thorough list of the changes in the release can be found in the release
notes,
https://haskell.org/ghc/docs/8.2.2/html/users_guide/8.2.2-notes.html
How to get it
~~~~~~~~~~~~~
This release can be downloaded from
https://www.haskell.org/ghc/download_ghc_8_2_2.html
For older versions see
https://www.haskell.org/ghc/
We supply binary builds in the native package format for many platforms, and the
source distribution is available from the same place.
Background
~~~~~~~~~~
Haskell is a standardized lazy functional programming language.
GHC is a state-of-the-art programming suite for Haskell. Included is an
optimising compiler generating efficient code for a variety of platforms,
together with an interactive system for convenient, quick development. The
distribution includes space and time profiling facilities, a large collection of
libraries, and support for various language extensions, including concurrency,
exceptions, and foreign language interfaces. GHC is distributed under a
BSD-style open source license.
A wide variety of Haskell related resources (tutorials, libraries,
specifications, documentation, compilers, interpreters, references, contact
information, links to research groups) are available from the Haskell home page
(see below).
On-line GHC-related resources
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Relevant URLs:
GHC home page https://www.haskell.org/ghc/
GHC developers' home page https://gitlab.haskell.org/ghc/ghc/wikis/
Haskell home page https://www.haskell.org/
Supported Platforms
~~~~~~~~~~~~~~~~~~~
The list of platforms we support, and the people responsible for them, is here:
https://gitlab.haskell.org/ghc/ghc/wikis/team-ghc
Ports to other platforms are possible with varying degrees of difficulty. The
Building Guide describes how to go about porting to a new platform:
https://gitlab.haskell.org/ghc/ghc/wikis/building
Developers
~~~~~~~~~~
We welcome new contributors. Instructions on accessing our source code
repository, and getting started with hacking on GHC, are available from the
GHC's developer's site:
https://gitlab.haskell.org/ghc/ghc/wikis/
Mailing lists
~~~~~~~~~~~~~
We run mailing lists for GHC users and bug reports; to subscribe, use the web
interfaces at
https://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
There are several other haskell and ghc-related mailing lists on
www.haskell.org; for the full list, see
https://mail.haskell.org/cgi-bin/mailman/listinfo
Many GHC developers hang out on #haskell on IRC:
https://www.haskell.org/haskellwiki/IRC_channel
Please report bugs using our bug tracking system. Instructions on reporting bugs
can be found here:
https://www.haskell.org/ghc/reportabug
......@@ -12,15 +12,15 @@
# RTS-like things
/rts/ @bgamari @simonmar @osa1 @Phyx @angerman
/rts/linker/ @angerman @Phyx
/rts/linker/ @angerman @Phyx @simonmar
/includes/ @bgamari @simonmar @osa1
# The compiler
/compiler/parser/ @int-index
/compiler/typecheck/ @simonpj @goldfire
/compiler/rename/ @simonpj @goldfire
/compiler/types/ @simonpj @goldfire
/compiler/deSugar/ @simonpj @goldfire
/compiler/typecheck/ @simonpj @rae
/compiler/rename/ @simonpj @rae
/compiler/types/ @simonpj @rae
/compiler/deSugar/ @simonpj @rae
/compiler/typecheck/TcDeriv* @RyanGlScott
/compiler/nativeGen/ @simonmar @bgamari @AndreasK
/compiler/llvmGen/ @angerman
......@@ -34,11 +34,12 @@
/compiler/simplStg/StgLiftLams.hs @sgraf
/compiler/cmm/CmmSwitch.hs @nomeata
/compiler/stranal/DmdAnal.hs @simonpj @sgraf
/compiler/hsSyn/Convert.hs @goldfire
/compiler/hsSyn/Convert.hs @rae
# Core libraries
/libraries/base/ @hvr
/libraries/template-haskell/ @goldfire
/libraries/ghci/ @simonmar
/libraries/template-haskell/ @rae
# Internal utilities and libraries
/libraries/libiserv/ @angerman @simonmar
......
......@@ -30,7 +30,7 @@ find an overview here:
Next, clone the repository and all the associated libraries:
```
$ git clone --recursive git://git.haskell.org/ghc.git
$ git clone --recursive git@gitlab.haskell.org:ghc/ghc.git
```
On Windows, you need an extra repository containing some build tools.
......@@ -63,10 +63,8 @@ Now, hack on your copy and rebuild (with `make`) as necessary.
Then start by making your commits however you want. When you're done, you can submit
a pull request on Github for small changes. For larger changes the patch needs to be
submitted to [Phabricator](https://phabricator.haskell.org/) for code review.
The GHC Wiki has a good summary for the [overall process](https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions/fixing-bugs)
as well as a guide on
[how to use Phabricator/arcanist](https://gitlab.haskell.org/ghc/ghc/wikis/phabricator).
submitted to [GitLab](https://gitlab.haskell.org/ghc/ghc/merge_requests) for code review.
The GHC Wiki has a good summary for the [overall process](https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions/fixing-bugs).
Useful links:
......@@ -75,23 +73,23 @@ Useful links:
An overview of things like using git, the release process, filing bugs
and more can be located here:
<https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions>
<https://gitlab.haskell.org/ghc/ghc/wikis/contributing>
You can find our coding conventions for the compiler and RTS here:
<https://gitlab.haskell.org/ghc/ghc/wikis/commentary/coding-style>
<https://gitlab.haskell.org/ghc/ghc/wikis/commentary/rts/conventions>
A high level overview of the bug tracker:
<https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions/bug-tracker>
If you're going to contribute regularly, **learning how to use the
build system is important** and will save you lots of time. You should
read over this page carefully:
<https://gitlab.haskell.org/ghc/ghc/wikis/building/using>
If you want to watch issues and code review activities, the following page is a good start:
<https://gitlab.haskell.org/ghc/ghc/activity>
How to communicate with us
==========================
......@@ -126,10 +124,6 @@ undoubtedly also interested in the other mailing lists:
* [glasgow-haskell-users](http://www.haskell.org/mailman/listinfo/glasgow-haskell-users)
is where developers/users meet.
* [ghc-tickets](http://www.haskell.org/mailman/listinfo/ghc-tickets)
for email from Trac.
* [ghc-builds](http://www.haskell.org/mailman/listinfo/ghc-builds)
for nightly build emails.
* [ghc-commits](http://www.haskell.org/mailman/listinfo/ghc-commits)
for commit messages when someone pushes to the repository.
......
......@@ -18,7 +18,7 @@ XeLaTex (only for PDF output).
Quick start: the following gives you a default build:
$ python3 boot
$ ./boot
$ ./configure
$ make
$ make install
......@@ -31,7 +31,7 @@ Quick start: the following gives you a default build:
You can use Make's `-jN` option to parallelize the build. It's generally best
to set `N` somewhere around the core count of the build machine.
The `python3 boot` step is only necessary if this is a tree checked out from
The `./boot` step is only necessary if this is a tree checked out from
git. For source distributions downloaded from GHC's web site, this step has
already been performed.
......@@ -43,6 +43,6 @@ It can take a long time. To customise the build, see the file
References
==========
[1] http://www.haskell.org/ghc/
[2] https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation
[3] http://www.haskell.org/haddock/
- [1] http://www.haskell.org/ghc/
- [2] https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation
- [3] http://www.haskell.org/haddock/
......@@ -3,9 +3,9 @@ Quick `make` guide for GHC
For a "Getting Started" guide, see:
https://gitlab.haskell.org/ghc/ghc/wikis/building/quick-start
https://gitlab.haskell.org/ghc/ghc/wikis/building/using
https://gitlab.haskell.org/ghc/ghc/wikis/building/standard-targets
- https://gitlab.haskell.org/ghc/ghc/wikis/building/quick-start
- https://gitlab.haskell.org/ghc/ghc/wikis/building/using
- https://gitlab.haskell.org/ghc/ghc/wikis/building/standard-targets
Common commands:
......@@ -21,18 +21,18 @@ Common commands:
Builds everything in the given directory.
- cd <dir>; make help
- `cd <dir>; make help`
Shows the targets available in <dir>
- make install
- make install-strip
- `make install`
- `make install-strip`
Installs GHC, libraries and tools under $(prefix). The install-strip
variant strips executable files while installing them.
- make sdist
- make binary-dist
- `make sdist`
- `make binary-dist`
Builds a source or binary distribution respectively
......@@ -42,9 +42,9 @@ Common commands:
Show the value of make variable <var>. The show! variant works right after
./configure (it skips reading package-data.mk files).
- make clean
- make distclean
- make maintainer-clean
- `make clean`
- `make distclean`
- `make maintainer-clean`
Various levels of cleaning: "clean" restores the tree to the
state after "./configure", "distclean" restores to the state
......@@ -87,3 +87,10 @@ Using `make` in subdirectories
Bring a particular file up to date, e.g. make dist/build/Module.o
The name <file> is relative to the current directory
Useful links:
=============
See also "new Hadrian build system":
- https://gitlab.haskell.org/ghc/ghc/wikis/building/hadrian
The Glasgow Haskell Compiler
============================
[![Build Status](https://api.travis-ci.org/ghc/ghc.svg?branch=master)](http://travis-ci.org/ghc/ghc)
[![pipeline status](https://gitlab.haskell.org/ghc/ghc/badges/master/pipeline.svg?style=flat)](https://gitlab.haskell.org/ghc/ghc/commits/master)
This is the source tree for [GHC][1], a compiler and interactive
environment for the Haskell functional programming language.
......@@ -18,20 +18,20 @@ There are two ways to get a source tree:
1. *Download source tarballs*
Download the GHC source distribution:
Download the GHC source distribution:
ghc-<version>-src.tar.bz2
ghc-<version>-src.tar.xz
which contains GHC itself and the "boot" libraries.
which contains GHC itself and the "boot" libraries.
2. *Check out the source code from git*
$ git clone --recursive git://git.haskell.org/ghc.git
$ git clone --recursive git@gitlab.haskell.org:ghc/ghc.git
Note: cloning GHC from Github requires a special setup. See [Getting a GHC
repository from Github][7].
Note: cloning GHC from Github requires a special setup. See [Getting a GHC
repository from Github][7].
*See the GHC team's working conventions regarding [how to contribute a patch to GHC](https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions/fixing-bugs).* First time contributors are encouraged to get started by just sending a Pull Request.
*See the GHC team's working conventions regarding [how to contribute a patch to GHC](https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions/fixing-bugs).* First time contributors are encouraged to get started by just sending a Merge Request.
Building & Installing
......
......@@ -288,11 +288,31 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
esac
}
dnl Note [autoconf assembler checks and -flto]
dnl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dnl
dnl Autoconf's AC_COMPILE_IFELSE macro is fragile in the case of checks
dnl which require that the assembler is run. Specifically, GCC does not run
dnl the assembler if invoked with `-c -flto`; it merely dumps its internal
dnl AST to the object file, to be compiled and assembled during the final
dnl link.
dnl
dnl This can cause configure checks like that for the
dnl .subsections_via_symbols directive to pass unexpected (see #16440),
dnl leading the build system to incorrectly conclude that the directive is
dnl supported.
dnl
dnl For this reason, it is important that configure checks that rely on the
dnl assembler failing use AC_LINK_IFELSE rather than AC_COMPILE_IFELSE,
dnl ensuring that the assembler sees the check.
dnl
dnl ** check for Apple-style dead-stripping support
dnl (.subsections-via-symbols assembler directive)
AC_MSG_CHECKING(for .subsections_via_symbols)
AC_COMPILE_IFELSE(
dnl See Note [autoconf assembler checks and -flto]
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([], [__asm__ (".subsections_via_symbols");])],
[AC_MSG_RESULT(yes)
HaskellHaveSubsectionsViaSymbols=True
......@@ -305,8 +325,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
dnl ** check for .ident assembler directive
AC_MSG_CHECKING(whether your assembler supports .ident directive)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([__asm__ (".ident \"GHC x.y.z\"");])],
dnl See Note [autoconf assembler checks and -flto]
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([__asm__ (".ident \"GHC x.y.z\"");], [])],
[AC_MSG_RESULT(yes)
HaskellHaveIdentDirective=True],
[AC_MSG_RESULT(no)
......@@ -330,8 +351,15 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
;;
esac
AC_MSG_CHECKING(for GNU non-executable stack support)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([__asm__ (".section .note.GNU-stack,\"\",$progbits");], [0])],
dnl See Note [autoconf assembler checks and -flto]
AC_LINK_IFELSE(
dnl the `main` function is placed after the .note.GNU-stack directive
dnl so we need to ensure that the active segment is correctly set,
dnl otherwise `main` will be placed in the wrong segment.
[AC_LANG_PROGRAM([
__asm__ (".section .note.GNU-stack,\"\",$progbits");
__asm__ (".section .text");
], [0])],
[AC_MSG_RESULT(yes)
HaskellHaveGnuNonexecStack=True],
[AC_MSG_RESULT(no)
......@@ -469,16 +497,16 @@ AC_DEFUN([FP_SETTINGS],
[
if test "$windows" = YES -a "$EnableDistroToolchain" = "NO"
then
mingw_bin_prefix=mingw/bin/
SettingsCCompilerCommand="\$tooldir/${mingw_bin_prefix}gcc.exe"
SettingsHaskellCPPCommand="\$tooldir/${mingw_bin_prefix}gcc.exe"
mingw_bin_prefix='$$tooldir/mingw/bin/'
SettingsCCompilerCommand="${mingw_bin_prefix}gcc.exe"
SettingsHaskellCPPCommand="${mingw_bin_prefix}gcc.exe"
SettingsHaskellCPPFlags="$HaskellCPPArgs"
SettingsLdCommand="\$tooldir/${mingw_bin_prefix}ld.exe"
SettingsArCommand="\$tooldir/${mingw_bin_prefix}ar.exe"
SettingsRanlibCommand="\$tooldir/${mingw_bin_prefix}ranlib.exe"
SettingsDllWrapCommand="\$tooldir/${mingw_bin_prefix}dllwrap.exe"
SettingsWindresCommand="\$tooldir/${mingw_bin_prefix}windres.exe"
SettingsTouchCommand='$topdir/bin/touchy.exe'
SettingsLdCommand="${mingw_bin_prefix}ld.exe"
SettingsArCommand="${mingw_bin_prefix}ar.exe"
SettingsRanlibCommand="${mingw_bin_prefix}ranlib.exe"
SettingsDllWrapCommand="${mingw_bin_prefix}dllwrap.exe"
SettingsWindresCommand="${mingw_bin_prefix}windres.exe"
SettingsTouchCommand='$$topdir/bin/touchy.exe'
elif test "$EnableDistroToolchain" = "YES"
then
SettingsCCompilerCommand="$(basename $CC)"
......@@ -489,7 +517,7 @@ AC_DEFUN([FP_SETTINGS],
SettingsArCommand="$(basename $ArCmd)"
SettingsDllWrapCommand="$(basename $DllWrapCmd)"
SettingsWindresCommand="$(basename $WindresCmd)"
SettingsTouchCommand='$topdir/bin/touchy.exe'
SettingsTouchCommand='$$topdir/bin/touchy.exe'
else
SettingsCCompilerCommand="$CC"
SettingsHaskellCPPCommand="$HaskellCPPCmd"
......@@ -923,8 +951,8 @@ changequote([, ])dnl
])
if test ! -f compiler/parser/Parser.hs || test ! -f compiler/cmm/CmmParse.hs
then
FP_COMPARE_VERSIONS([$fptools_cv_happy_version],[-lt],[1.19.4],
[AC_MSG_ERROR([Happy version 1.19.4 or later is required to compile GHC.])])[]
FP_COMPARE_VERSIONS([$fptools_cv_happy_version],[-lt],[1.19.10],
[AC_MSG_ERROR([Happy version 1.19.10 or later is required to compile GHC.])])[]
fi
HappyVersion=$fptools_cv_happy_version;
AC_SUBST(HappyVersion)
......
......@@ -50,7 +50,7 @@ def check_for_url_rewrites():
Or start over, and clone the GHC repository from the haskell server:
git clone --recursive git://git.haskell.org/ghc.git
git clone --recursive git@gitlab.haskell.org:ghc/ghc.git
For more information, see:
* https://gitlab.haskell.org/ghc/ghc/wikis/newcomers or
......
......@@ -729,7 +729,7 @@ summariseDecl _pn hsc_src lmodname@(L loc modname) Nothing
[] -- No exclusions
case r of
Nothing -> throwOneError (mkPlainErrMsg dflags loc (text "module" <+> ppr modname <+> text "was not found"))
Just (Left err) -> throwOneError err
Just (Left err) -> throwErrors err
Just (Right summary) -> return summary
-- | Up until now, GHC has assumed a single compilation target per source file.
......
......@@ -26,7 +26,7 @@ module BasicTypes(
Arity, RepArity, JoinArity,
Alignment,
Alignment, mkAlignment, alignmentOf, alignmentBytes,
PromotionFlag(..), isPromoted,
FunctionOrData(..),
......@@ -116,6 +116,7 @@ import Outputable
import SrcLoc ( Located,unLoc )
import Data.Data hiding (Fixity, Prefix, Infix)
import Data.Function (on)
import Data.Bits
{-
************************************************************************
......@@ -196,8 +197,39 @@ fIRST_TAG = 1
************************************************************************
-}
type Alignment = Int -- align to next N-byte boundary (N must be a power of 2).
-- | A power-of-two alignment
newtype Alignment = Alignment { alignmentBytes :: Int } deriving (Eq, Ord)
-- Builds an alignment, throws on non power of 2 input. This is not
-- ideal, but convenient for internal use and better then silently
-- passing incorrect data.
mkAlignment :: Int -> Alignment
mkAlignment n
| n == 1 = Alignment 1
| n == 2 = Alignment 2
| n == 4 = Alignment 4
| n == 8 = Alignment 8
| n == 16 = Alignment 16
| n == 32 = Alignment 32
| n == 64 = Alignment 64
| n == 128 = Alignment 128
| n == 256 = Alignment 256
| n == 512 = Alignment 512
| otherwise = panic "mkAlignment: received either a non power of 2 argument or > 512"
-- Calculates an alignment of a number. x is aligned at N bytes means
-- the remainder from x / N is zero. Currently, interested in N <= 8,
-- but can be expanded to N <= 16 or N <= 32 if used within SSE or AVX
-- context.
alignmentOf :: Int -> Alignment
alignmentOf x = case x .&. 7 of
0 -> Alignment 8
4 -> Alignment 4
2 -> Alignment 2
_ -> Alignment 1
instance Outputable Alignment where
ppr (Alignment m) = ppr m
{-
************************************************************************
* *
......
......@@ -22,7 +22,7 @@ module Demand (
DmdType(..), dmdTypeDepth, lubDmdType, bothDmdType,
nopDmdType, botDmdType, mkDmdType,
addDemand, removeDmdTyArgs,
addDemand, ensureArgs,
BothDmdArg, mkBothDmdArg, toBothDmdArg,
DmdEnv, emptyDmdEnv,
......@@ -34,7 +34,7 @@ module Demand (
vanillaCprProdRes, cprSumRes,
appIsBottom, isBottomingSig, pprIfaceStrictSig,
trimCPRInfo, returnsCPR_maybe,
StrictSig(..), mkStrictSig, mkClosedStrictSig,
StrictSig(..), mkStrictSigForArity, mkClosedStrictSig,
nopSig, botSig, cprProdSig,
isTopSig, hasDemandEnvSig,
splitStrictSig, strictSigDmdEnv,
......@@ -47,10 +47,10 @@ module Demand (
deferAfterIO,
postProcessUnsat, postProcessDmdType,
splitProdDmd_maybe, peelCallDmd, peelManyCalls, mkCallDmd,
splitProdDmd_maybe, peelCallDmd, peelManyCalls, mkCallDmd, mkCallDmds,
mkWorkerDemand, dmdTransformSig, dmdTransformDataConSig,
dmdTransformDictSelSig, argOneShots, argsOneShots, saturatedByOneShots,
trimToType, TypeShape(..),
TypeShape(..), peelTsFuns, trimToType,
useCount, isUsedOnce, reuseEnv,
killUsageDemand, killUsageSig, zapUsageDemand, zapUsageEnvSig,
......@@ -675,10 +675,15 @@ mkProdDmd dx
= JD { sd = mkSProd $ map getStrDmd dx
, ud = mkUProd $ map getUseDmd dx }
-- | Wraps the 'CleanDemand' with a one-shot call demand: @d@ -> @C1(d)@.
mkCallDmd :: CleanDemand -> CleanDemand
mkCallDmd (JD {sd = d, ud = u})
= JD { sd = mkSCall d, ud = mkUCall One u }
-- | @mkCallDmds n d@ returns @C1(C1...(C1 d))@ where there are @n@ @C1@'s.
mkCallDmds :: Arity -> CleanDemand -> CleanDemand
mkCallDmds arity cd = iterate mkCallDmd cd !! arity
-- See Note [Demand on the worker] in WorkWrap
mkWorkerDemand :: Int -> Demand
mkWorkerDemand n = JD { sd = Lazy, ud = Use One (go n) }
......@@ -804,6 +809,13 @@ instance Outputable TypeShape where
ppr (TsFun ts) = text "TsFun" <> parens (ppr ts)
ppr (TsProd tss) = parens (hsep $ punctuate comma $ map ppr tss)
-- | @peelTsFuns n ts@ tries to peel off @n@ 'TsFun' constructors from @ts@ and
-- returns 'Just' the wrapped 'TypeShape' on success, and 'Nothing' otherwise.
peelTsFuns :: Arity -> TypeShape -> Maybe TypeShape
peelTsFuns 0 ts = Just ts
peelTsFuns n (TsFun ts) = peelTsFuns (n-1) ts
peelTsFuns _ _ = Nothing
trimToType :: Demand -> TypeShape -> Demand
-- See Note [Trimming a demand to a type]
trimToType (JD { sd = ms, ud = mu }) ts
......@@ -1207,12 +1219,8 @@ mkDmdType fv ds res = DmdType fv ds res
dmdTypeDepth :: DmdType -> Arity
dmdTypeDepth (DmdType _ ds _) = length ds
-- Remove any demand on arguments. This is used in dmdAnalRhs on the body
removeDmdTyArgs :: DmdType -> DmdType
removeDmdTyArgs = ensureArgs 0
-- This makes sure we can use the demand type with n arguments,
-- It extends the argument list with the correct resTypeArgDmd
-- | This makes sure we can use the demand type with n arguments.
-- It extends the argument list with the correct resTypeArgDmd.
-- It also adjusts the DmdResult: Divergence survives additional arguments,
-- CPR information does not (and definite converge also would not).
ensureArgs :: Arity -> DmdType -> DmdType
......@@ -1567,8 +1575,56 @@ and <L,U(U,U)> on the second, then returning a constructor.
If this same function is applied to one arg, all we can say is that it
uses x with <L,U>, and its arg with demand <L,U>.
Note [Understanding DmdType and StrictSig]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demand types are sound approximations of an expression's semantics relative to
the incoming demand we put the expression under. Consider the following
expression:
\x y -> x `seq` (y, 2*x)
Here is a table with demand types resulting from different incoming demands we
put that expression under. Note the monotonicity; a stronger incoming demand
yields a more precise demand type:
incoming demand | demand type
----------------------------------------------------
<S ,HU > | <L,U><L,U>{}
<C(C(S )),C1(C1(U ))> | <S,U><L,U>{}
<C(C(S(S,L))),C1(C1(U(1*U,A)))> | <S,1*HU><S,1*U>{}
Note that in the first example, the depth of the demand type was *higher* than
the arity of the incoming call demand due to the anonymous lambda.
The converse is also possible and happens when we unleash demand signatures.
In @f x y@, the incoming call demand on f has arity 2. But if all we have is a
demand signature with depth 1 for @f@ (which we can safely unleash, see below),
the demand type of @f@ under a call demand of arity 2 has a *lower* depth of 1.
So: Demand types are elicited by putting an expression under an incoming (call)
demand, the arity of which can be lower or higher than the depth of the
resulting demand type.
In contrast, a demand signature summarises a function's semantics *without*
immediately specifying the incoming demand it was produced under. Despite StrSig
being a newtype wrapper around DmdType, it actually encodes two things:
* The threshold (i.e., minimum arity) to unleash the signature
* A demand type that is sound to unleash when the minimum arity requirement is
met.
Here comes the subtle part: The threshold is encoded in the wrapped demand
type's depth! So in mkStrictSigForArity we make sure to trim the list of
argument demands to the given threshold arity. Call sites will make sure that
this corresponds to the arity of the call demand that elicited the wrapped
demand type. See also Note [What are demand signatures?] in DmdAnal.
Besides trimming argument demands, mkStrictSigForArity will also trim CPR
information if necessary.
-}
-- | The depth of the wrapped 'DmdType' encodes the arity at which it is safe
-- to unleash. Better construct this through 'mkStrictSigForArity'.
-- See Note [Understanding DmdType and StrictSig]
newtype StrictSig = StrictSig DmdType
deriving( Eq )
......@@ -1580,34 +1636,43 @@ pprIfaceStrictSig :: StrictSig -> SDoc
pprIfaceStrictSig (StrictSig (DmdType _ dmds res))
= hcat (map ppr dmds) <> ppr res
mkStrictSig :: DmdType -> StrictSig
mkStrictSig dmd_ty = StrictSig dmd_ty
-- | Turns a 'DmdType' computed for the particular 'Arity' into a 'StrictSig'
-- unleashable at that arity. See Note [Understanding DmdType and StrictSig]
mkStrictSigForArity :: Arity -> DmdType -> StrictSig
mkStrictSigForArity arity dmd_ty = StrictSig (ensureArgs arity dmd_ty)
mkClosedStrictSig :: [Demand] -> DmdResult -> StrictSig
mkClosedStrictSig ds res = mkStrictSig (DmdType emptyDmdEnv ds res)
mkClosedStrictSig ds res = mkStrictSigForArity (length ds) (DmdType emptyDmdEnv ds res)
splitStrictSig :: StrictSig -> ([Demand], DmdResult)
splitStrictSig (StrictSig (DmdType _ dmds res)) = (dmds, res)
increaseStrictSigArity :: Int -> StrictSig -> StrictSig
-- Add extra arguments to a strictness signature
-- ^ Add extra arguments to a strictness signature.
-- In contrast to 'etaExpandStrictSig', this /prepends/ additional argument
-- demands and leaves CPR info intact.
increaseStrictSigArity arity_increase sig@(StrictSig dmd_ty@(DmdType env dmds res))
| isTopDmdType dmd_ty = sig
| arity_increase <= 0 = sig
| arity_increase == 0 = sig
| arity_increase < 0 = WARN( True, text "increaseStrictSigArity:"
<+> text "negative arity increase"
<+> ppr arity_increase )
nopSig
| otherwise = StrictSig (DmdType env dmds' res)
where
dmds' = replicate arity_increase topDmd ++ dmds
etaExpandStrictSig :: Arity -> StrictSig -> StrictSig
-- We are expanding (\x y. e) to (\x y z. e z)
-- Add exta demands to the /end/ of the arg demands if necessary
etaExpandStrictSig arity sig@(StrictSig dmd_ty@(DmdType env dmds res))
| isTopDmdType dmd_ty = sig
| arity_increase <= 0 = sig
| otherwise = StrictSig (DmdType env dmds' res)
where
arity_increase = arity - length dmds
dmds' = dmds ++ replicate arity_increase topDmd
-- ^ We are expanding (\x y. e) to (\x y z. e z).
-- In contrast to 'increaseStrictSigArity', this /appends/ extra arg demands if
-- necessary, potentially destroying the signature's CPR property.
etaExpandStrictSig arity (StrictSig dmd_ty)
| arity < dmdTypeDepth dmd_ty
-- an arity decrease must zap the whole signature, because it was possibly
-- computed for a higher incoming call demand.
= nopSig
| otherwise
= StrictSig $ ensureArgs arity dmd_ty
isTopSig :: StrictSig -> Bool
isTopSig (StrictSig ty) = isTopDmdType ty
......
......@@ -668,6 +668,7 @@ isBottomingId v
| isId v = isBottomingSig (idStrictness v)
| otherwise = False
-- | Accesses the 'Id''s 'strictnessInfo'.
idStrictness :: Id -> StrictSig
idStrictness id = strictnessInfo (idInfo id)
......