Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghc/ghc
  • bgamari/ghc
  • syd/ghc
  • ggreif/ghc
  • watashi/ghc
  • RolandSenn/ghc
  • mpickering/ghc
  • DavidEichmann/ghc
  • carter/ghc
  • harpocrates/ghc
  • ethercrow/ghc
  • mijicd/ghc
  • adamse/ghc
  • alexbiehl/ghc
  • gridaphobe/ghc
  • trofi/ghc
  • supersven/ghc
  • ppk/ghc
  • ulysses4ever/ghc
  • AndreasK/ghc
  • ghuntley/ghc
  • shayne-fletcher-da/ghc
  • fgaz/ghc
  • yav/ghc
  • osa1/ghc
  • mbbx6spp/ghc
  • JulianLeviston/ghc
  • reactormonk/ghc
  • rae/ghc
  • takenobu-hs/ghc
  • michalt/ghc
  • andrewthad/ghc
  • hsyl20/ghc
  • scottgw/ghc
  • sjakobi/ghc
  • angerman/ghc
  • RyanGlScott/ghc
  • hvr/ghc
  • howtonotwin/ghc
  • chessai/ghc
  • m-renaud/ghc
  • brprice/ghc
  • stevehartdata/ghc
  • sighingnow/ghc
  • kgardas/ghc
  • ckoparkar/ghc
  • alp/ghc
  • smaeul/ghc
  • kakkun61/ghc
  • sykloid/ghc
  • newhoggy/ghc
  • toonn/ghc
  • nineonine/ghc
  • Phyx/ghc
  • ezyang/ghc
  • tweag/ghc
  • langston/ghc
  • ndmitchell/ghc
  • rockbmb/ghc
  • artempyanykh/ghc
  • mniip/ghc
  • mynguyenbmc/ghc
  • alexfmpe/ghc
  • crockeea/ghc
  • nh2/ghc
  • vaibhavsagar/ghc
  • phadej/ghc
  • Haskell-mouse/ghc
  • lolotp/ghc
  • spacekitteh/ghc
  • michaelpj/ghc
  • mgsloan/ghc
  • HPCohen/ghc
  • tmobile/ghc
  • radrow/ghc
  • simonmar/ghc
  • _deepfire/ghc
  • Ericson2314/ghc
  • leitao/ghc
  • fumieval/ghc
  • trac-isovector/ghc
  • cblp/ghc
  • xich/ghc
  • ciil/ghc
  • erthalion/ghc
  • xldenis/ghc
  • autotaker/ghc
  • haskell-wasm/ghc
  • kcsongor/ghc
  • agander/ghc
  • Baranowski/ghc
  • trac-dredozubov/ghc
  • 23Skidoo/ghc
  • iustin/ghc
  • ningning/ghc
  • josefs/ghc
  • kabuhr/ghc
  • gallais/ghc
  • dten/ghc
  • expipiplus1/ghc
  • Pluralia/ghc
  • rohanjr/ghc
  • intricate/ghc
  • kirelagin/ghc
  • Javran/ghc
  • DanielG/ghc
  • trac-mizunashi_mana/ghc
  • pparkkin/ghc
  • bollu/ghc
  • ntc2/ghc
  • jaspervdj/ghc
  • JoshMeredith/ghc
  • wz1000/ghc
  • zkourouma/ghc
  • code5hot/ghc
  • jdprice/ghc
  • tdammers/ghc
  • J-mie6/ghc
  • trac-lantti/ghc
  • ch1bo/ghc
  • cgohla/ghc
  • lucamolteni/ghc
  • acairncross/ghc
  • amerocu/ghc
  • chreekat/ghc
  • txsmith/ghc
  • trupill/ghc
  • typetetris/ghc
  • sergv/ghc
  • fryguybob/ghc
  • erikd/ghc
  • trac-roland/ghc
  • setupminimal/ghc
  • Friede80/ghc
  • SkyWriter/ghc
  • xplorld/ghc
  • abrar/ghc
  • obsidiansystems/ghc
  • Icelandjack/ghc
  • adinapoli/ghc
  • trac-matthewbauer/ghc
  • heatsink/ghc
  • dwijnand/ghc
  • Cmdv/ghc
  • alinab/ghc
  • pepeiborra/ghc
  • fommil/ghc
  • luochen1990/ghc
  • rlupton20/ghc
  • applePrincess/ghc
  • lehins/ghc
  • ronmrdechai/ghc
  • leeadam/ghc
  • harendra/ghc
  • mightymosquito1991/ghc
  • trac-gershomb/ghc
  • lucajulian/ghc
  • Rizary/ghc
  • VictorCMiraldo/ghc
  • jamesbrock/ghc
  • andrewdmeier/ghc
  • luke/ghc
  • pranaysashank/ghc
  • cocreature/ghc
  • hithroc/ghc
  • obreitwi/ghc
  • slrtbtfs/ghc
  • kaol/ghc
  • yairchu/ghc
  • Mathemagician98/ghc
  • trac-taylorfausak/ghc
  • leungbk/ghc
  • MichaWiedenmann/ghc
  • chris-martin/ghc
  • TDecki/ghc
  • adithyaov/ghc
  • trac-gelisam/ghc
  • Lysxia/ghc
  • complyue/ghc
  • bwignall/ghc
  • sternmull/ghc
  • sonika/ghc
  • leif/ghc
  • broadwaylamb/ghc
  • myszon/ghc
  • danbroooks/ghc
  • Mechachleopteryx/ghc
  • zardyh/ghc
  • trac-vdukhovni/ghc
  • OmarKhaledAbdo/ghc
  • arrowd/ghc
  • Bodigrim/ghc
  • matheus23/ghc
  • cardenaso11/ghc
  • trac-Athas/ghc
  • mb720/ghc
  • DylanZA/ghc
  • liff/ghc
  • typedrat/ghc
  • trac-claude/ghc
  • jbm/ghc
  • Gertjan423/ghc
  • PHO/ghc
  • JKTKops/ghc
  • kockahonza/ghc
  • msakai/ghc
  • Sir4ur0n/ghc
  • barambani/ghc
  • vishnu.c/ghc
  • dcoutts/ghc
  • trac-runeks/ghc
  • trac-MaxGabriel/ghc
  • lexi.lambda/ghc
  • strake/ghc
  • spavikevik/ghc
  • JakobBruenker/ghc
  • rmanne/ghc
  • gdziadkiewicz/ghc
  • ani/ghc
  • iliastsi/ghc
  • smunix/ghc
  • judah/ghc
  • blackgnezdo/ghc
  • emilypi/ghc
  • trac-bpfoley/ghc
  • muesli4/ghc
  • trac-gkaracha/ghc
  • Kleidukos/ghc
  • nek0/ghc
  • TristanCacqueray/ghc
  • dwulive/ghc
  • mbakke/ghc
  • arybczak/ghc
  • Yang123321/ghc
  • maksbotan/ghc
  • QuietMisdreavus/ghc
  • trac-olshanskydr/ghc
  • emekoi/ghc
  • samuela/ghc
  • josephcsible/ghc
  • dramforever/ghc
  • lpsmith/ghc
  • DenisFrezzato/ghc
  • michivi/ghc
  • jneira/ghc
  • jeffhappily/ghc
  • Ivan-Yudin/ghc
  • nakaji-dayo/ghc
  • gdevanla/ghc
  • galen/ghc
  • fendor/ghc
  • yaitskov/ghc
  • rcythr/ghc
  • awpr/ghc
  • jeremyschlatter/ghc
  • Aver1y/ghc
  • mitchellvitez/ghc
  • merijn/ghc
  • tomjaguarpaw1/ghc
  • trac-NoidedSuper/ghc
  • erewok/ghc
  • trac-junji.hashimoto/ghc
  • adamwespiser/ghc
  • bjaress/ghc
  • jhrcek/ghc
  • leonschoorl/ghc
  • lukasz-golebiewski/ghc
  • sheaf/ghc
  • last-g/ghc
  • carassius1014/ghc
  • eschwartz/ghc
  • dwincort/ghc
  • felixwiemuth/ghc
  • TimWSpence/ghc
  • marcusmonteirodesouza/ghc
  • WJWH/ghc
  • vtols/ghc
  • theobat/ghc
  • BinderDavid/ghc
  • ckoparkar0/ghc
  • alexander-kjeldaas/ghc
  • dme2/ghc
  • philderbeast/ghc
  • aaronallen8455/ghc
  • rayshih/ghc
  • benkard/ghc
  • mpardalos/ghc
  • saidelman/ghc
  • leiftw/ghc
  • ca333/ghc
  • bwroga/ghc
  • nmichael44/ghc
  • trac-crobbins/ghc
  • felixonmars/ghc
  • adityagupta1089/ghc
  • hgsipiere/ghc
  • treeowl/ghc
  • alexpeits/ghc
  • CraigFe/ghc
  • dnlkrgr/ghc
  • kerckhove_ts/ghc
  • cptwunderlich/ghc
  • eiais/ghc
  • hahohihu/ghc
  • sanchayan/ghc
  • lemmih/ghc
  • sehqlr/ghc
  • trac-dbeacham/ghc
  • luite/ghc
  • trac-f-a/ghc
  • vados/ghc
  • luntain/ghc
  • fatho/ghc
  • alexbiehl-gc/ghc
  • dcbdan/ghc
  • tvh/ghc
  • liam-ly/ghc
  • timbobbarnes/ghc
  • GovanifY/ghc
  • shanth2600/ghc
  • gliboc/ghc
  • duog/ghc
  • moxonsghost/ghc
  • zander/ghc
  • masaeedu/ghc
  • georgefst/ghc
  • guibou/ghc
  • nicuveo/ghc
  • mdebruijne/ghc
  • stjordanis/ghc
  • emiflake/ghc
  • wygulmage/ghc
  • frasertweedale/ghc
  • coot/ghc
  • aratamizuki/ghc
  • tsandstr/ghc
  • mrBliss/ghc
  • Anton-Latukha/ghc
  • tadfisher/ghc
  • vapourismo/ghc
  • Sorokin-Anton/ghc
  • basile-henry/ghc
  • trac-mightybyte/ghc
  • AbsoluteNikola/ghc
  • cobrien99/ghc
  • songzh/ghc
  • blamario/ghc
  • aj4ayushjain/ghc
  • trac-utdemir/ghc
  • tangcl/ghc
  • hdgarrood/ghc
  • maerwald/ghc
  • arjun/ghc
  • ratherforky/ghc
  • haskieLambda/ghc
  • EmilGedda/ghc
  • Bogicevic/ghc
  • eddiejessup/ghc
  • kozross/ghc
  • AlistairB/ghc
  • 3Rafal/ghc
  • christiaanb/ghc
  • trac-bit/ghc
  • matsumonkie/ghc
  • trac-parsonsmatt/ghc
  • chisui/ghc
  • jaro/ghc
  • trac-kmiyazato/ghc
  • davidsd/ghc
  • Tritlo/ghc
  • I-B-3/ghc
  • lykahb/ghc
  • AriFordsham/ghc
  • turion1/ghc
  • berberman/ghc
  • christiantakle/ghc
  • zyklotomic/ghc
  • trac-ocramz/ghc
  • CSEdd/ghc
  • doyougnu/ghc
  • mmhat/ghc
  • why-not-try-calmer/ghc
  • plutotulp/ghc
  • kjekac/ghc
  • Manvi07/ghc
  • teo/ghc
  • cactus/ghc
  • CarrieMY/ghc
  • abel/ghc
  • yihming/ghc
  • tsakki/ghc
  • jessicah/ghc
  • oliverbunting/ghc
  • meld/ghc
  • friedbrice/ghc
  • Joald/ghc
  • abarbu/ghc
  • DigitalBrains1/ghc
  • sterni/ghc
  • alexDarcy/ghc
  • hexchain/ghc
  • minimario/ghc
  • zliu41/ghc
  • tommd/ghc
  • jazcarate/ghc
  • peterbecich/ghc
  • alirezaghey/ghc
  • solomon/ghc
  • mikael.urankar/ghc
  • davjam/ghc
  • int-index/ghc
  • MorrowM/ghc
  • nrnrnr/ghc
  • Sonfamm/ghc-test-only
  • afzt1/ghc
  • nguyenhaibinh-tpc/ghc
  • trac-lierdakil/ghc
  • MichaWiedenmann1/ghc
  • jmorag/ghc
  • Ziharrk/ghc
  • trac-MitchellSalad/ghc
  • juampe/ghc
  • jwaldmann/ghc
  • snowleopard/ghc
  • juhp/ghc
  • normalcoder/ghc
  • ksqsf/ghc
  • trac-jberryman/ghc
  • roberth/ghc
  • 1ntEgr8/ghc
  • epworth/ghc
  • MrAdityaAlok/ghc
  • JunmingZhao42/ghc
  • jappeace/ghc
  • trac-Gabriel439/ghc
  • alt-romes/ghc
  • HugoPeters1024/ghc
  • 10ne1/ghc-fork
  • agentultra/ghc
  • Garfield1002/ghc
  • ChickenProp/ghc
  • clyring/ghc
  • MaxHearnden/ghc
  • jumper149/ghc
  • vem/ghc
  • ketzacoatl/ghc
  • Rosuavio/ghc
  • jackohughes/ghc
  • p4l1ly/ghc
  • konsumlamm/ghc
  • shlevy/ghc
  • torsten.schmits/ghc
  • andremarianiello/ghc
  • amesgen/ghc
  • googleson78/ghc
  • InfiniteVerma/ghc
  • uhbif19/ghc
  • yiyunliu/ghc
  • raehik/ghc
  • mrkun/ghc
  • telser/ghc
  • 1Jajen1/ghc
  • slotThe/ghc
  • WinstonHartnett/ghc
  • mpilgrem/ghc
  • dreamsmasher/ghc
  • schuelermine/ghc
  • trac-Viwor/ghc
  • undergroundquizscene/ghc
  • evertedsphere/ghc
  • coltenwebb/ghc
  • oberblastmeister/ghc
  • agrue/ghc
  • lf-/ghc
  • zacwood9/ghc
  • steshaw/ghc
  • high-cloud/ghc
  • SkamDart/ghc
  • PiDelport/ghc
  • maoif/ghc
  • RossPaterson/ghc
  • CharlesTaylor7/ghc
  • ribosomerocker/ghc
  • trac-ramirez7/ghc
  • daig/ghc
  • NicolasT/ghc
  • FinleyMcIlwaine/ghc
  • lawtonnichols/ghc
  • jmtd/ghc
  • ozkutuk/ghc
  • wildsebastian/ghc
  • lrzlin/ghc
  • tobias/ghc
  • fw/ghc
  • hawkinsw/ghc
  • type-dance/ghc
  • rui314/ghc
  • ocharles/ghc
  • wavewave/ghc
  • TheKK/ghc
  • nomeata/ghc
  • trac-csabahruska/ghc
  • jonathanjameswatson/ghc
  • L-as/ghc
  • Axman6/ghc
  • barracuda156/ghc
  • trac-jship/ghc
  • jake-87/ghc
  • meooow/ghc
  • rebeccat/ghc
  • hamana55/ghc
  • Enigmage/ghc
  • kokobd/ghc
  • agevelt/ghc
  • gshen42/ghc
  • chrismwendt/ghc
  • MangoIV/ghc
  • teto/ghc
  • Sookr1/ghc
  • trac-thomasjm/ghc
  • barci2/ghc-dev
  • trac-m4dc4p/ghc
  • dixonary/ghc
  • breakerzirconia/ghc
  • alexsio27444/ghc
  • glocq/ghc
  • sourabhxyz/ghc
  • ryantrinkle/ghc
  • Jade/ghc
  • scedfaliako/ghc
  • martijnbastiaan/ghc
  • trac-george.colpitts/ghc
  • ammarbinfaisal/ghc
  • mimi.vx/ghc
  • lortabac/ghc
  • trac-zyla/ghc
  • benbellick/ghc
  • aadaa-fgtaa/ghc
  • jvanbruegge/ghc
  • archbung/ghc
  • gilmi/ghc
  • mfonism/ghc
  • alex-mckenna/ghc
  • Ei30metry/ghc
  • DiegoDiverio/ghc
  • jorgecunhamendes/ghc
  • liesnikov/ghc
  • akrmn/ghc
  • trac-simplifierticks/ghc
  • jacco/ghc
  • rhendric/ghc
  • damhiya/ghc
  • ryndubei/ghc
  • DaveBarton/ghc
  • trac-Profpatsch/ghc
  • GZGavinZhao/ghc
  • ncfavier/ghc
  • jameshaydon/ghc
  • ajccosta/ghc
  • dschrempf/ghc
  • cydparser/ghc
  • LinuxUserGD/ghc
  • elodielander/ghc
  • facundominguez/ghc
  • psilospore/ghc
  • lachrimae/ghc
  • dylan-thinnes/ghc-type-errors-plugin
  • hamishmack/ghc
  • Leary/ghc
  • lzszt/ghc
  • lyokha/ghc
  • trac-glaubitz/ghc
  • Rewbert/ghc
  • andreabedini/ghc
  • Jasagredo/ghc
  • sol/ghc
  • OlegAlexander/ghc
  • trac-sthibaul/ghc
  • avdv/ghc
  • Wendaolee/ghc
  • ur4t/ghc
  • daylily/ghc
  • boltzmannrain/ghc
  • mmzk1526/ghc
  • trac-fizzixnerd/ghc
  • soulomoon/ghc
  • rwmjones/ghc
  • j14i/ghc
  • tracsis/ghc
  • gesh/ghc
  • flip101/ghc
  • eldritch-cookie/ghc
  • LemonjamesD/ghc
  • pgujjula/ghc
  • skeuchel/ghc
  • noteed/ghc
  • Torrekie/ghc
  • jlwoodwa/ghc
  • ayanamists/ghc
  • husong998/ghc
  • trac-edmundnoble/ghc
  • josephf/ghc
  • contrun/ghc
  • baulig/ghc
  • edsko/ghc
  • mzschr/ghc-issue-24732
  • ulidtko/ghc
  • Arsen/ghc
  • trac-sjoerd_visscher/ghc
  • crumbtoo/ghc
  • L0neGamer/ghc
  • DrewFenwick/ghc
  • benz0li/ghc
  • MaciejWas/ghc
  • jordanrule/ghc
  • trac-qqwy/ghc
  • LiamGoodacre/ghc
  • isomorpheme/ghc
  • trac-danidiaz/ghc
  • Kariim/ghc
  • MTaimoorZaeem/ghc
  • hololeap/ghc
  • ticat-fp/ghc
  • meritamen/ghc
  • criskell/ghc
  • trac-kraai/ghc
  • aergus/ghc
  • jdral/ghc
  • SamB/ghc
  • Tristian/ghc
  • ywgrit/ghc
  • KatsuPatrick/ghc
  • OsePedro/ghc
  • mpscholten/ghc
  • zaquest/ghc
  • fangyi-zhou/ghc
  • augyg/ghc
  • rkirkman/ghc
  • gulin.serge/ghc-windows-aarch64-bootstrap
  • iris/ghc
  • kwxm/ghc
  • maralorn/ghc
  • rafl/ghc
  • nikshalark/ghc
  • mrcjkb/ghc
  • blackheaven/ghc
  • laurenyim/ghc
  • bolt12/ghc
  • Xitian9/ghc
  • wenkokke/ghc
  • kephas/ghc
651 results
Show changes
Commits on Source (138)
Showing
with 273 additions and 194 deletions
[submodule "libraries/binary"] [submodule "libraries/binary"]
path = libraries/binary path = libraries/binary
url = http://git.haskell.org/packages/binary.git url = ../packages/binary.git
ignore = untracked ignore = untracked
[submodule "libraries/bytestring"] [submodule "libraries/bytestring"]
path = libraries/bytestring path = libraries/bytestring
url = http://git.haskell.org/packages/bytestring.git url = ../packages/bytestring.git
ignore = untracked ignore = untracked
[submodule "libraries/Cabal"] [submodule "libraries/Cabal"]
path = libraries/Cabal path = libraries/Cabal
url = http://git.haskell.org/packages/Cabal.git url = ../packages/Cabal.git
ignore = untracked ignore = untracked
[submodule "libraries/containers"] [submodule "libraries/containers"]
path = libraries/containers path = libraries/containers
url = http://git.haskell.org/packages/containers.git url = ../packages/containers.git
ignore = untracked ignore = untracked
[submodule "libraries/haskeline"] [submodule "libraries/haskeline"]
path = libraries/haskeline path = libraries/haskeline
url = http://git.haskell.org/packages/haskeline.git url = ../packages/haskeline.git
ignore = untracked ignore = untracked
[submodule "libraries/pretty"] [submodule "libraries/pretty"]
path = libraries/pretty path = libraries/pretty
url = http://git.haskell.org/packages/pretty.git url = ../packages/pretty.git
ignore = untracked ignore = untracked
[submodule "libraries/terminfo"] [submodule "libraries/terminfo"]
path = libraries/terminfo path = libraries/terminfo
url = http://git.haskell.org/packages/terminfo.git url = ../packages/terminfo.git
ignore = untracked ignore = untracked
[submodule "libraries/transformers"] [submodule "libraries/transformers"]
path = libraries/transformers path = libraries/transformers
url = http://git.haskell.org/packages/transformers.git url = ../packages/transformers.git
ignore = untracked ignore = untracked
[submodule "libraries/xhtml"] [submodule "libraries/xhtml"]
path = libraries/xhtml path = libraries/xhtml
url = http://git.haskell.org/packages/xhtml.git url = ../packages/xhtml.git
ignore = untracked ignore = untracked
[submodule "libraries/Win32"] [submodule "libraries/Win32"]
path = libraries/Win32 path = libraries/Win32
url = http://git.haskell.org/packages/Win32.git url = ../packages/Win32.git
ignore = untracked ignore = untracked
[submodule "libraries/primitive"] [submodule "libraries/primitive"]
path = libraries/primitive path = libraries/primitive
url = http://git.haskell.org/packages/primitive.git url = ../packages/primitive.git
ignore = untracked ignore = untracked
[submodule "libraries/vector"] [submodule "libraries/vector"]
path = libraries/vector path = libraries/vector
url = http://git.haskell.org/packages/vector.git url = ../packages/vector.git
ignore = untracked ignore = untracked
[submodule "libraries/time"] [submodule "libraries/time"]
path = libraries/time path = libraries/time
url = http://git.haskell.org/packages/time.git url = ../packages/time.git
ignore = untracked ignore = untracked
[submodule "libraries/random"] [submodule "libraries/random"]
path = libraries/random path = libraries/random
url = http://git.haskell.org/packages/random.git url = ../packages/random.git
ignore = untracked ignore = untracked
...@@ -72,7 +72,7 @@ endif ...@@ -72,7 +72,7 @@ endif
$(MAKE) -r --no-print-directory -f ghc.mk phase=final $@ $(MAKE) -r --no-print-directory -f ghc.mk phase=final $@
binary-dist: binary-dist-prep binary-dist: binary-dist-prep
mv bindistprep/*.tar.bz2 . mv bindistprep/*.tar.$(TAR_COMP_EXT) .
binary-dist-prep: binary-dist-prep:
ifeq "$(mingw32_TARGET_OS)" "1" ifeq "$(mingw32_TARGET_OS)" "1"
......
...@@ -1137,6 +1137,16 @@ AC_DEFUN([FP_PROG_AR_NEEDS_RANLIB],[ ...@@ -1137,6 +1137,16 @@ AC_DEFUN([FP_PROG_AR_NEEDS_RANLIB],[
esac esac
fi fi
# workaround for AC_PROG_RANLIB which sets RANLIB to `:' when
# ranlib is missing on the target OS. The problem is that
# ghc-cabal cannot execute `:' which is a shell built-in but can
# execute `true' which is usually simple program supported by the
# OS.
# Fixes #8795
if test "$RANLIB" = ":"
then
RANLIB="true"
fi
REAL_RANLIB_CMD="$RANLIB" REAL_RANLIB_CMD="$RANLIB"
if test $fp_cv_prog_ar_needs_ranlib = yes if test $fp_cv_prog_ar_needs_ranlib = yes
then then
......
...@@ -21,9 +21,9 @@ include $(TOP)/mk/tree.mk ...@@ -21,9 +21,9 @@ include $(TOP)/mk/tree.mk
include $(TOP)/mk/config.mk include $(TOP)/mk/config.mk
ifeq "$(TEST_PREP)" "YES" ifeq "$(TEST_PREP)" "YES"
BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_PREP_TAR_BZ2) BIN_DIST_TEST_TAR_COMP = ../$(BIN_DIST_PREP_TAR_COMP)
else else
BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_TAR_BZ2) BIN_DIST_TEST_TAR_COMP = ../$(BIN_DIST_TAR_COMP)
endif endif
all: all:
...@@ -36,7 +36,7 @@ all: ...@@ -36,7 +36,7 @@ all:
# NB. tar has funny interpretation of filenames sometimes (thinking # NB. tar has funny interpretation of filenames sometimes (thinking
# c:/foo is a remote file), so it's safer to bzip and then pipe into # c:/foo is a remote file), so it's safer to bzip and then pipe into
# tar rather than using tar -xjf: # tar rather than using tar -xjf:
cd a/b/c/ && $(BZIP2_CMD) -cd ../../../$(BIN_DIST_TEST_TAR_BZ2) | $(TAR_CMD) -xf - cd a/b/c/ && $(TAR_COMP_CMD) -cd ../../../$(BIN_DIST_TEST_TAR_COMP) | $(TAR_CMD) -xf -
ifeq "$(Windows)" "YES" ifeq "$(Windows)" "YES"
mv a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR) mv a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
else else
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
ifeq "$(TEST_PREP)" "YES" ifeq "$(TEST_PREP)" "YES"
BIN_DIST_TEST_TAR_BZ2 = $(BIN_DIST_PREP_TAR_BZ2) BIN_DIST_TEST_TAR_COMP = $(BIN_DIST_PREP_TAR_COMP)
else else
BIN_DIST_TEST_TAR_BZ2 = $(BIN_DIST_TAR_BZ2) BIN_DIST_TEST_TAR_COMP = $(BIN_DIST_TAR_COMP)
endif endif
.PHONY: test_bindist .PHONY: test_bindist
...@@ -33,7 +33,7 @@ test_bindist: ...@@ -33,7 +33,7 @@ test_bindist:
mkdir bindisttest/a mkdir bindisttest/a
mkdir bindisttest/a/b mkdir bindisttest/a/b
mkdir bindisttest/a/b/c mkdir bindisttest/a/b/c
cd bindisttest/a/b/c/ && $(BZIP2_CMD) -cd ../../../../$(BIN_DIST_TEST_TAR_BZ2) | $(TAR_CMD) -xf - cd bindisttest/a/b/c/ && $(TAR_COMP_CMD) -cd ../../../../$(BIN_DIST_TEST_TAR_COMP) | $(TAR_CMD) -xf -
$(SHELL) bindisttest/checkBinaries.sh $(ProjectVersion) $(SHELL) bindisttest/checkBinaries.sh $(ProjectVersion)
ifeq "$(Windows_Host)" "YES" ifeq "$(Windows_Host)" "YES"
mv bindisttest/a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR) mv bindisttest/a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
......
...@@ -125,7 +125,7 @@ is right here. ...@@ -125,7 +125,7 @@ is right here.
\begin{code} \begin{code}
wiredInIds :: [Id] wiredInIds :: [Id]
wiredInIds wiredInIds
= [lazyId] = [lazyId, dollarId]
++ errorIds -- Defined in MkCore ++ errorIds -- Defined in MkCore
++ ghcPrimIds ++ ghcPrimIds
...@@ -1040,20 +1040,32 @@ another gun with which to shoot yourself in the foot. ...@@ -1040,20 +1040,32 @@ another gun with which to shoot yourself in the foot.
\begin{code} \begin{code}
lazyIdName, unsafeCoerceName, nullAddrName, seqName, lazyIdName, unsafeCoerceName, nullAddrName, seqName,
realWorldName, voidPrimIdName, coercionTokenName, realWorldName, voidPrimIdName, coercionTokenName,
magicDictName, coerceName, proxyName :: Name magicDictName, coerceName, proxyName, dollarName :: Name
unsafeCoerceName = mkWiredInIdName gHC_PRIM (fsLit "unsafeCoerce#") unsafeCoerceIdKey unsafeCoerceId unsafeCoerceName = mkWiredInIdName gHC_PRIM (fsLit "unsafeCoerce#") unsafeCoerceIdKey unsafeCoerceId
nullAddrName = mkWiredInIdName gHC_PRIM (fsLit "nullAddr#") nullAddrIdKey nullAddrId nullAddrName = mkWiredInIdName gHC_PRIM (fsLit "nullAddr#") nullAddrIdKey nullAddrId
seqName = mkWiredInIdName gHC_PRIM (fsLit "seq") seqIdKey seqId seqName = mkWiredInIdName gHC_PRIM (fsLit "seq") seqIdKey seqId
realWorldName = mkWiredInIdName gHC_PRIM (fsLit "realWorld#") realWorldPrimIdKey realWorldPrimId realWorldName = mkWiredInIdName gHC_PRIM (fsLit "realWorld#") realWorldPrimIdKey realWorldPrimId
voidPrimIdName = mkWiredInIdName gHC_PRIM (fsLit "void#") voidPrimIdKey voidPrimId voidPrimIdName = mkWiredInIdName gHC_PRIM (fsLit "void#") voidPrimIdKey voidPrimId
lazyIdName = mkWiredInIdName gHC_MAGIC (fsLit "lazy") lazyIdKey lazyId lazyIdName = mkWiredInIdName gHC_MAGIC (fsLit "lazy") lazyIdKey lazyId
coercionTokenName = mkWiredInIdName gHC_PRIM (fsLit "coercionToken#") coercionTokenIdKey coercionTokenId coercionTokenName = mkWiredInIdName gHC_PRIM (fsLit "coercionToken#") coercionTokenIdKey coercionTokenId
magicDictName = mkWiredInIdName gHC_PRIM (fsLit "magicDict") magicDictKey magicDictId magicDictName = mkWiredInIdName gHC_PRIM (fsLit "magicDict") magicDictKey magicDictId
coerceName = mkWiredInIdName gHC_PRIM (fsLit "coerce") coerceKey coerceId coerceName = mkWiredInIdName gHC_PRIM (fsLit "coerce") coerceKey coerceId
proxyName = mkWiredInIdName gHC_PRIM (fsLit "proxy#") proxyHashKey proxyHashId proxyName = mkWiredInIdName gHC_PRIM (fsLit "proxy#") proxyHashKey proxyHashId
dollarName = mkWiredInIdName gHC_BASE (fsLit "$") dollarIdKey dollarId
\end{code} \end{code}
\begin{code} \begin{code}
dollarId :: Id -- Note [dollarId magic]
dollarId = pcMiscPrelId dollarName ty
(noCafIdInfo `setUnfoldingInfo` unf)
where
fun_ty = mkFunTy alphaTy openBetaTy
ty = mkForAllTys [alphaTyVar, openBetaTyVar] $
mkFunTy fun_ty fun_ty
unf = mkInlineUnfolding (Just 2) rhs
[f,x] = mkTemplateLocals [fun_ty, alphaTy]
rhs = mkLams [alphaTyVar, openBetaTyVar, f, x] $
App (Var f) (Var x)
------------------------------------------------ ------------------------------------------------
-- proxy# :: forall a. Proxy# a -- proxy# :: forall a. Proxy# a
...@@ -1160,6 +1172,20 @@ coerceId = pcMiscPrelId coerceName ty info ...@@ -1160,6 +1172,20 @@ coerceId = pcMiscPrelId coerceName ty info
[(DataAlt coercibleDataCon, [eq], Cast (Var x) (CoVarCo eq))] [(DataAlt coercibleDataCon, [eq], Cast (Var x) (CoVarCo eq))]
\end{code} \end{code}
Note [dollarId magic]
~~~~~~~~~~~~~~~~~~~~~
The only reason that ($) is wired in is so that its type can be
forall (a:*, b:Open). (a->b) -> a -> b
That is, the return type can be unboxed. E.g. this is OK
foo $ True where foo :: Bool -> Int#
because ($) doesn't inspect or move the result of the call to foo.
See Trac #8739.
There is a special typing rule for ($) in TcExpr, so the type of ($)
isn't looked at there, BUT Lint subsequently (and rightly) complains
if sees ($) applied to Int# (say), unless we give it a wired-in type
as we do here.
Note [Unsafe coerce magic] Note [Unsafe coerce magic]
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
We define a *primitive* We define a *primitive*
......
...@@ -261,6 +261,11 @@ instance Data OccName where ...@@ -261,6 +261,11 @@ instance Data OccName where
instance Outputable OccName where instance Outputable OccName where
ppr = pprOccName ppr = pprOccName
instance OutputableBndr OccName where
pprBndr _ = ppr
pprInfixOcc n = pprInfixVar (isSymOcc n) (ppr n)
pprPrefixOcc n = pprPrefixVar (isSymOcc n) (ppr n)
pprOccName :: OccName -> SDoc pprOccName :: OccName -> SDoc
pprOccName (OccName sp occ) pprOccName (OccName sp occ)
= getPprStyle $ \ sty -> = getPprStyle $ \ sty ->
...@@ -496,7 +501,7 @@ isDataSymOcc _ = False ...@@ -496,7 +501,7 @@ isDataSymOcc _ = False
-- it is a data constructor or variable or whatever) -- it is a data constructor or variable or whatever)
isSymOcc :: OccName -> Bool isSymOcc :: OccName -> Bool
isSymOcc (OccName DataName s) = isLexConSym s isSymOcc (OccName DataName s) = isLexConSym s
isSymOcc (OccName TcClsName s) = isLexConSym s || isLexVarSym s isSymOcc (OccName TcClsName s) = isLexSym s
isSymOcc (OccName VarName s) = isLexSym s isSymOcc (OccName VarName s) = isLexSym s
isSymOcc (OccName TvName s) = isLexSym s isSymOcc (OccName TvName s) = isLexSym s
-- Pretty inefficient! -- Pretty inefficient!
...@@ -863,6 +868,15 @@ isTupleOcc_maybe (OccName ns fs) ...@@ -863,6 +868,15 @@ isTupleOcc_maybe (OccName ns fs)
These functions test strings to see if they fit the lexical categories These functions test strings to see if they fit the lexical categories
defined in the Haskell report. defined in the Haskell report.
Note [Classification of generated names]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some names generated for internal use can show up in debugging output,
e.g. when using -ddump-simpl. These generated names start with a $
but should still be pretty-printed using prefix notation. We make sure
this is the case in isLexVarSym by only classifying a name as a symbol
if all its characters are symbols, not just its first one.
\begin{code} \begin{code}
isLexCon, isLexVar, isLexId, isLexSym :: FastString -> Bool isLexCon, isLexVar, isLexId, isLexSym :: FastString -> Bool
isLexConId, isLexConSym, isLexVarId, isLexVarSym :: FastString -> Bool isLexConId, isLexConSym, isLexVarId, isLexVarSym :: FastString -> Bool
...@@ -889,19 +903,23 @@ isLexConSym cs -- Infix type or data constructors ...@@ -889,19 +903,23 @@ isLexConSym cs -- Infix type or data constructors
| cs == (fsLit "->") = True | cs == (fsLit "->") = True
| otherwise = startsConSym (headFS cs) | otherwise = startsConSym (headFS cs)
isLexVarSym cs -- Infix identifiers isLexVarSym fs -- Infix identifiers e.g. "+"
| nullFS cs = False -- e.g. "+" = case (if nullFS fs then [] else unpackFS fs) of
| otherwise = startsVarSym (headFS cs) [] -> False
(c:cs) -> startsVarSym c && all isVarSymChar cs
------------- -------------
startsVarSym, startsVarId, startsConSym, startsConId :: Char -> Bool startsVarSym, startsVarId, startsConSym, startsConId :: Char -> Bool
startsVarSym c = isSymbolASCII c || (ord c > 0x7f && isSymbol c) -- Infix Ids startsVarSym c = isSymbolASCII c || (ord c > 0x7f && isSymbol c) -- Infix Ids
startsConSym c = c == ':' -- Infix data constructors startsConSym c = c == ':' -- Infix data constructors
startsVarId c = isLower c || c == '_' -- Ordinary Ids startsVarId c = isLower c || c == '_' -- Ordinary Ids
startsConId c = isUpper c || c == '(' -- Ordinary type constructors and data constructors startsConId c = isUpper c || c == '(' -- Ordinary type constructors and data constructors
isSymbolASCII :: Char -> Bool isSymbolASCII :: Char -> Bool
isSymbolASCII c = c `elem` "!#$%&*+./<=>?@\\^|~-" isSymbolASCII c = c `elem` "!#$%&*+./<=>?@\\^|~-"
isVarSymChar :: Char -> Bool
isVarSymChar c = c == ':' || startsVarSym c
\end{code} \end{code}
%************************************************************************ %************************************************************************
......
...@@ -3,6 +3,8 @@ module CmmSink ( ...@@ -3,6 +3,8 @@ module CmmSink (
cmmSink cmmSink
) where ) where
import CodeGen.Platform (callerSaves)
import Cmm import Cmm
import CmmOpt import CmmOpt
import BlockId import BlockId
...@@ -236,9 +238,11 @@ some tool like perf or VTune and make decisions what to inline based on that. ...@@ -236,9 +238,11 @@ some tool like perf or VTune and make decisions what to inline based on that.
-- global) and literals. -- global) and literals.
-- --
isTrivial :: CmmExpr -> Bool isTrivial :: CmmExpr -> Bool
isTrivial (CmmReg _) = True isTrivial (CmmReg (CmmLocal _)) = True
isTrivial (CmmLit _) = True -- isTrivial (CmmLit _) = True -- Disabled because it used to make thing worse.
isTrivial _ = False -- Needs further investigation
isTrivial _ = False
-- --
-- annotate each node with the set of registers live *after* the node -- annotate each node with the set of registers live *after* the node
...@@ -501,8 +505,7 @@ regsUsedIn ls e = wrapRecExpf f e False ...@@ -501,8 +505,7 @@ regsUsedIn ls e = wrapRecExpf f e False
-- nor the NCG can do it. See Note [Register parameter passing] -- nor the NCG can do it. See Note [Register parameter passing]
-- See also StgCmmForeign:load_args_into_temps. -- See also StgCmmForeign:load_args_into_temps.
okToInline :: DynFlags -> CmmExpr -> CmmNode e x -> Bool okToInline :: DynFlags -> CmmExpr -> CmmNode e x -> Bool
okToInline dflags expr node@(CmmUnsafeForeignCall{}) = okToInline dflags expr CmmUnsafeForeignCall{} = not (anyCallerSavesRegs dflags expr)
not (globalRegistersConflict dflags expr node)
okToInline _ _ _ = True okToInline _ _ _ = True
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
...@@ -515,23 +518,23 @@ okToInline _ _ _ = True ...@@ -515,23 +518,23 @@ okToInline _ _ _ = True
conflicts :: DynFlags -> Assignment -> CmmNode O x -> Bool conflicts :: DynFlags -> Assignment -> CmmNode O x -> Bool
conflicts dflags (r, rhs, addr) node conflicts dflags (r, rhs, addr) node
-- (1) node defines registers used by rhs of assignment. This catches -- (1) an assignment to a register conflicts with a use of the register
-- assignmnets and all three kinds of calls. See Note [Sinking and calls] | CmmAssign reg _ <- node, reg `regUsedIn` rhs = True
| globalRegistersConflict dflags rhs node = True
| localRegistersConflict dflags rhs node = True
-- (2) node uses register defined by assignment
| foldRegsUsed dflags (\b r' -> r == r' || b) False node = True | foldRegsUsed dflags (\b r' -> r == r' || b) False node = True
-- (3) a store to an address conflicts with a read of the same memory -- (2) a store to an address conflicts with a read of the same memory
| CmmStore addr' e <- node | CmmStore addr' e <- node
, memConflicts addr (loadAddr dflags addr' (cmmExprWidth dflags e)) = True , memConflicts addr (loadAddr dflags addr' (cmmExprWidth dflags e)) = True
-- (4) an assignment to Hp/Sp conflicts with a heap/stack read respectively -- (3) an assignment to Hp/Sp conflicts with a heap/stack read respectively
| HeapMem <- addr, CmmAssign (CmmGlobal Hp) _ <- node = True | HeapMem <- addr, CmmAssign (CmmGlobal Hp) _ <- node = True
| StackMem <- addr, CmmAssign (CmmGlobal Sp) _ <- node = True | StackMem <- addr, CmmAssign (CmmGlobal Sp) _ <- node = True
| SpMem{} <- addr, CmmAssign (CmmGlobal Sp) _ <- node = True | SpMem{} <- addr, CmmAssign (CmmGlobal Sp) _ <- node = True
-- (4) assignments that read caller-saves GlobalRegs conflict with a
-- foreign call. See Note [Unsafe foreign calls clobber caller-save registers]
| CmmUnsafeForeignCall{} <- node, anyCallerSavesRegs dflags rhs = True
-- (5) foreign calls clobber heap: see Note [Foreign calls clobber heap] -- (5) foreign calls clobber heap: see Note [Foreign calls clobber heap]
| CmmUnsafeForeignCall{} <- node, memConflicts addr AnyMem = True | CmmUnsafeForeignCall{} <- node, memConflicts addr AnyMem = True
...@@ -541,57 +544,11 @@ conflicts dflags (r, rhs, addr) node ...@@ -541,57 +544,11 @@ conflicts dflags (r, rhs, addr) node
-- (7) otherwise, no conflict -- (7) otherwise, no conflict
| otherwise = False | otherwise = False
-- Returns True if node defines any global registers that are used in the anyCallerSavesRegs :: DynFlags -> CmmExpr -> Bool
-- Cmm expression anyCallerSavesRegs dflags e = wrapRecExpf f e False
globalRegistersConflict :: DynFlags -> CmmExpr -> CmmNode e x -> Bool where f (CmmReg (CmmGlobal r)) _
globalRegistersConflict dflags expr node = | callerSaves (targetPlatform dflags) r = True
foldRegsDefd dflags (\b r -> b || (CmmGlobal r) `regUsedIn` expr) False node f _ z = z
-- Returns True if node defines any local registers that are used in the
-- Cmm expression
localRegistersConflict :: DynFlags -> CmmExpr -> CmmNode e x -> Bool
localRegistersConflict dflags expr node =
foldRegsDefd dflags (\b r -> b || (CmmLocal r) `regUsedIn` expr) False node
-- Note [Sinking and calls]
-- ~~~~~~~~~~~~~~~~~~~~~~~~
--
-- We have three kinds of calls: normal (CmmCall), safe foreign (CmmForeignCall)
-- and unsafe foreign (CmmUnsafeForeignCall). We perform sinking pass after
-- stack layout (see Note [Sinking after stack layout]) which leads to two
-- invariants related to calls:
--
-- a) during stack layout phase all safe foreign calls are turned into
-- unsafe foreign calls (see Note [Lower safe foreign calls]). This
-- means that we will never encounter CmmForeignCall node when running
-- sinking after stack layout
--
-- b) stack layout saves all variables live across a call on the stack
-- just before making a call (remember we are not sinking assignments to
-- stack):
--
-- L1:
-- x = R1
-- P64[Sp - 16] = L2
-- P64[Sp - 8] = x
-- Sp = Sp - 16
-- call f() returns L2
-- L2:
--
-- We will attempt to sink { x = R1 } but we will detect conflict with
-- { P64[Sp - 8] = x } and hence we will drop { x = R1 } without even
-- checking whether it conflicts with { call f() }. In this way we will
-- never need to check any assignment conflicts with CmmCall. Remember
-- that we still need to check for potential memory conflicts.
--
-- So the result is that we only need to worry about CmmUnsafeForeignCall nodes
-- when checking conflicts (see Note [Unsafe foreign calls clobber caller-save registers]).
-- This assumption holds only when we do sinking after stack layout. If we run
-- it before stack layout we need to check for possible conflicts with all three
-- kinds of calls. Our `conflicts` function does that by using a generic
-- foldRegsDefd and foldRegsUsed functions defined in DefinerOfRegs and
-- UserOfRegs typeclasses.
--
-- An abstraction of memory read or written. -- An abstraction of memory read or written.
data AbsMem data AbsMem
......
...@@ -450,25 +450,27 @@ in TcGenDeriv.) -} ...@@ -450,25 +450,27 @@ in TcGenDeriv.) -}
whether or not it has free variables, and whether we're running whether or not it has free variables, and whether we're running
sequentially or in parallel. sequentially or in parallel.
Closure Node Argument Enter Closure Node Argument Enter
Characteristics Par Req'd Passing Via Characteristics Par Req'd Passing Via
------------------------------------------------------------------------------- ---------------------------------------------------------------------------
Unknown & no & yes & stack & node Unknown & no & yes & stack & node
Known fun (>1 arg), no fvs & no & no & registers & fast entry (enough args) Known fun (>1 arg), no fvs & no & no & registers & fast entry (enough args)
& slow entry (otherwise) & slow entry (otherwise)
Known fun (>1 arg), fvs & no & yes & registers & fast entry (enough args) Known fun (>1 arg), fvs & no & yes & registers & fast entry (enough args)
0 arg, no fvs \r,\s & no & no & n/a & direct entry 0 arg, no fvs \r,\s & no & no & n/a & direct entry
0 arg, no fvs \u & no & yes & n/a & node 0 arg, no fvs \u & no & yes & n/a & node
0 arg, fvs \r,\s & no & yes & n/a & direct entry 0 arg, fvs \r,\s,selector & no & yes & n/a & node
0 arg, fvs \u & no & yes & n/a & node 0 arg, fvs \r,\s & no & yes & n/a & direct entry
Unknown & yes & yes & stack & node 0 arg, fvs \u & no & yes & n/a & node
Known fun (>1 arg), no fvs & yes & no & registers & fast entry (enough args) Unknown & yes & yes & stack & node
& slow entry (otherwise) Known fun (>1 arg), no fvs & yes & no & registers & fast entry (enough args)
Known fun (>1 arg), fvs & yes & yes & registers & node & slow entry (otherwise)
0 arg, no fvs \r,\s & yes & no & n/a & direct entry Known fun (>1 arg), fvs & yes & yes & registers & node
0 arg, no fvs \u & yes & yes & n/a & node 0 arg, fvs \r,\s,selector & yes & yes & n/a & node
0 arg, fvs \r,\s & yes & yes & n/a & node 0 arg, no fvs \r,\s & yes & no & n/a & direct entry
0 arg, fvs \u & yes & yes & n/a & node 0 arg, no fvs \u & yes & yes & n/a & node
0 arg, fvs \r,\s & yes & yes & n/a & node
0 arg, fvs \u & yes & yes & n/a & node
When black-holing, single-entry closures could also be entered via node When black-holing, single-entry closures could also be entered via node
(rather than directly) to catch double-entry. -} (rather than directly) to catch double-entry. -}
...@@ -519,7 +521,8 @@ getCallMethod dflags _name _ lf_info _n_args _cg_loc _self_loop_info ...@@ -519,7 +521,8 @@ getCallMethod dflags _name _ lf_info _n_args _cg_loc _self_loop_info
-- fetched since we allocated it. -- fetched since we allocated it.
EnterIt EnterIt
getCallMethod dflags name id (LFReEntrant _ arity _ _) n_args _cg_loc _self_loop_info getCallMethod dflags name id (LFReEntrant _ arity _ _) n_args _cg_loc
_self_loop_info
| n_args == 0 = ASSERT( arity /= 0 ) | n_args == 0 = ASSERT( arity /= 0 )
ReturnIt -- No args at all ReturnIt -- No args at all
| n_args < arity = SlowCall -- Not enough args | n_args < arity = SlowCall -- Not enough args
...@@ -531,7 +534,8 @@ getCallMethod _ _name _ LFUnLifted n_args _cg_loc _self_loop_info ...@@ -531,7 +534,8 @@ getCallMethod _ _name _ LFUnLifted n_args _cg_loc _self_loop_info
getCallMethod _ _name _ (LFCon _) n_args _cg_loc _self_loop_info getCallMethod _ _name _ (LFCon _) n_args _cg_loc _self_loop_info
= ASSERT( n_args == 0 ) ReturnIt = ASSERT( n_args == 0 ) ReturnIt
getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun) n_args _cg_loc _self_loop_info getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun)
n_args _cg_loc _self_loop_info
| is_fun -- it *might* be a function, so we must "call" it (which is always safe) | is_fun -- it *might* be a function, so we must "call" it (which is always safe)
= SlowCall -- We cannot just enter it [in eval/apply, the entry code = SlowCall -- We cannot just enter it [in eval/apply, the entry code
-- is the fast-entry code] -- is the fast-entry code]
...@@ -544,6 +548,12 @@ getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun) n_args ...@@ -544,6 +548,12 @@ getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun) n_args
of jumping directly to the entry code is still valid. --SDM of jumping directly to the entry code is still valid. --SDM
-} -}
= EnterIt = EnterIt
-- even a non-updatable selector thunk can be updated by the garbage
-- collector, so we must enter it. (#8817)
| SelectorThunk{} <- std_form_info
= EnterIt
-- We used to have ASSERT( n_args == 0 ), but actually it is -- We used to have ASSERT( n_args == 0 ), but actually it is
-- possible for the optimiser to generate -- possible for the optimiser to generate
-- let bot :: Int = error Int "urk" -- let bot :: Int = error Int "urk"
...@@ -553,7 +563,8 @@ getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun) n_args ...@@ -553,7 +563,8 @@ getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun) n_args
| otherwise -- Jump direct to code for single-entry thunks | otherwise -- Jump direct to code for single-entry thunks
= ASSERT( n_args == 0 ) = ASSERT( n_args == 0 )
DirectEntry (thunkEntryLabel dflags name (idCafInfo id) std_form_info updatable) 0 DirectEntry (thunkEntryLabel dflags name (idCafInfo id) std_form_info
updatable) 0
getCallMethod _ _name _ (LFUnknown True) _n_arg _cg_locs _self_loop_info getCallMethod _ _name _ (LFUnknown True) _n_arg _cg_locs _self_loop_info
= SlowCall -- might be a function = SlowCall -- might be a function
...@@ -562,7 +573,8 @@ getCallMethod _ name _ (LFUnknown False) n_args _cg_loc _self_loop_info ...@@ -562,7 +573,8 @@ getCallMethod _ name _ (LFUnknown False) n_args _cg_loc _self_loop_info
= ASSERT2( n_args == 0, ppr name <+> ppr n_args ) = ASSERT2( n_args == 0, ppr name <+> ppr n_args )
EnterIt -- Not a function EnterIt -- Not a function
getCallMethod _ _name _ LFLetNoEscape _n_args (LneLoc blk_id lne_regs) _self_loop_info getCallMethod _ _name _ LFLetNoEscape _n_args (LneLoc blk_id lne_regs)
_self_loop_info
= JumpToIt blk_id lne_regs = JumpToIt blk_id lne_regs
getCallMethod _ _ _ _ _ _ _ = panic "Unknown call method" getCallMethod _ _ _ _ _ _ _ = panic "Unknown call method"
......
...@@ -23,7 +23,7 @@ module CoreSubst ( ...@@ -23,7 +23,7 @@ module CoreSubst (
substTy, substCo, substExpr, substExprSC, substBind, substBindSC, substTy, substCo, substExpr, substExprSC, substBind, substBindSC,
substUnfolding, substUnfoldingSC, substUnfolding, substUnfoldingSC,
lookupIdSubst, lookupTvSubst, lookupCvSubst, substIdOcc, lookupIdSubst, lookupTvSubst, lookupCvSubst, substIdOcc,
substTickish, substTickish, substVarSet,
-- ** Operations on substitutions -- ** Operations on substitutions
emptySubst, mkEmptySubst, mkSubst, mkOpenSubst, substInScope, isEmptySubst, emptySubst, mkEmptySubst, mkSubst, mkOpenSubst, substInScope, isEmptySubst,
......
...@@ -18,7 +18,7 @@ module CoreSyn ( ...@@ -18,7 +18,7 @@ module CoreSyn (
-- * Main data types -- * Main data types
Expr(..), Alt, Bind(..), AltCon(..), Arg, Tickish(..), Expr(..), Alt, Bind(..), AltCon(..), Arg, Tickish(..),
CoreProgram, CoreExpr, CoreAlt, CoreBind, CoreArg, CoreBndr, CoreProgram, CoreExpr, CoreAlt, CoreBind, CoreArg, CoreBndr,
TaggedExpr, TaggedAlt, TaggedBind, TaggedArg, TaggedBndr(..), TaggedExpr, TaggedAlt, TaggedBind, TaggedArg, TaggedBndr(..), deTagExpr,
-- ** 'Expr' construction -- ** 'Expr' construction
mkLets, mkLams, mkLets, mkLams,
...@@ -1106,6 +1106,25 @@ instance Outputable b => OutputableBndr (TaggedBndr b) where ...@@ -1106,6 +1106,25 @@ instance Outputable b => OutputableBndr (TaggedBndr b) where
pprBndr _ b = ppr b -- Simple pprBndr _ b = ppr b -- Simple
pprInfixOcc b = ppr b pprInfixOcc b = ppr b
pprPrefixOcc b = ppr b pprPrefixOcc b = ppr b
deTagExpr :: TaggedExpr t -> CoreExpr
deTagExpr (Var v) = Var v
deTagExpr (Lit l) = Lit l
deTagExpr (Type ty) = Type ty
deTagExpr (Coercion co) = Coercion co
deTagExpr (App e1 e2) = App (deTagExpr e1) (deTagExpr e2)
deTagExpr (Lam (TB b _) e) = Lam b (deTagExpr e)
deTagExpr (Let bind body) = Let (deTagBind bind) (deTagExpr body)
deTagExpr (Case e (TB b _) ty alts) = Case (deTagExpr e) b ty (map deTagAlt alts)
deTagExpr (Tick t e) = Tick t (deTagExpr e)
deTagExpr (Cast e co) = Cast (deTagExpr e) co
deTagBind :: TaggedBind t -> CoreBind
deTagBind (NonRec (TB b _) rhs) = NonRec b (deTagExpr rhs)
deTagBind (Rec prs) = Rec [(b, deTagExpr rhs) | (TB b _, rhs) <- prs]
deTagAlt :: TaggedAlt t -> CoreAlt
deTagAlt (con, bndrs, rhs) = (con, [b | TB b _ <- bndrs], deTagExpr rhs)
\end{code} \end{code}
......
...@@ -98,8 +98,11 @@ mkSimpleUnfolding :: DynFlags -> CoreExpr -> Unfolding ...@@ -98,8 +98,11 @@ mkSimpleUnfolding :: DynFlags -> CoreExpr -> Unfolding
mkSimpleUnfolding dflags = mkUnfolding dflags InlineRhs False False mkSimpleUnfolding dflags = mkUnfolding dflags InlineRhs False False
mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding
mkDFunUnfolding bndrs con ops mkDFunUnfolding bndrs con ops
= DFunUnfolding { df_bndrs = bndrs, df_con = con, df_args = ops } = DFunUnfolding { df_bndrs = bndrs
, df_con = con
, df_args = map occurAnalyseExpr ops }
-- See Note [Occurrrence analysis of unfoldings]
mkWwInlineRule :: CoreExpr -> Arity -> Unfolding mkWwInlineRule :: CoreExpr -> Arity -> Unfolding
mkWwInlineRule expr arity mkWwInlineRule expr arity
...@@ -143,6 +146,7 @@ mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr ...@@ -143,6 +146,7 @@ mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr
-- Occurrence-analyses the expression before capturing it -- Occurrence-analyses the expression before capturing it
mkCoreUnfolding src top_lvl expr arity guidance mkCoreUnfolding src top_lvl expr arity guidance
= CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr,
-- See Note [Occurrrence analysis of unfoldings]
uf_src = src, uf_src = src,
uf_arity = arity, uf_arity = arity,
uf_is_top = top_lvl, uf_is_top = top_lvl,
...@@ -162,6 +166,7 @@ mkUnfolding dflags src top_lvl is_bottoming expr ...@@ -162,6 +166,7 @@ mkUnfolding dflags src top_lvl is_bottoming expr
= NoUnfolding -- See Note [Do not inline top-level bottoming functions] = NoUnfolding -- See Note [Do not inline top-level bottoming functions]
| otherwise | otherwise
= CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr,
-- See Note [Occurrrence analysis of unfoldings]
uf_src = src, uf_src = src,
uf_arity = arity, uf_arity = arity,
uf_is_top = top_lvl, uf_is_top = top_lvl,
...@@ -176,6 +181,24 @@ mkUnfolding dflags src top_lvl is_bottoming expr ...@@ -176,6 +181,24 @@ mkUnfolding dflags src top_lvl is_bottoming expr
-- See Note [Calculate unfolding guidance on the non-occ-anal'd expression] -- See Note [Calculate unfolding guidance on the non-occ-anal'd expression]
\end{code} \end{code}
Note [Occurrence analysis of unfoldings]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We do occurrence-analysis of unfoldings once and for all, when the
unfolding is built, rather than each time we inline them.
But given this decision it's vital that we do
*always* do it. Consider this unfolding
\x -> letrec { f = ...g...; g* = f } in body
where g* is (for some strange reason) the loop breaker. If we don't
occ-anal it when reading it in, we won't mark g as a loop breaker, and
we may inline g entirely in body, dropping its binding, and leaving
the occurrence in f out of scope. This happened in Trac #8892, where
the unfolding in question was a DFun unfolding.
But more generally, the simplifier is designed on the
basis that it is looking at occurrence-analysed expressions, so better
ensure that they acutally are.
Note [Calculate unfolding guidance on the non-occ-anal'd expression] Note [Calculate unfolding guidance on the non-occ-anal'd expression]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notice that we give the non-occur-analysed expression to Notice that we give the non-occur-analysed expression to
......
...@@ -165,9 +165,9 @@ dsStrictBind bind body = pprPanic "dsLet: unlifted" (ppr bind $$ ppr body) ...@@ -165,9 +165,9 @@ dsStrictBind bind body = pprPanic "dsLet: unlifted" (ppr bind $$ ppr body)
strictMatchOnly :: HsBind Id -> Bool strictMatchOnly :: HsBind Id -> Bool
strictMatchOnly (AbsBinds { abs_binds = binds }) strictMatchOnly (AbsBinds { abs_binds = binds })
= anyBag (strictMatchOnly . unLoc . snd) binds = anyBag (strictMatchOnly . unLoc . snd) binds
strictMatchOnly (PatBind { pat_lhs = lpat, pat_rhs_ty = ty }) strictMatchOnly (PatBind { pat_lhs = lpat, pat_rhs_ty = rhs_ty })
= isUnLiftedType ty = isUnLiftedType rhs_ty
|| isBangLPat lpat || isStrictLPat lpat
|| any (isUnLiftedType . idType) (collectPatBinders lpat) || any (isUnLiftedType . idType) (collectPatBinders lpat)
strictMatchOnly (FunBind { fun_id = L _ id }) strictMatchOnly (FunBind { fun_id = L _ id })
= isUnLiftedType (idType id) = isUnLiftedType (idType id)
......
...@@ -1238,7 +1238,7 @@ rep_bind (L _ (VarBind { var_id = v, var_rhs = e})) ...@@ -1238,7 +1238,7 @@ rep_bind (L _ (VarBind { var_id = v, var_rhs = e}))
; return (srcLocSpan (getSrcLoc v), ans) } ; return (srcLocSpan (getSrcLoc v), ans) }
rep_bind (L _ (AbsBinds {})) = panic "rep_bind: AbsBinds" rep_bind (L _ (AbsBinds {})) = panic "rep_bind: AbsBinds"
rep_bind (L _ (PatSynBind {})) = panic "rep_bind: PatSynBind" rep_bind (L _ dec@(PatSynBind {})) = notHandled "pattern synonyms" (ppr dec)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Since everything in a Bind is mutually recursive we need rename all -- Since everything in a Bind is mutually recursive we need rename all
-- all the variables simultaneously. For example: -- all the variables simultaneously. For example:
......
...@@ -353,6 +353,11 @@ else ...@@ -353,6 +353,11 @@ else
compiler_CONFIGURE_OPTS += --ghc-option=-DNO_REGS compiler_CONFIGURE_OPTS += --ghc-option=-DNO_REGS
endif endif
ifneq "$(GhcWithSMP)" "YES"
compiler_CONFIGURE_OPTS += --ghc-option=-DNOSMP
compiler_CONFIGURE_OPTS += --ghc-option=-optc-DNOSMP
endif
# Careful optimisation of the parser: we don't want to throw everything # Careful optimisation of the parser: we don't want to throw everything
# at it, because that takes too long and doesn't buy much, but we do want # at it, because that takes too long and doesn't buy much, but we do want
# to inline certain key external functions, so we instruct GHC not to # to inline certain key external functions, so we instruct GHC not to
......
...@@ -378,7 +378,16 @@ preloadLib dflags lib_paths framework_paths lib_spec ...@@ -378,7 +378,16 @@ preloadLib dflags lib_paths framework_paths lib_spec
-> do maybe_errstr <- loadDLL (mkSOName platform dll_unadorned) -> do maybe_errstr <- loadDLL (mkSOName platform dll_unadorned)
case maybe_errstr of case maybe_errstr of
Nothing -> maybePutStrLn dflags "done" Nothing -> maybePutStrLn dflags "done"
Just mm -> preloadFailed mm lib_paths lib_spec Just mm | platformOS platform /= OSDarwin ->
preloadFailed mm lib_paths lib_spec
Just mm | otherwise -> do
-- As a backup, on Darwin, try to also load a .so file
-- since (apparently) some things install that way - see
-- ticket #8770.
err2 <- loadDLL $ ("lib" ++ dll_unadorned) <.> "so"
case err2 of
Nothing -> maybePutStrLn dflags "done"
Just _ -> preloadFailed mm lib_paths lib_spec
DLLPath dll_path DLLPath dll_path
-> do maybe_errstr <- loadDLL dll_path -> do maybe_errstr <- loadDLL dll_path
......
...@@ -939,8 +939,7 @@ findPtrTyss i tys = foldM step (i, []) tys ...@@ -939,8 +939,7 @@ findPtrTyss i tys = foldM step (i, []) tys
-- The types can contain skolem type variables, which need to be treated as normal vars. -- The types can contain skolem type variables, which need to be treated as normal vars.
-- In particular, we want them to unify with things. -- In particular, we want them to unify with things.
improveRTTIType :: HscEnv -> RttiType -> RttiType -> Maybe TvSubst improveRTTIType :: HscEnv -> RttiType -> RttiType -> Maybe TvSubst
improveRTTIType _ base_ty new_ty improveRTTIType _ base_ty new_ty = U.tcUnifyTy base_ty new_ty
= U.tcUnifyTys (const U.BindMe) [base_ty] [new_ty]
getDataConArgTys :: DataCon -> Type -> TR [Type] getDataConArgTys :: DataCon -> Type -> TR [Type]
-- Given the result type ty of a constructor application (D a b c :: ty) -- Given the result type ty of a constructor application (D a b c :: ty)
......
...@@ -16,8 +16,8 @@ module HsPat ( ...@@ -16,8 +16,8 @@ module HsPat (
mkPrefixConPat, mkCharLitPat, mkNilPat, mkPrefixConPat, mkCharLitPat, mkNilPat,
isBangHsBind, isLiftedPatBind, isStrictHsBind, looksLazyPatBind,
isBangLPat, hsPatNeedsParens, isStrictLPat, hsPatNeedsParens,
isIrrefutableHsPat, isIrrefutableHsPat,
pprParendLPat pprParendLPat
...@@ -358,34 +358,34 @@ patterns are treated specially, of course. ...@@ -358,34 +358,34 @@ patterns are treated specially, of course.
The 1.3 report defines what ``irrefutable'' and ``failure-free'' patterns are. The 1.3 report defines what ``irrefutable'' and ``failure-free'' patterns are.
\begin{code} \begin{code}
isBangLPat :: LPat id -> Bool isStrictLPat :: LPat id -> Bool
isBangLPat (L _ (BangPat {})) = True isStrictLPat (L _ (ParPat p)) = isStrictLPat p
isBangLPat (L _ (ParPat p)) = isBangLPat p isStrictLPat (L _ (BangPat {})) = True
isBangLPat _ = False isStrictLPat (L _ (TuplePat _ Unboxed _)) = True
isStrictLPat _ = False
isBangHsBind :: HsBind id -> Bool
-- A pattern binding with an outermost bang isStrictHsBind :: HsBind id -> Bool
-- A pattern binding with an outermost bang or unboxed tuple must be matched strictly
-- Defined in this module because HsPat is above HsBinds in the import graph -- Defined in this module because HsPat is above HsBinds in the import graph
isBangHsBind (PatBind { pat_lhs = p }) = isBangLPat p isStrictHsBind (PatBind { pat_lhs = p }) = isStrictLPat p
isBangHsBind _ = False isStrictHsBind _ = False
isLiftedPatBind :: HsBind id -> Bool looksLazyPatBind :: HsBind id -> Bool
-- A pattern binding with a compound pattern, not just a variable -- Returns True of anything *except*
-- (I# x) yes -- a StrictHsBind (as above) or
-- (# a, b #) no, even if a::Int# -- a VarPat
-- x no, even if x::Int# -- In particular, returns True of a pattern binding with a compound pattern, like (I# x)
-- We want to warn about a missing bang-pattern on the yes's looksLazyPatBind (PatBind { pat_lhs = p }) = looksLazyLPat p
isLiftedPatBind (PatBind { pat_lhs = p }) = isLiftedLPat p looksLazyPatBind _ = False
isLiftedPatBind _ = False
looksLazyLPat :: LPat id -> Bool
isLiftedLPat :: LPat id -> Bool looksLazyLPat (L _ (ParPat p)) = looksLazyLPat p
isLiftedLPat (L _ (ParPat p)) = isLiftedLPat p looksLazyLPat (L _ (AsPat _ p)) = looksLazyLPat p
isLiftedLPat (L _ (BangPat p)) = isLiftedLPat p looksLazyLPat (L _ (BangPat {})) = False
isLiftedLPat (L _ (AsPat _ p)) = isLiftedLPat p looksLazyLPat (L _ (TuplePat _ Unboxed _)) = False
isLiftedLPat (L _ (TuplePat _ Unboxed _)) = False looksLazyLPat (L _ (VarPat {})) = False
isLiftedLPat (L _ (VarPat {})) = False looksLazyLPat (L _ (WildPat {})) = False
isLiftedLPat (L _ (WildPat {})) = False looksLazyLPat _ = True
isLiftedLPat _ = True
isIrrefutableHsPat :: OutputableBndr id => LPat id -> Bool isIrrefutableHsPat :: OutputableBndr id => LPat id -> Bool
-- (isIrrefutableHsPat p) is true if matching against p cannot fail, -- (isIrrefutableHsPat p) is true if matching against p cannot fail,
......
...@@ -55,6 +55,7 @@ import TysWiredIn ( eqTyConName ) ...@@ -55,6 +55,7 @@ import TysWiredIn ( eqTyConName )
import Fingerprint import Fingerprint
import Binary import Binary
import BooleanFormula ( BooleanFormula ) import BooleanFormula ( BooleanFormula )
import HsBinds
import Control.Monad import Control.Monad
import System.IO.Unsafe import System.IO.Unsafe
...@@ -1046,7 +1047,7 @@ instance Outputable IfaceDecl where ...@@ -1046,7 +1047,7 @@ instance Outputable IfaceDecl where
pprIfaceDecl :: IfaceDecl -> SDoc pprIfaceDecl :: IfaceDecl -> SDoc
pprIfaceDecl (IfaceId {ifName = var, ifType = ty, pprIfaceDecl (IfaceId {ifName = var, ifType = ty,
ifIdDetails = details, ifIdInfo = info}) ifIdDetails = details, ifIdInfo = info})
= sep [ ppr var <+> dcolon <+> ppr ty, = sep [ pprPrefixOcc var <+> dcolon <+> ppr ty,
nest 2 (ppr details), nest 2 (ppr details),
nest 2 (ppr info) ] nest 2 (ppr info) ]
...@@ -1099,32 +1100,27 @@ pprIfaceDecl (IfaceClass {ifCtxt = context, ifName = clas, ifTyVars = tyvars, ...@@ -1099,32 +1100,27 @@ pprIfaceDecl (IfaceClass {ifCtxt = context, ifName = clas, ifTyVars = tyvars,
sep (map ppr sigs)]) sep (map ppr sigs)])
pprIfaceDecl (IfaceAxiom {ifName = name, ifTyCon = tycon, ifAxBranches = branches }) pprIfaceDecl (IfaceAxiom {ifName = name, ifTyCon = tycon, ifAxBranches = branches })
= hang (ptext (sLit "axiom") <+> ppr name <> colon) = hang (ptext (sLit "axiom") <+> ppr name <> dcolon)
2 (vcat $ map (pprAxBranch $ Just tycon) branches) 2 (vcat $ map (pprAxBranch $ Just tycon) branches)
pprIfaceDecl (IfacePatSyn { ifName = name, ifPatHasWrapper = has_wrap, pprIfaceDecl (IfacePatSyn { ifName = name, ifPatHasWrapper = has_wrap,
ifPatIsInfix = is_infix, ifPatIsInfix = is_infix,
ifPatUnivTvs = univ_tvs, ifPatExTvs = ex_tvs, ifPatUnivTvs = _univ_tvs, ifPatExTvs = _ex_tvs,
ifPatProvCtxt = prov_ctxt, ifPatReqCtxt = req_ctxt, ifPatProvCtxt = prov_ctxt, ifPatReqCtxt = req_ctxt,
ifPatArgs = args, ifPatArgs = args,
ifPatTy = ty }) ifPatTy = ty })
= hang (text "pattern" <+> header) = pprPatSynSig name has_wrap args' ty' (pprCtxt prov_ctxt) (pprCtxt req_ctxt)
4 details
where where
header = ppr name <+> dcolon <+> args' = case (is_infix, map snd args) of
(pprIfaceForAllPart univ_tvs req_ctxt $ (True, [left_ty, right_ty]) ->
pprIfaceForAllPart ex_tvs prov_ctxt $ InfixPatSyn (pprParendIfaceType left_ty) (pprParendIfaceType right_ty)
pp_tau) (_, tys) ->
PrefixPatSyn (map pprParendIfaceType tys)
details = sep [ if is_infix then text "Infix" else empty ty' = pprParendIfaceType ty
, if has_wrap then text "HasWrapper" else empty
]
pp_tau = case map pprParendIfaceType (arg_tys ++ [ty]) of pprCtxt [] = Nothing
(t:ts) -> fsep (t : map (arrow <+>) ts) pprCtxt ctxt = Just $ pprIfaceContext ctxt
[] -> panic "pp_tau"
arg_tys = map snd args
pprCType :: Maybe CType -> SDoc pprCType :: Maybe CType -> SDoc
pprCType Nothing = ptext (sLit "No C type associated") pprCType Nothing = ptext (sLit "No C type associated")
...@@ -1152,7 +1148,7 @@ instance Outputable IfaceAT where ...@@ -1152,7 +1148,7 @@ instance Outputable IfaceAT where
pprIfaceDeclHead :: IfaceContext -> OccName -> [IfaceTvBndr] -> SDoc pprIfaceDeclHead :: IfaceContext -> OccName -> [IfaceTvBndr] -> SDoc
pprIfaceDeclHead context thing tyvars pprIfaceDeclHead context thing tyvars
= hsep [pprIfaceContext context, parenSymOcc thing (ppr thing), = hsep [pprIfaceContextArr context, parenSymOcc thing (ppr thing),
pprIfaceTvBndrs tyvars] pprIfaceTvBndrs tyvars]
pp_condecls :: OccName -> IfaceConDecls -> SDoc pp_condecls :: OccName -> IfaceConDecls -> SDoc
......
...@@ -22,7 +22,7 @@ module IfaceType ( ...@@ -22,7 +22,7 @@ module IfaceType (
toIfaceCoercion, toIfaceCoercion,
-- Printing -- Printing
pprIfaceType, pprParendIfaceType, pprIfaceContext, pprIfaceType, pprParendIfaceType, pprIfaceContext, pprIfaceContextArr,
pprIfaceIdBndr, pprIfaceTvBndr, pprIfaceTvBndrs, pprIfaceIdBndr, pprIfaceTvBndr, pprIfaceTvBndrs,
pprIfaceBndrs, pprIfaceBndrs,
tOP_PREC, tYCON_PREC, noParens, maybeParen, pprIfaceForAllPart, tOP_PREC, tYCON_PREC, noParens, maybeParen, pprIfaceForAllPart,
...@@ -31,6 +31,8 @@ module IfaceType ( ...@@ -31,6 +31,8 @@ module IfaceType (
) where ) where
import Coercion import Coercion
import TcType
import DynFlags
import TypeRep hiding( maybeParen ) import TypeRep hiding( maybeParen )
import Unique( hasKey ) import Unique( hasKey )
import TyCon import TyCon
...@@ -248,15 +250,18 @@ ppr_ty ctxt_prec ty@(IfaceForAllTy _ _) ...@@ -248,15 +250,18 @@ ppr_ty ctxt_prec ty@(IfaceForAllTy _ _)
where where
(tvs, theta, tau) = splitIfaceSigmaTy ty (tvs, theta, tau) = splitIfaceSigmaTy ty
------------------- -------------------
-- needs to handle type contexts and coercion contexts, hence the -- needs to handle type contexts and coercion contexts, hence the
-- generality -- generality
pprIfaceForAllPart :: Outputable a => [IfaceTvBndr] -> [a] -> SDoc -> SDoc pprIfaceForAllPart :: Outputable a => [IfaceTvBndr] -> [a] -> SDoc -> SDoc
pprIfaceForAllPart tvs ctxt doc pprIfaceForAllPart tvs ctxt doc
= sep [ppr_tvs, pprIfaceContext ctxt, doc] = sep [ppr_tvs, pprIfaceContextArr ctxt, doc]
where where
ppr_tvs | null tvs = empty ppr_tvs | null tvs = empty
| otherwise = ptext (sLit "forall") <+> pprIfaceTvBndrs tvs <> dot | otherwise = sdocWithDynFlags $ \ dflags ->
if gopt Opt_PrintExplicitForalls dflags
then ptext (sLit "forall") <+> pprIfaceTvBndrs tvs <> dot
else empty
------------------- -------------------
ppr_tc_app :: (Int -> a -> SDoc) -> Int -> IfaceTyCon -> [a] -> SDoc ppr_tc_app :: (Int -> a -> SDoc) -> Int -> IfaceTyCon -> [a] -> SDoc
...@@ -386,14 +391,14 @@ instance Binary IfaceTyLit where ...@@ -386,14 +391,14 @@ instance Binary IfaceTyLit where
_ -> panic ("get IfaceTyLit " ++ show tag) _ -> panic ("get IfaceTyLit " ++ show tag)
------------------- -------------------
pprIfaceContext :: Outputable a => [a] -> SDoc pprIfaceContextArr :: Outputable a => [a] -> SDoc
-- Prints "(C a, D b) =>", including the arrow -- Prints "(C a, D b) =>", including the arrow
pprIfaceContext [] = empty pprIfaceContextArr [] = empty
pprIfaceContext theta = ppr_preds theta <+> darrow pprIfaceContextArr theta = pprIfaceContext theta <+> darrow
ppr_preds :: Outputable a => [a] -> SDoc pprIfaceContext :: Outputable a => [a] -> SDoc
ppr_preds [pred] = ppr pred -- No parens pprIfaceContext [pred] = ppr pred -- No parens
ppr_preds preds = parens (sep (punctuate comma (map ppr preds))) pprIfaceContext preds = parens (sep (punctuate comma (map ppr preds)))
instance Binary IfaceType where instance Binary IfaceType where
put_ bh (IfaceForAllTy aa ab) = do put_ bh (IfaceForAllTy aa ab) = do
......