Showing 653 changed files with 16,013 additions and 8,522 deletions.
@@ -93,6 +93,7 @@ Don Stewart <dons@galois.com> <dons@cse.unsw.edu.a
Don Stewart <dons@galois.com> dons <unknown>
Don Stewart <dons@galois.com> dons@cse.unsw.edu.au <unknown>
Don Syme <dsyme@microsoft.com> dsyme <unknown>
Douglas Wilson <douglas.wilson@gmail.com> doug <douglas.wilson@gmail.com>
Donnie Jones <donnie@darthik.com> donnie@darthik.com <unknown>
Duncan Coutts <duncan@well-typed.com> <duncan.coutts@worc.ox.ac.uk>
Duncan Coutts <duncan@well-typed.com> <duncan@community.haskell.org>
@@ -29,27 +29,27 @@ There are two ways to get a source tree:
$ git clone --recursive git://git.haskell.org/ghc.git

Note: cloning GHC from Github requires a special setup. See [Getting a GHC
repository from Github] [7].
repository from Github][7].

*See the GHC team's working conventions regarding [how to contribute a patch to GHC](http://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/FixingBugs).* First time contributors are encouraged to get started by just sending a Pull Request.


Building & Installing
=====================

For full information on building GHC, see the [GHC Building Guide] [3].
For full information on building GHC, see the [GHC Building Guide][3].
Here follows a summary - if you get into trouble, the Building Guide
has all the answers.

Before building GHC you may need to install some other tools and
libraries. See, [Setting up your system for building GHC] [8].
libraries. See, [Setting up your system for building GHC][8].

*NB.* In particular, you need [GHC] [1] installed in order to build GHC,
*NB.* In particular, you need [GHC][1] installed in order to build GHC,
because the compiler is itself written in Haskell. You also need
[Happy] [4], [Alex] [5], and [Cabal] [9]. For instructions on how
to port GHC to a new platform, see the [GHC Building Guide] [3].
[Happy][4], [Alex][5], and [Cabal][9]. For instructions on how
to port GHC to a new platform, see the [GHC Building Guide][3].

For building library documentation, you'll need [Haddock] [6]. To build
For building library documentation, you'll need [Haddock][6]. To build
the compiler documentation, you need [Sphinx](http://www.sphinx-doc.org/)
and Xelatex (only for PDF output).

@@ -71,7 +71,7 @@ almost always a win regardless of how many cores you have. As a simple rule,
you should have about N+1 jobs, where `N` is the amount of cores you have.)

The `./boot` step is only necessary if this is a tree checked out
from git. For source distributions downloaded from [GHC's web site] [1],
from git. For source distributions downloaded from [GHC's web site][1],
this step has already been performed.

These steps give you the default build, which includes everything
@@ -83,12 +83,12 @@ Filing bugs and feature requests

If you've encountered what you believe is a bug in GHC, or you'd like
to propose a feature request, please let us know! Submit a ticket in
our [bug tracker] [10] and we'll be sure to look into it. Remember:
our [bug tracker][10] and we'll be sure to look into it. Remember:
**Filing a bug is the best way to make sure your issue isn't lost over
time**, so please feel free.

If you're an active user of GHC, you may also be interested in joining
the [glasgow-haskell-users] [11] mailing list, where developers and
the [glasgow-haskell-users][11] mailing list, where developers and
GHC users discuss various topics and hang out.

Hacking & Developing GHC
@@ -103,7 +103,7 @@ Contributors & Acknowledgements
===============================

GHC in its current form wouldn't exist without the hard work of
[its many contributors] [12]. Over time, it has grown to include the
[its many contributors][12]. Over time, it has grown to include the
efforts and research of many institutions, highly talented people, and
groups from around the world. We'd like to thank them all, and invite
you to join!
@@ -20,14 +20,8 @@ AC_DEFUN([GHC_SELECT_FILE_EXTENSIONS],
$2='.exe'
$3='.dll'
;;
i386-apple-darwin|powerpc-apple-darwin)
$3='.dylib'
;;
x86_64-apple-darwin)
$3='.dylib'
;;
arm-apple-darwin10|i386-apple-darwin11|aarch64-apple-darwin14|x86_64-apple-darwin14)
$2='.a'
# apple platform uses .dylib (macOS, iOS, ...)
*-apple-*)
$3='.dylib'
;;
esac
@@ -142,9 +136,13 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS],
TargetVendor_CPP=` echo "$TargetVendor" | sed -e 's/\./_/g' -e 's/-/_/g'`
TargetOS_CPP=` echo "$TargetOS" | sed -e 's/\./_/g' -e 's/-/_/g'`
# we intend to pass trough --targets to llvm as is.
LLVMTarget_CPP=` echo "$target"`
echo "GHC build : $BuildPlatform"
echo "GHC host : $HostPlatform"
echo "GHC target : $TargetPlatform"
echo "LLVM target: $target"
AC_SUBST(BuildPlatform)
AC_SUBST(HostPlatform)
@@ -160,6 +158,7 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS],
AC_SUBST(HostOS_CPP)
AC_SUBST(BuildOS_CPP)
AC_SUBST(TargetOS_CPP)
AC_SUBST(LLVMTarget_CPP)
AC_SUBST(HostVendor_CPP)
AC_SUBST(BuildVendor_CPP)
@@ -390,6 +389,8 @@ AC_DEFUN([GET_ARM_ISA],
defined(__ARM_ARCH_6T2__) || \
defined(__ARM_ARCH_6Z__) || \
defined(__ARM_ARCH_6ZK__) || \
defined(__ARM_ARCH_6K__) || \
defined(__ARM_ARCH_6KZ__) || \
defined(__ARM_ARCH_6M__)
return 0;
#else
@@ -459,10 +460,11 @@ AC_DEFUN([GET_ARM_ISA],
# Set the variables used in the settings file
AC_DEFUN([FP_SETTINGS],
[
if test "$windows" = YES
if test "$windows" = YES -a "$EnableDistroToolchain" = "NO"
then
mingw_bin_prefix=mingw/bin/
SettingsCCompilerCommand="\$topdir/../${mingw_bin_prefix}gcc.exe"
SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2 -B\$topdir/../mingw/bin/ -B\$topdir/../mingw/lib/"
SettingsHaskellCPPCommand="\$topdir/../${mingw_bin_prefix}gcc.exe"
SettingsHaskellCPPFlags="$HaskellCPPArgs"
SettingsLdCommand="\$topdir/../${mingw_bin_prefix}ld.exe"
@@ -471,17 +473,45 @@ AC_DEFUN([FP_SETTINGS],
SettingsDllWrapCommand="\$topdir/../${mingw_bin_prefix}dllwrap.exe"
SettingsWindresCommand="\$topdir/../${mingw_bin_prefix}windres.exe"
SettingsTouchCommand='$topdir/bin/touchy.exe'
elif test "$EnableDistroToolchain" = "YES"
then
SettingsCCompilerCommand="$(basename $CC)"
SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2"
SettingsHaskellCPPCommand="$(basename $HaskellCPPCmd)"
SettingsHaskellCPPFlags="$HaskellCPPArgs"
SettingsLdCommand="$(basename $LdCmd)"
SettingsArCommand="$(basename $ArCmd)"
SettingsPerlCommand="$(basename $PerlCmd)"
SettingsDllWrapCommand="$(basename $DllWrapCmd)"
SettingsWindresCommand="$(basename $WindresCmd)"
SettingsTouchCommand='$topdir/bin/touchy.exe'
else
SettingsCCompilerCommand="$CC"
SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2"
SettingsHaskellCPPCommand="$HaskellCPPCmd"
SettingsHaskellCPPFlags="$HaskellCPPArgs"
SettingsLdCommand="$LdCmd"
SettingsArCommand="$ArCmd"
SettingsPerlCommand="$PerlCmd"
SettingsDllWrapCommand="/bin/false"
SettingsWindresCommand="/bin/false"
SettingsLibtoolCommand="libtool"
SettingsTouchCommand='touch'
if test -z "$DllWrapCmd"
then
SettingsDllWrapCommand="/bin/false"
else
SettingsDllWrapCommand="$DllWrapCmd"
fi
if test -z "$WindresCmd"
then
SettingsWindresCommand="/bin/false"
else
SettingsWindresCommand="$WindresCmd"
fi
SettingsTouchCommand='touch'
fi
if test -z "$LibtoolCmd"
then
SettingsLibtoolCommand="libtool"
else
SettingsLibtoolCommand="$LibtoolCmd"
fi
if test -z "$LlcCmd"
then
@@ -495,7 +525,6 @@ AC_DEFUN([FP_SETTINGS],
else
SettingsOptCommand="$OptCmd"
fi
SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2"
SettingsCCompilerLinkFlags="$CONF_GCC_LINKER_OPTS_STAGE2"
SettingsCCompilerSupportsNoPie="$CONF_GCC_SUPPORTS_NO_PIE"
SettingsLdFlags="$CONF_LD_LINKER_OPTS_STAGE2"
@@ -570,6 +599,7 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
# $5 is the name of the CPP flags variable
AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
[
FIND_LD([$$1],[UseLd])
AC_MSG_CHECKING([Setting up $2, $3, $4 and $5])
case $$1 in
i386-*)
@@ -585,18 +615,6 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
i386-portbld-freebsd*)
$2="$$2 -march=i686"
;;
i386-apple-darwin)
$2="$$2 -m32"
$3="$$3 -m32"
$4="$$4 -arch i386"
$5="$$5 -m32"
;;
x86_64-apple-darwin)
$2="$$2 -m64"
$3="$$3 -m64"
$4="$$4 -arch x86_64"
$5="$$5 -m64"
;;
x86_64-unknown-solaris2)
$2="$$2 -m64"
$3="$$3 -m64"
@@ -620,18 +638,14 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
;;
arm*linux*)
# On arm/linux and arm/android, tell gcc to generate Arm
# instructions (ie not Thumb) and to link using the gold linker.
# Forcing LD to be ld.gold is done in FIND_LD m4 macro.
# instructions (ie not Thumb).
$2="$$2 -marm"
$3="$$3 -fuse-ld=gold -Wl,-z,noexecstack"
$3="$$3 -Wl,-z,noexecstack"
$4="$$4 -z noexecstack"
;;
aarch64*linux*)
# On aarch64/linux and aarch64/android, tell gcc to link using the
# gold linker.
# Forcing LD to be ld.gold is done in FIND_LD m4 macro.
$3="$$3 -fuse-ld=gold -Wl,-z,noexecstack"
$3="$$3 -Wl,-z,noexecstack"
$4="$$4 -z noexecstack"
;;
@@ -652,6 +666,15 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
esac
case $UseLd in
*ld.gold)
$3="$$3 -fuse-ld=gold"
;;
*ld.bfd)
$3="$$3 -fuse-ld=bfd"
;;
esac
# If gcc knows about the stack protector, turn it off.
# Otherwise the stack-smash handler gets triggered.
echo 'int main(void) {return 0;}' > conftest.c
@@ -800,20 +823,17 @@ AC_CACHE_CHECK([leading underscore in symbol names], [fptools_cv_leading_undersc
# Hack!: nlist() under Digital UNIX insist on there being an _,
# but symbol table listings shows none. What is going on here?!?
case $TargetPlatform in
*linux-android*) fptools_cv_leading_underscore=no;;
*openbsd*) # x86 openbsd is ELF from 3.4 >, meaning no leading uscore
case $build in
i386-*2\.@<:@0-9@:>@ | i386-*3\.@<:@0-3@:>@ ) fptools_cv_leading_underscore=yes ;;
*) fptools_cv_leading_underscore=no ;;
esac ;;
i386-unknown-mingw32) fptools_cv_leading_underscore=yes;;
x86_64-unknown-mingw32) fptools_cv_leading_underscore=no;;
# HACK: Apple doesn't seem to provide nlist in the 64-bit-libraries
x86_64-apple-darwin*) fptools_cv_leading_underscore=yes;;
*-apple-ios) fptools_cv_leading_underscore=yes;;
*) AC_RUN_IFELSE([AC_LANG_SOURCE([[#ifdef HAVE_NLIST_H
# Apples mach-o platforms use leading underscores
*-apple-*) fptools_cv_leading_underscore=yes;;
*linux-android*) fptools_cv_leading_underscore=no;;
*openbsd*) # x86 openbsd is ELF from 3.4 >, meaning no leading uscore
case $build in
i386-*2\.@<:@0-9@:>@ | i386-*3\.@<:@0-3@:>@ ) fptools_cv_leading_underscore=yes ;;
*) fptools_cv_leading_underscore=no ;;
esac ;;
i386-unknown-mingw32) fptools_cv_leading_underscore=yes;;
x86_64-unknown-mingw32) fptools_cv_leading_underscore=no;;
*) AC_RUN_IFELSE([AC_LANG_SOURCE([[#ifdef HAVE_NLIST_H
#include <nlist.h>
struct nlist xYzzY1[] = {{"xYzzY1", 0},{0}};
struct nlist xYzzY2[] = {{"_xYzzY2", 0},{0}};
@@ -1149,7 +1169,7 @@ AC_DEFUN([FP_PROG_AR_NEEDS_RANLIB],[
if test $fp_prog_ar_is_gnu = yes
then
fp_cv_prog_ar_needs_ranlib=no
elif test "$TargetOS_CPP" = "darwin"
elif test "$TargetVendor_CPP" = "apple"
then
# It's quite tedious to check for Apple's crazy timestamps in
# .a files, so we hardcode it.
@@ -1886,12 +1906,11 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[
# --------------------------------
# converts os from gnu to ghc naming, and assigns the result to $target_var
AC_DEFUN([GHC_CONVERT_OS],[
case "$1-$2" in
darwin10-arm|darwin11-i386|darwin14-aarch64|darwin14-x86_64)
$3="ios"
;;
*)
case "$1" in
# watchos and tvos are ios variants as of May 2017.
ios|watchos|tvos)
$3="ios"
;;
linux-android*)
$3="linux-android"
;;
@@ -1905,6 +1924,9 @@ case "$1-$2" in
aix*) # e.g. powerpc-ibm-aix7.1.3.0
$3="aix"
;;
darwin*) # e.g. aarch64-apple-darwin14
$3="darwin"
;;
freebsd*) # like i686-gentoo-freebsd7
# i686-gentoo-freebsd8
# i686-gentoo-freebsd8.2
@@ -1918,8 +1940,6 @@ case "$1-$2" in
exit 1
;;
esac
;;
esac
])

# BOOTSTRAPPING_GHC_INFO_FIELD
@@ -1951,7 +1971,7 @@ AC_SUBST(LIBRARY_[]translit([$1], [-], [_])[]_VERSION)
# --------------------------------
# Gets the version number of XCode, if on a Mac
AC_DEFUN([XCODE_VERSION],[
if test "$TargetOS_CPP" = "darwin"
if test "$TargetVendor_CPP" = "apple"
then
AC_MSG_CHECKING(XCode version)
XCodeVersion=`xcodebuild -version | grep Xcode | sed "s/Xcode //"`
@@ -2001,22 +2021,31 @@ AC_DEFUN([FIND_LLVM_PROG],[
# Find the version of `ld` to use. This is used in both in the top level
# configure.ac and in distrib/configure.ac.in.
#
# $1 = the variable to set
# $1 = the platform
# $2 = the variable to set
#
AC_DEFUN([FIND_LD],[
AC_CHECK_TARGET_TOOL([LD], [ld])
case $target in
case $1 in
arm*linux* | \
aarch64*linux* )
# Arm and Aarch64 requires use of the binutils ld.gold linker.
# This case should catch at least arm-unknown-linux-gnueabihf,
# arm-linux-androideabi, arm64-unknown-linux and
# aarch64-linux-android
AC_CHECK_TARGET_TOOL([LD_GOLD], [ld.gold])
$1="$LD_GOLD"
if test "$LD_GOLD" != ""; then
$2="$LD_GOLD"
elif test `$LD --version | grep -c "GNU gold"` -gt 0; then
AC_MSG_NOTICE([ld is ld.gold])
$2="$LD"
else
AC_MSG_WARN([could not find ld.gold, falling back to $LD])
$2="$LD"
fi
;;
*)
$1="$LD"
$2="$LD"
;;
esac
])
@@ -18,7 +18,6 @@ module BkpSyn (
) where

import HsSyn
import RdrName
import SrcLoc
import Outputable
import Module
@@ -61,7 +60,7 @@ type LHsUnit n = Located (HsUnit n)
-- or an include.
data HsDeclType = ModuleD | SignatureD
data HsUnitDecl n
= DeclD HsDeclType (Located ModuleName) (Maybe (Located (HsModule RdrName)))
= DeclD HsDeclType (Located ModuleName) (Maybe (Located (HsModule GhcPs)))
| IncludeD (IncludeDecl n)
type LHsUnitDecl n = Located (HsUnitDecl n)