...
 
Commits (90)
......@@ -767,6 +767,7 @@ validate-x86_64-linux-fedora27:
.build-windows:
<<: *only-default
allow_failure: true
before_script:
- git clean -xdf
......@@ -815,12 +816,10 @@ validate-x86_64-linux-fedora27:
- |
python boot
bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
- bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --flavour=Quick --docs=no-sphinx binary-dist"
- bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --docs=no-sphinx binary-dist"
- mv _build/bindist/ghc*.tar.xz ghc.tar.xz
- bash -c "export TOP=$(pwd); cd _build/bindist/ghc-*/ && PATH=$TOP/toolchain/bin:$PATH ./configure --prefix=$TOP/_build/install && make install && cd ../../../"
- bash -c "export TOP=$(pwd); PATH=$TOP/toolchain/bin:$PATH hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --flavour=quick test --summary-junit=./junit.xml --skip-perf --test-compiler=$TOP/_build/install/bin/ghc"
# skipping perf tests for now since we build a quick-flavoured GHC,
# which might result in some broken perf tests?
- bash -c "export TOP=$(pwd); PATH=$TOP/toolchain/bin:$PATH hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` test --summary-junit=./junit.xml --test-compiler=$TOP/_build/install/bin/ghc"
tags:
- x86_64-windows
artifacts:
......@@ -834,6 +833,7 @@ validate-x86_64-linux-fedora27:
validate-x86_64-windows-hadrian:
extends: .build-windows-hadrian
stage: full-build
variables:
MSYSTEM: MINGW64
TEST_ENV: "x86_64-windows-hadrian"
......
......@@ -647,6 +647,7 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
# $5 is the name of the CPP flags variable
AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
[
AC_REQUIRE([FP_PROG_LD_IS_GNU])
AC_MSG_CHECKING([Setting up $2, $3, $4 and $5])
case $$1 in
i386-*)
......@@ -663,10 +664,20 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$2="$$2 -march=i686"
;;
x86_64-unknown-solaris2)
# Solaris is a multi-lib platform, providing both 32- and 64-bit
# user-land. It appears to default to 32-bit builds but we of course want to
# compile for 64-bits on x86-64.
#
# On OpenSolaris uses gnu ld whereas SmartOS appears to use the Solaris
# implementation, which rather uses the -64 flag.
$2="$$2 -m64"
$3="$$3 -m64"
$4="$$4 -m64"
$5="$$5 -m64"
if test "$fp_cv_gnu_ld" = "yes"; then
$4="$$4 -m64"
else
$4="$$4 -64"
fi
;;
alpha-*)
# For now, to suppress the gcc warning "call-clobbered
......
......@@ -4,8 +4,8 @@
-- (c) The University of Glasgow 2002-2006
--
-- | ByteCodeLink: Bytecode assembler and linker
module ByteCodeAsm (
-- | Bytecode assembler and linker
module GHC.ByteCode.Asm (
assembleBCOs, assembleOneBCO,
bcoFreeNames,
......@@ -17,11 +17,11 @@ module ByteCodeAsm (
import GhcPrelude
import ByteCodeInstr
import ByteCodeItbls
import ByteCodeTypes
import GHC.ByteCode.Instr
import GHC.ByteCode.InfoTable
import GHC.ByteCode.Types
import GHCi.RemoteTypes
import GHCi
import GHC.Runtime.Interpreter
import HscTypes
import Name
......@@ -30,7 +30,7 @@ import Literal
import TyCon
import FastString
import GHC.StgToCmm.Layout ( ArgRep(..) )
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import DynFlags
import Outputable
import GHC.Platform
......@@ -55,7 +55,7 @@ import Data.Array.Unsafe( castSTUArray )
import Foreign
import Data.Char ( ord )
import Data.List
import Data.List ( genericLength )
import Data.Map (Map)
import Data.Maybe (fromMaybe)
import qualified Data.Map as Map
......@@ -460,8 +460,8 @@ assembleI dflags i = case i of
LitNumWord -> int (fromIntegral i)
LitNumInt64 -> int64 (fromIntegral i)
LitNumWord64 -> int64 (fromIntegral i)
LitNumInteger -> panic "ByteCodeAsm.literal: LitNumInteger"
LitNumNatural -> panic "ByteCodeAsm.literal: LitNumNatural"
LitNumInteger -> panic "GHC.ByteCode.Asm.literal: LitNumInteger"
LitNumNatural -> panic "GHC.ByteCode.Asm.literal: LitNumNatural"
-- We can lower 'LitRubbish' to an arbitrary constant, but @NULL@ is most
-- likely to elicit a crash (rather than corrupt memory) in case absence
-- analysis messed up.
......
......@@ -4,15 +4,15 @@
-- (c) The University of Glasgow 2002-2006
--
-- | ByteCodeItbls: Generate infotables for interpreter-made bytecodes
module ByteCodeItbls ( mkITbls ) where
-- | Generate infotables for interpreter-made bytecodes
module GHC.ByteCode.InfoTable ( mkITbls ) where
#include "HsVersions.h"
import GhcPrelude
import ByteCodeTypes
import GHCi
import GHC.ByteCode.Types
import GHC.Runtime.Interpreter
import DynFlags
import HscTypes
import Name ( Name, getName )
......
......@@ -4,8 +4,8 @@
-- (c) The University of Glasgow 2002-2006
--
-- | ByteCodeInstrs: Bytecode instruction definitions
module ByteCodeInstr (
-- | Bytecode instruction definitions
module GHC.ByteCode.Instr (
BCInstr(..), ProtoBCO(..), bciStackUse,
) where
......@@ -13,7 +13,7 @@ module ByteCodeInstr (
import GhcPrelude
import ByteCodeTypes
import GHC.ByteCode.Types
import GHCi.RemoteTypes
import GHCi.FFI (C_ffi_cif)
import GHC.StgToCmm.Layout ( ArgRep(..) )
......@@ -28,7 +28,7 @@ import Literal
import DataCon
import VarSet
import PrimOp
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import Data.Word
import GHC.Stack.CCS (CostCentre)
......
......@@ -8,8 +8,8 @@
-- (c) The University of Glasgow 2002-2006
--
-- | ByteCodeLink: Bytecode assembler and linker
module ByteCodeLink (
-- | Bytecode assembler and linker
module GHC.ByteCode.Linker (
ClosureEnv, emptyClosureEnv, extendClosureEnv,
linkBCO, lookupStaticPtr,
lookupIE,
......@@ -25,8 +25,8 @@ import GHCi.ResolvedBCO
import GHCi.BreakArray
import SizedSeq
import GHCi
import ByteCodeTypes
import GHC.Runtime.Interpreter
import GHC.ByteCode.Types
import HscTypes
import Name
import NameEnv
......@@ -90,7 +90,7 @@ lookupStaticPtr hsc_env addr_of_label_string = do
m <- lookupSymbol hsc_env addr_of_label_string
case m of
Just ptr -> return ptr
Nothing -> linkFail "ByteCodeLink: can't find label"
Nothing -> linkFail "GHC.ByteCode.Linker: can't find label"
(unpackFS addr_of_label_string)
lookupIE :: HscEnv -> ItblEnv -> Name -> IO (Ptr ())
......@@ -108,7 +108,7 @@ lookupIE hsc_env ie con_nm =
n <- lookupSymbol hsc_env sym_to_find2
case n of
Just addr -> return addr
Nothing -> linkFail "ByteCodeLink.lookupIE"
Nothing -> linkFail "GHC.ByteCode.Linker.lookupIE"
(unpackFS sym_to_find1 ++ " or " ++
unpackFS sym_to_find2)
......@@ -118,7 +118,7 @@ lookupPrimOp hsc_env primop = do
m <- lookupSymbol hsc_env (mkFastString sym_to_find)
case m of
Just p -> return (toRemotePtr p)
Nothing -> linkFail "ByteCodeLink.lookupCE(primop)" sym_to_find
Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" sym_to_find
resolvePtr
:: HscEnv -> ItblEnv -> ClosureEnv -> NameEnv Int -> RemoteRef BreakArray
......@@ -135,7 +135,7 @@ resolvePtr hsc_env _ie ce bco_ix _ (BCOPtrName nm)
m <- lookupSymbol hsc_env sym_to_find
case m of
Just p -> return (ResolvedBCOStaticPtr (toRemotePtr p))
Nothing -> linkFail "ByteCodeLink.lookupCE" (unpackFS sym_to_find)
Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (unpackFS sym_to_find)
resolvePtr hsc_env _ _ _ _ (BCOPtrPrimOp op) =
ResolvedBCOStaticPtr <$> lookupPrimOp hsc_env op
resolvePtr hsc_env ie ce bco_ix breakarray (BCOPtrBCO bco) =
......
......@@ -4,7 +4,7 @@
--
-- | Bytecode assembler types
module ByteCodeTypes
module GHC.ByteCode.Types
( CompiledByteCode(..), seqCompiledByteCode, FFIInfo(..)
, UnlinkedBCO(..), BCOPtr(..), BCONPtr(..)
, ItblEnv, ItblPtr(..)
......@@ -114,7 +114,7 @@ data CgBreakInfo
{ cgb_vars :: [Maybe (Id,Word16)]
, cgb_resty :: Type
}
-- See Note [Syncing breakpoint info] in compiler/main/InteractiveEval.hs
-- See Note [Syncing breakpoint info] in GHC.Runtime.Eval
-- Not a real NFData instance because we can't rnf Id or Type
seqCgBreakInfo :: CgBreakInfo -> ()
......
......@@ -31,7 +31,7 @@ import CostCentre
import GHC.Cmm.CLabel
import GHC.Cmm.BlockId
import GHC.Cmm.Node
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import GHC.Cmm.Expr
import GHC.Cmm.Dataflow.Block
import GHC.Cmm.Dataflow.Collections
......
......@@ -8,7 +8,7 @@ module GHC.Cmm.CallConv (
import GhcPrelude
import GHC.Cmm.Expr
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import GHC.Cmm (Convention(..))
import GHC.Cmm.Ppr () -- For Outputable instances
......
......@@ -35,7 +35,7 @@ import DynFlags
import FastString
import ForeignCall
import OrdList
import GHC.Runtime.Layout (ByteOff)
import GHC.Runtime.Heap.Layout (ByteOff)
import UniqSupply
import Util
import Panic
......
......@@ -38,7 +38,7 @@ import GhcPrelude
import GHC.Cmm
import GHC.Cmm.Utils
import GHC.Cmm.CLabel
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import GHC.Data.Bitmap
import Stream (Stream)
import qualified Stream
......
......@@ -27,11 +27,10 @@ import GHC.Cmm.Utils
import DynFlags
import Maybes
import Outputable
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import UniqSupply
import CostCentre
import GHC.StgToCmm.Heap
import ErrUtils
import Control.Monad
import Data.Map.Strict (Map)
......@@ -802,9 +801,6 @@ doSRTs dflags moduleSRTInfo procs data_ = do
(srt_declss, pairs, funSRTs, has_caf_refs) = unzip4 result
srt_decls = concat srt_declss
unless (null srt_decls) $
dumpIfSet_dyn dflags Opt_D_dump_srts "SRTs" FormatCMM (ppr srt_decls)
-- Next, update the info tables with the SRTs
let
srtFieldMap = mapFromList (concat pairs)
......
......@@ -18,7 +18,7 @@ import GHC.Cmm.Graph
import ForeignCall
import GHC.Cmm.Liveness
import GHC.Cmm.ProcPoint
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import GHC.Cmm.Dataflow.Block
import GHC.Cmm.Dataflow.Collections
import GHC.Cmm.Dataflow
......
......@@ -35,7 +35,7 @@ import DynFlags
import FastString
import ForeignCall
import Outputable
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import CoreSyn (Tickish)
import qualified Unique as U
......
......@@ -231,7 +231,7 @@ import GHC.Cmm.BlockId
import GHC.Cmm.Lexer
import GHC.Cmm.CLabel
import GHC.Cmm.Monad
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import Lexer
import CostCentre
......
......@@ -75,7 +75,7 @@ import GhcPrelude
import TyCon ( PrimRep(..), PrimElemRep(..) )
import GHC.Types.RepType ( UnaryType, SlotTy (..), typePrimRep1 )
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import GHC.Cmm
import GHC.Cmm.BlockId
import GHC.Cmm.CLabel
......
......@@ -55,7 +55,7 @@ import qualified Data.ByteString as BS
import Control.Monad.ST
import Data.Bits
import Data.Char
import Data.List
import Data.List (intersperse)
import Data.Map (Map)
import Data.Word
import System.IO
......
......@@ -7,18 +7,18 @@
-- (c) The University of Glasgow 2002-2006
--
-- | ByteCodeGen: Generate bytecode from Core
module ByteCodeGen ( UnlinkedBCO, byteCodeGen, coreExprToBCOs ) where
-- | GHC.CoreToByteCode: Generate bytecode from Core
module GHC.CoreToByteCode ( UnlinkedBCO, byteCodeGen, coreExprToBCOs ) where
#include "HsVersions.h"
import GhcPrelude
import ByteCodeInstr
import ByteCodeAsm
import ByteCodeTypes
import GHC.ByteCode.Instr
import GHC.ByteCode.Asm
import GHC.ByteCode.Types
import GHCi
import GHC.Runtime.Interpreter
import GHCi.FFI
import GHCi.RemoteTypes
import BasicTypes
......@@ -51,7 +51,7 @@ import FastString
import Panic
import GHC.StgToCmm.Closure ( NonVoid(..), fromNonVoid, nonVoidIds )
import GHC.StgToCmm.Layout
import GHC.Runtime.Layout hiding (WordOff, ByteOff, wordsToBytes)
import GHC.Runtime.Heap.Layout hiding (WordOff, ByteOff, wordsToBytes)
import GHC.Data.Bitmap
import OrdList
import Maybes
......@@ -88,7 +88,7 @@ byteCodeGen :: HscEnv
-> IO CompiledByteCode
byteCodeGen hsc_env this_mod binds tycs mb_modBreaks
= withTiming dflags
(text "ByteCodeGen"<+>brackets (ppr this_mod))
(text "GHC.CoreToByteCode"<+>brackets (ppr this_mod))
(const ()) $ do
-- Split top-level binds into strings and others.
-- See Note [generating code for top-level string literal bindings].
......@@ -105,7 +105,7 @@ byteCodeGen hsc_env this_mod binds tycs mb_modBreaks
mapM schemeTopBind flatBinds
when (notNull ffis)
(panic "ByteCodeGen.byteCodeGen: missing final emitBc?")
(panic "GHC.CoreToByteCode.byteCodeGen: missing final emitBc?")
dumpIfSet_dyn dflags Opt_D_dump_BCOs
"Proto-BCOs" FormatByteCode
......@@ -161,7 +161,7 @@ coreExprToBCOs :: HscEnv
-> IO UnlinkedBCO
coreExprToBCOs hsc_env this_mod expr
= withTiming dflags
(text "ByteCodeGen"<+>brackets (ppr this_mod))
(text "GHC.CoreToByteCode"<+>brackets (ppr this_mod))
(const ()) $ do
-- create a totally bogus name for the top-level BCO; this
-- should be harmless, since it's never used for anything
......@@ -175,7 +175,7 @@ coreExprToBCOs hsc_env this_mod expr
schemeR [] (invented_name, simpleFreeVars expr)
when (notNull mallocd)
(panic "ByteCodeGen.coreExprToBCOs: missing final emitBc?")
(panic "GHC.CoreToByteCode.coreExprToBCOs: missing final emitBc?")
dumpIfSet_dyn dflags Opt_D_dump_BCOs "Proto-BCOs" FormatByteCode
(ppr proto_bco)
......@@ -212,7 +212,7 @@ bytesToWords dflags (ByteOff bytes) =
let (q, r) = bytes `quotRem` (wORD_SIZE dflags)
in if r == 0
then fromIntegral q
else panic $ "ByteCodeGen.bytesToWords: bytes=" ++ show bytes
else panic $ "GHC.CoreToByteCode.bytesToWords: bytes=" ++ show bytes
wordSize :: DynFlags -> ByteOff
wordSize dflags = ByteOff (wORD_SIZE dflags)
......@@ -674,7 +674,7 @@ schemeE d s p (AnnCase scrut bndr _ alts)
= doCase d s p scrut bndr alts Nothing{-not an unboxed tuple-}
schemeE _ _ _ expr
= pprPanic "ByteCodeGen.schemeE: unhandled case"
= pprPanic "GHC.CoreToByteCode.schemeE: unhandled case"
(pprCoreExpr (deAnnotate' expr))
-- Is this Id a not-necessarily-lifted join point?
......@@ -965,7 +965,7 @@ findPushSeq (D: rest)
findPushSeq (L: rest)
= (PUSH_APPLY_L, 1, rest)
findPushSeq _
= panic "ByteCodeGen.findPushSeq"
= panic "GHC.CoreToByteCode.findPushSeq"
-- -----------------------------------------------------------------------------
-- Case expressions
......@@ -1222,7 +1222,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) fn args_r_to_l
!d_after_args = d0 + wordsToBytes dflags a_reps_sizeW
a_reps_pushed_RAW
| null a_reps_pushed_r_to_l || not (isVoidRep (head a_reps_pushed_r_to_l))
= panic "ByteCodeGen.generateCCall: missing or invalid World token?"
= panic "GHC.CoreToByteCode.generateCCall: missing or invalid World token?"
| otherwise
= reverse (tail a_reps_pushed_r_to_l)
......@@ -1294,7 +1294,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) fn args_r_to_l
a_reps -- | trace (showSDoc (ppr a_reps_pushed_RAW)) False = error "???"
| is_static = a_reps_pushed_RAW
| otherwise = if null a_reps_pushed_RAW
then panic "ByteCodeGen.generateCCall: dyn with no args"
then panic "GHC.CoreToByteCode.generateCCall: dyn with no args"
else tail a_reps_pushed_RAW
-- push the Addr#
......@@ -1324,7 +1324,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) fn args_r_to_l
conv = case cconv of
CCallConv -> FFICCall
StdCallConv -> FFIStdCall
_ -> panic "ByteCodeGen: unexpected calling convention"
_ -> panic "GHC.CoreToByteCode: unexpected calling convention"
-- the only difference in libffi mode is that we prepare a cif
-- describing the call type by calling libffi, and we attach the
......@@ -1620,7 +1620,7 @@ pushAtom _ _ (AnnLit lit) = do
LitNumNatural -> panic "pushAtom: LitNatural"
pushAtom _ _ expr
= pprPanic "ByteCodeGen.pushAtom"
= pprPanic "GHC.CoreToByteCode.pushAtom"
(pprCoreExpr (deAnnotate' expr))
......@@ -2007,7 +2007,7 @@ getLabelsBc n
getCCArray :: BcM (Array BreakIndex (RemotePtr CostCentre))
getCCArray = BcM $ \st ->
let breaks = expectJust "ByteCodeGen.getCCArray" $ modBreaks st in
let breaks = expectJust "GHC.CoreToByteCode.getCCArray" $ modBreaks st in
return (st, modBreaks_ccs breaks)
......
......@@ -71,6 +71,7 @@ import VarSet
import TyCoRep
import TyCoTidy ( tidyCo )
import Demand ( isTopSig )
import Cpr ( topCprSig )
import Data.Maybe ( catMaybes )
......@@ -442,7 +443,7 @@ toIfaceIdDetails other = pprTrace "toIfaceIdDetails" (ppr other)
toIfaceIdInfo :: IdInfo -> IfaceIdInfo
toIfaceIdInfo id_info
= case catMaybes [arity_hsinfo, caf_hsinfo, strict_hsinfo,
= case catMaybes [arity_hsinfo, caf_hsinfo, strict_hsinfo, cpr_hsinfo,
inline_hsinfo, unfold_hsinfo, levity_hsinfo] of
[] -> NoInfo
infos -> HasInfo infos
......@@ -466,6 +467,10 @@ toIfaceIdInfo id_info
strict_hsinfo | not (isTopSig sig_info) = Just (HsStrictness sig_info)
| otherwise = Nothing
------------ CPR --------------
cpr_info = cprInfo id_info
cpr_hsinfo | cpr_info /= topCprSig = Just (HsCpr cpr_info)
| otherwise = Nothing
------------ Unfolding --------------
unfold_hsinfo = toIfUnfolding loop_breaker (unfoldingInfo id_info)
loop_breaker = isStrongLoopBreaker (occInfo id_info)
......
......@@ -946,7 +946,7 @@ pragma. It is levity-polymorphic.
-> (# State# RealWorld, o #)
It needs no special treatment in GHC except this special inlining here
in CorePrep (and in ByteCodeGen).
in CorePrep (and in GHC.CoreToByteCode).
-- ---------------------------------------------------------------------------
-- CpeArg: produces a result satisfying CpeArg
......
......@@ -17,7 +17,7 @@ module GHC.Data.Bitmap (
import GhcPrelude
import GHC.Runtime.Layout
import GHC.Runtime.Heap.Layout
import DynFlags
import Util
......
......@@ -12,8 +12,8 @@ therefore, is almost nothing but re-exporting.
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types]
-- in module GHC.Hs.PlaceHolder
{-# LANGUAGE UndecidableInstances #-} -- Wrinkle in Note [Trees That Grow]
-- in module GHC.Hs.Extension
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-} -- For deriving instance Data
......@@ -28,7 +28,6 @@ module GHC.Hs (
module GHC.Hs.Types,
module GHC.Hs.Utils,
module GHC.Hs.Doc,
module GHC.Hs.PlaceHolder,
module GHC.Hs.Extension,
Fixity,
......@@ -43,7 +42,6 @@ import GHC.Hs.Binds
import GHC.Hs.Expr
import GHC.Hs.ImpExp
import GHC.Hs.Lit
import GHC.Hs.PlaceHolder
import GHC.Hs.Extension
import GHC.Hs.Pat
import GHC.Hs.Types
......
......@@ -12,11 +12,13 @@ Datatype for: @BindGroup@, @Bind@, @Sig@, @Bind@.
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types]
-- in module GHC.Hs.PlaceHolder
{-# LANGUAGE UndecidableInstances #-} -- Wrinkle in Note [Trees That Grow]
-- in module GHC.Hs.Extension
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
module GHC.Hs.Binds where
......@@ -219,29 +221,29 @@ data HsBindLR idL idR
-- For details on above see note [Api annotations] in ApiAnnotation
FunBind {
fun_ext :: XFunBind idL idR, -- ^ After the renamer, this contains
-- the locally-bound
-- free variables of this defn.
-- See Note [Bind free vars]
fun_ext :: XFunBind idL idR,
-- ^ After the renamer (but before the type-checker), this contains the
-- locally-bound free variables of this defn. See Note [Bind free vars]
--
-- After the type-checker, this contains a coercion from the type of
-- the MatchGroup to the type of the Id. Example:
--
-- @
-- f :: Int -> forall a. a -> a
-- f x y = y
-- @
--
-- Then the MatchGroup will have type (Int -> a' -> a')
-- (with a free type variable a'). The coercion will take
-- a CoreExpr of this type and convert it to a CoreExpr of
-- type Int -> forall a'. a' -> a'
-- Notice that the coercion captures the free a'.
fun_id :: Located (IdP idL), -- Note [fun_id in Match] in GHC.Hs.Expr
fun_matches :: MatchGroup idR (LHsExpr idR), -- ^ The payload
fun_co_fn :: HsWrapper, -- ^ Coercion from the type of the MatchGroup to the type of
-- the Id. Example:
--
-- @
-- f :: Int -> forall a. a -> a
-- f x y = y
-- @
--
-- Then the MatchGroup will have type (Int -> a' -> a')
-- (with a free type variable a'). The coercion will take
-- a CoreExpr of this type and convert it to a CoreExpr of
-- type Int -> forall a'. a' -> a'
-- Notice that the coercion captures the free a'.
fun_tick :: [Tickish Id] -- ^ Ticks to put on the rhs, if any
}
......@@ -320,8 +322,8 @@ data NPatBindTc = NPatBindTc {
} deriving Data
type instance XFunBind (GhcPass pL) GhcPs = NoExtField
type instance XFunBind (GhcPass pL) GhcRn = NameSet -- Free variables
type instance XFunBind (GhcPass pL) GhcTc = NameSet -- Free variables
type instance XFunBind (GhcPass pL) GhcRn = NameSet -- Free variables
type instance XFunBind (GhcPass pL) GhcTc = HsWrapper -- See comments on FunBind.fun_ext
type instance XPatBind GhcPs (GhcPass pR) = NoExtField
type instance XPatBind GhcRn (GhcPass pR) = NameSet -- Free variables
......@@ -572,7 +574,7 @@ let-binding. When abs_sig = True
and hence the abs_binds is non-recursive
(it binds the mono_id but refers to the poly_id
These properties are exploited in DsBinds.dsAbsBinds to
These properties are exploited in GHC.HsToCore.Binds.dsAbsBinds to
generate code without a let-binding.
Note [ABExport wrapper]
......@@ -682,19 +684,6 @@ pprDeclList ds = pprDeeperList vcat ds
emptyLocalBinds :: HsLocalBindsLR (GhcPass a) (GhcPass b)