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 (193)
Showing
with 152 additions and 160 deletions
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# generic generated file patterns # generic generated file patterns
Thumbs.db
.DS_Store
*~ *~
#*# #*#
*.bak *.bak
...@@ -233,4 +236,4 @@ _darcs/ ...@@ -233,4 +236,4 @@ _darcs/
/utils/unlit/unlit /utils/unlit/unlit
/extra-gcc-opts /extra-gcc-opts
\ No newline at end of file
============================================================== =============================================================
The (Interactive) Glasgow Haskell Compiler -- version 6.10.1 The (Interactive) Glasgow Haskell Compiler -- version 7.2.1
============================================================== =============================================================
The GHC Team is pleased to announce a new major release of GHC. There The GHC Team is pleased to announce a new major release of GHC. There
have been a number of significant changes since the last major release, have been a number of significant changes since the last major release,
including: including:
* Some new language features have been implemented: <TODO: release note highlights>
* Record syntax: wild-card patterns, punning, and field disambiguation
* Generalised quasi-quotes
* Generalised list comprehensions
* View patterns
* Type families have been completely re-implemented
* Now comes with Haddock 2, which supports all GHC extensions Full release notes are here:
* Parallel garbage collection http://www.haskell.org/ghc/docs/7.2.1/html/users_guide/release-7-2-1.html
* Base provides extensible exceptions
* The GHC API is easier to use
* External core (output only) now works again
* Data Parallel Haskell (DPH) comes as part of GHC
The full release notes are here:
http://haskell.org/ghc/docs/6.10.1/html/users_guide/release-6-10-1.html
How to get it How to get it
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
......
...@@ -110,9 +110,9 @@ endif ...@@ -110,9 +110,9 @@ endif
.PHONY: test .PHONY: test
test: test:
$(MAKE) -C testsuite/tests/ghc-regress CLEANUP=1 OUTPUT_SUMMARY=../../../testsuite_summary.txt fast $(MAKE) -C testsuite/tests CLEANUP=1 OUTPUT_SUMMARY=../../testsuite_summary.txt fast
.PHONY: fulltest .PHONY: fulltest
fulltest: fulltest:
$(MAKE) -C testsuite/tests/ghc-regress CLEANUP=1 OUTPUT_SUMMARY=../../../testsuite_summary.txt $(MAKE) -C testsuite/tests CLEANUP=1 OUTPUT_SUMMARY=../../testsuite_summary.txt
...@@ -1523,6 +1523,9 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[ ...@@ -1523,6 +1523,9 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[
pc|gentoo) # like i686-pc-linux-gnu and i686-gentoo-freebsd8 pc|gentoo) # like i686-pc-linux-gnu and i686-gentoo-freebsd8
$2="unknown" $2="unknown"
;; ;;
softfloat) # like armv5tel-softfloat-linux-gnueabi
$2="unknown"
;;
*) *)
#pass thru by default #pass thru by default
$2="$1" $2="$1"
......
...@@ -174,7 +174,7 @@ sub boot_pkgs { ...@@ -174,7 +174,7 @@ sub boot_pkgs {
or die "Opening $package/ghc.mk failed: $!"; or die "Opening $package/ghc.mk failed: $!";
print GHCMK "${package}_PACKAGE = ${pkg}\n"; print GHCMK "${package}_PACKAGE = ${pkg}\n";
print GHCMK "${package}_dist-install_GROUP = libraries\n"; print GHCMK "${package}_dist-install_GROUP = libraries\n";
print GHCMK "\$(if \$(filter ${dir},\$(STAGE0_PACKAGES)),\$(eval \$(call build-package,${package},dist-boot,0)))\n"; print GHCMK "\$(if \$(filter ${dir},\$(PACKAGES_STAGE0)),\$(eval \$(call build-package,${package},dist-boot,0)))\n";
print GHCMK "\$(eval \$(call build-package,${package},dist-install,\$(if \$(filter ${dir},\$(STAGE2_PACKAGES)),2,1)))\n"; print GHCMK "\$(eval \$(call build-package,${package},dist-install,\$(if \$(filter ${dir},\$(STAGE2_PACKAGES)),2,1)))\n";
close GHCMK close GHCMK
or die "Closing $package/ghc.mk failed: $!"; or die "Closing $package/ghc.mk failed: $!";
......
...@@ -19,7 +19,9 @@ types that ...@@ -19,7 +19,9 @@ types that
module BasicTypes( module BasicTypes(
Version, bumpVersion, initialVersion, Version, bumpVersion, initialVersion,
Arity, Arity,
Alignment,
FunctionOrData(..), FunctionOrData(..),
...@@ -45,8 +47,8 @@ module BasicTypes( ...@@ -45,8 +47,8 @@ module BasicTypes(
TupCon(..), tupleParens, TupCon(..), tupleParens,
OccInfo(..), seqOccInfo, zapFragileOcc, isOneOcc, OccInfo(..), seqOccInfo, zapFragileOcc, isOneOcc,
isDeadOcc, isLoopBreaker, isNonRuleLoopBreaker, isNoOcc, isDeadOcc, isStrongLoopBreaker, isWeakLoopBreaker, isNoOcc,
nonRuleLoopBreaker, strongLoopBreaker, weakLoopBreaker,
InsideLam, insideLam, notInsideLam, InsideLam, insideLam, notInsideLam,
OneBranch, oneBranch, notOneBranch, OneBranch, oneBranch, notOneBranch,
...@@ -94,6 +96,16 @@ import Data.Function (on) ...@@ -94,6 +96,16 @@ import Data.Function (on)
type Arity = Int type Arity = Int
\end{code} \end{code}
%************************************************************************
%* *
\subsection[Alignment]{Alignment}
%* *
%************************************************************************
\begin{code}
type Alignment = Int -- align to next N-byte boundary (N must be a power of 2).
\end{code}
%************************************************************************ %************************************************************************
%* * %* *
\subsection[FunctionOrData]{FunctionOrData} \subsection[FunctionOrData]{FunctionOrData}
...@@ -444,24 +456,20 @@ data OccInfo ...@@ -444,24 +456,20 @@ data OccInfo
-- | This identifier breaks a loop of mutually recursive functions. The field -- | This identifier breaks a loop of mutually recursive functions. The field
-- marks whether it is only a loop breaker due to a reference in a rule -- marks whether it is only a loop breaker due to a reference in a rule
| IAmALoopBreaker -- Note [LoopBreaker OccInfo] | IAmALoopBreaker -- Note [LoopBreaker OccInfo]
!RulesOnly -- True <=> This is a weak or rules-only loop breaker !RulesOnly
-- See OccurAnal Note [Weak loop breakers]
type RulesOnly = Bool type RulesOnly = Bool
\end{code} \end{code}
Note [LoopBreaker OccInfo] Note [LoopBreaker OccInfo]
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
An OccInfo of (IAmLoopBreaker False) is used by the occurrence IAmALoopBreaker True <=> A "weak" or rules-only loop breaker
analyser in two ways: Do not preInlineUnconditionally
(a) to mark loop-breakers in a group of recursive
definitions (hence the name) IAmALoopBreaker False <=> A "strong" loop breaker
(b) to mark binders that must not be inlined in this phase Do not inline at all
(perhaps it has a NOINLINE pragma)
Things with (IAmLoopBreaker False) do not get an unfolding
pinned on to them, so they are completely opaque.
See OccurAnal Note [Weak loop breakers] for (IAmLoopBreaker True). See OccurAnal Note [Weak loop breakers]
\begin{code} \begin{code}
...@@ -492,16 +500,17 @@ oneBranch, notOneBranch :: OneBranch ...@@ -492,16 +500,17 @@ oneBranch, notOneBranch :: OneBranch
oneBranch = True oneBranch = True
notOneBranch = False notOneBranch = False
isLoopBreaker :: OccInfo -> Bool strongLoopBreaker, weakLoopBreaker :: OccInfo
isLoopBreaker (IAmALoopBreaker _) = True strongLoopBreaker = IAmALoopBreaker False
isLoopBreaker _ = False weakLoopBreaker = IAmALoopBreaker True
isNonRuleLoopBreaker :: OccInfo -> Bool isWeakLoopBreaker :: OccInfo -> Bool
isNonRuleLoopBreaker (IAmALoopBreaker False) = True -- Loop-breaker that breaks a non-rule cycle isWeakLoopBreaker (IAmALoopBreaker _) = True
isNonRuleLoopBreaker _ = False isWeakLoopBreaker _ = False
nonRuleLoopBreaker :: OccInfo isStrongLoopBreaker :: OccInfo -> Bool
nonRuleLoopBreaker = IAmALoopBreaker False isStrongLoopBreaker (IAmALoopBreaker False) = True -- Loop-breaker that breaks a non-rule cycle
isStrongLoopBreaker _ = False
isDeadOcc :: OccInfo -> Bool isDeadOcc :: OccInfo -> Bool
isDeadOcc IAmDead = True isDeadOcc IAmDead = True
......
...@@ -56,6 +56,7 @@ import FastString ...@@ -56,6 +56,7 @@ import FastString
import Module import Module
import qualified Data.Data as Data import qualified Data.Data as Data
import qualified Data.Typeable
import Data.Char import Data.Char
import Data.Word import Data.Word
\end{code} \end{code}
...@@ -374,6 +375,7 @@ data DataCon ...@@ -374,6 +375,7 @@ data DataCon
-- Used for Template Haskell and 'deriving' only -- Used for Template Haskell and 'deriving' only
-- The actual fixity is stored elsewhere -- The actual fixity is stored elsewhere
} }
deriving Data.Typeable.Typeable
-- | Contains the Ids of the data constructor functions -- | Contains the Ids of the data constructor functions
data DataConIds data DataConIds
...@@ -456,9 +458,6 @@ instance Outputable DataCon where ...@@ -456,9 +458,6 @@ instance Outputable DataCon where
instance Show DataCon where instance Show DataCon where
showsPrec p con = showsPrecSDoc p (ppr con) showsPrec p con = showsPrecSDoc p (ppr con)
instance Data.Typeable DataCon where
typeOf _ = Data.mkTyConApp (Data.mkTyCon "DataCon") []
instance Data.Data DataCon where instance Data.Data DataCon where
-- don't traverse? -- don't traverse?
toConstr _ = abstractConstr "DataCon" toConstr _ = abstractConstr "DataCon"
......
...@@ -508,8 +508,8 @@ isStrictId id ...@@ -508,8 +508,8 @@ isStrictId id
idUnfolding :: Id -> Unfolding idUnfolding :: Id -> Unfolding
-- Do not expose the unfolding of a loop breaker! -- Do not expose the unfolding of a loop breaker!
idUnfolding id idUnfolding id
| isNonRuleLoopBreaker (occInfo info) = NoUnfolding | isStrongLoopBreaker (occInfo info) = NoUnfolding
| otherwise = unfoldingInfo info | otherwise = unfoldingInfo info
where where
info = idInfo id info = idInfo id
......
...@@ -38,7 +38,7 @@ module IdInfo ( ...@@ -38,7 +38,7 @@ module IdInfo (
-- ** The OccInfo type -- ** The OccInfo type
OccInfo(..), OccInfo(..),
isDeadOcc, isLoopBreaker, isDeadOcc, isStrongLoopBreaker, isWeakLoopBreaker,
occInfo, setOccInfo, occInfo, setOccInfo,
InsideLam, OneBranch, InsideLam, OneBranch,
......
...@@ -584,7 +584,7 @@ mkProductBox arg_ids ty ...@@ -584,7 +584,7 @@ mkProductBox arg_ids ty
result_expr result_expr
| isNewTyCon tycon && not (isRecursiveTyCon tycon) | isNewTyCon tycon && not (isRecursiveTyCon tycon)
= wrap (mkProductBox arg_ids (newTyConInstRhs tycon tycon_args)) = wrap (mkProductBox arg_ids (newTyConInstRhs tycon tycon_args))
| otherwise = mkConApp pack_con (map Type tycon_args ++ map Var arg_ids) | otherwise = mkConApp pack_con (map Type tycon_args ++ varsToCoreExprs arg_ids)
wrap expr = wrapNewTypeBody tycon tycon_args expr wrap expr = wrapNewTypeBody tycon tycon_args expr
......
...@@ -34,9 +34,6 @@ module NameSet ( ...@@ -34,9 +34,6 @@ module NameSet (
import Name import Name
import UniqSet import UniqSet
import Util
import Data.Data
\end{code} \end{code}
%************************************************************************ %************************************************************************
...@@ -48,20 +45,7 @@ import Data.Data ...@@ -48,20 +45,7 @@ import Data.Data
\begin{code} \begin{code}
type NameSet = UniqSet Name type NameSet = UniqSet Name
-- TODO: These Data/Typeable instances look very dubious. Surely either emptyNameSet :: NameSet
-- UniqFM should have the instances, or this should be a newtype?
nameSetTc :: TyCon
nameSetTc = mkTyCon "NameSet"
instance Typeable NameSet where { typeOf _ = mkTyConApp nameSetTc [] }
instance Data NameSet where
gfoldl k z s = z mkNameSet `k` nameSetToList s -- traverse abstractly
toConstr _ = abstractConstr "NameSet"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNoRepType "NameSet"
emptyNameSet :: NameSet
unitNameSet :: Name -> NameSet unitNameSet :: Name -> NameSet
addListToNameSet :: NameSet -> [Name] -> NameSet addListToNameSet :: NameSet -> [Name] -> NameSet
addOneToNameSet :: NameSet -> Name -> NameSet addOneToNameSet :: NameSet -> Name -> NameSet
......
...@@ -35,8 +35,10 @@ module VarEnv ( ...@@ -35,8 +35,10 @@ module VarEnv (
RnEnv2, RnEnv2,
-- ** Operations on RnEnv2s -- ** Operations on RnEnv2s
mkRnEnv2, rnBndr2, rnBndrs2, rnOccL, rnOccR, inRnEnvL, inRnEnvR, mkRnEnv2, rnBndr2, rnBndrs2,
rnOccL, rnOccR, inRnEnvL, inRnEnvR, rnOccL_maybe, rnOccR_maybe,
rnBndrL, rnBndrR, nukeRnEnvL, nukeRnEnvR, rnBndrL, rnBndrR, nukeRnEnvL, nukeRnEnvR,
delBndrL, delBndrR, delBndrsL, delBndrsR,
addRnInScopeSet, addRnInScopeSet,
rnEtaL, rnEtaR, rnEtaL, rnEtaR,
rnInScope, rnInScopeSet, lookupRnInScope, rnInScope, rnInScopeSet, lookupRnInScope,
...@@ -283,11 +285,24 @@ rnEtaR (RV2 { envL = envL, envR = envR, in_scope = in_scope }) bR ...@@ -283,11 +285,24 @@ rnEtaR (RV2 { envL = envL, envR = envR, in_scope = in_scope }) bR
where where
new_b = uniqAway in_scope bR new_b = uniqAway in_scope bR
delBndrL, delBndrR :: RnEnv2 -> Var -> RnEnv2
delBndrL rn@(RV2 { envL = env, in_scope = in_scope }) v = rn { envL = env `delVarEnv` v, in_scope = in_scope `extendInScopeSet` v }
delBndrR rn@(RV2 { envR = env, in_scope = in_scope }) v = rn { envR = env `delVarEnv` v, in_scope = in_scope `extendInScopeSet` v }
delBndrsL, delBndrsR :: RnEnv2 -> [Var] -> RnEnv2
delBndrsL rn@(RV2 { envL = env, in_scope = in_scope }) v = rn { envL = env `delVarEnvList` v, in_scope = in_scope `extendInScopeSetList` v }
delBndrsR rn@(RV2 { envR = env, in_scope = in_scope }) v = rn { envR = env `delVarEnvList` v, in_scope = in_scope `extendInScopeSetList` v }
rnOccL, rnOccR :: RnEnv2 -> Var -> Var rnOccL, rnOccR :: RnEnv2 -> Var -> Var
-- ^ Look up the renaming of an occurrence in the left or right term -- ^ Look up the renaming of an occurrence in the left or right term
rnOccL (RV2 { envL = env }) v = lookupVarEnv env v `orElse` v rnOccL (RV2 { envL = env }) v = lookupVarEnv env v `orElse` v
rnOccR (RV2 { envR = env }) v = lookupVarEnv env v `orElse` v rnOccR (RV2 { envR = env }) v = lookupVarEnv env v `orElse` v
rnOccL_maybe, rnOccR_maybe :: RnEnv2 -> Var -> Maybe Var
-- ^ Look up the renaming of an occurrence in the left or right term
rnOccL_maybe (RV2 { envL = env }) v = lookupVarEnv env v
rnOccR_maybe (RV2 { envR = env }) v = lookupVarEnv env v
inRnEnvL, inRnEnvR :: RnEnv2 -> Var -> Bool inRnEnvL, inRnEnvR :: RnEnv2 -> Var -> Bool
-- ^ Tells whether a variable is locally bound -- ^ Tells whether a variable is locally bound
inRnEnvL (RV2 { envL = env }) v = v `elemVarEnv` env inRnEnvL (RV2 { envL = env }) v = v `elemVarEnv` env
...@@ -360,7 +375,7 @@ filterVarEnv_Directly :: (Unique -> a -> Bool) -> VarEnv a -> VarEnv a ...@@ -360,7 +375,7 @@ filterVarEnv_Directly :: (Unique -> a -> Bool) -> VarEnv a -> VarEnv a
restrictVarEnv :: VarEnv a -> VarSet -> VarEnv a restrictVarEnv :: VarEnv a -> VarSet -> VarEnv a
delVarEnvList :: VarEnv a -> [Var] -> VarEnv a delVarEnvList :: VarEnv a -> [Var] -> VarEnv a
delVarEnv :: VarEnv a -> Var -> VarEnv a delVarEnv :: VarEnv a -> Var -> VarEnv a
minusVarEnv :: VarEnv a -> VarEnv a -> VarEnv a minusVarEnv :: VarEnv a -> VarEnv b -> VarEnv a
intersectsVarEnv :: VarEnv a -> VarEnv a -> Bool intersectsVarEnv :: VarEnv a -> VarEnv a -> Bool
plusVarEnv_C :: (a -> a -> a) -> VarEnv a -> VarEnv a -> VarEnv a plusVarEnv_C :: (a -> a -> a) -> VarEnv a -> VarEnv a -> VarEnv a
mapVarEnv :: (a -> b) -> VarEnv a -> VarEnv b mapVarEnv :: (a -> b) -> VarEnv a -> VarEnv b
......
...@@ -100,6 +100,7 @@ module CLabel ( ...@@ -100,6 +100,7 @@ module CLabel (
hasCAF, hasCAF,
infoLblToEntryLbl, entryLblToInfoLbl, cvtToClosureLbl, cvtToSRTLbl, infoLblToEntryLbl, entryLblToInfoLbl, cvtToClosureLbl, cvtToSRTLbl,
localiseLabel,
needsCDecl, isAsmTemp, maybeAsmTemp, externallyVisibleCLabel, needsCDecl, isAsmTemp, maybeAsmTemp, externallyVisibleCLabel,
isMathFun, isMathFun,
isCFunctionLabel, isGcPtrLabel, labelDynamic, isCFunctionLabel, isGcPtrLabel, labelDynamic,
...@@ -278,11 +279,14 @@ pprDebugCLabel lbl ...@@ -278,11 +279,14 @@ pprDebugCLabel lbl
_ -> ppr lbl <> (parens $ text "other CLabel)") _ -> ppr lbl <> (parens $ text "other CLabel)")
-- True if a local IdLabel that we won't mark as exported
type IsLocal = Bool
data IdLabelInfo data IdLabelInfo
= Closure -- ^ Label for closure = Closure -- ^ Label for closure
| SRT -- ^ Static reference table | SRT -- ^ Static reference table
| InfoTable -- ^ Info tables for closures; always read-only | InfoTable IsLocal -- ^ Info tables for closures; always read-only
| Entry -- ^ Entry point | Entry IsLocal -- ^ Entry point
| Slow -- ^ Slow entry point | Slow -- ^ Slow entry point
| RednCounts -- ^ Label of place to keep Ticky-ticky info for this Id | RednCounts -- ^ Label of place to keep Ticky-ticky info for this Id
...@@ -356,13 +360,13 @@ mkRednCountsLabel name c = IdLabel name c RednCounts ...@@ -356,13 +360,13 @@ mkRednCountsLabel name c = IdLabel name c RednCounts
-- These have local & (possibly) external variants: -- These have local & (possibly) external variants:
mkLocalClosureLabel name c = IdLabel name c Closure mkLocalClosureLabel name c = IdLabel name c Closure
mkLocalInfoTableLabel name c = IdLabel name c InfoTable mkLocalInfoTableLabel name c = IdLabel name c (InfoTable True)
mkLocalEntryLabel name c = IdLabel name c Entry mkLocalEntryLabel name c = IdLabel name c (Entry True)
mkLocalClosureTableLabel name c = IdLabel name c ClosureTable mkLocalClosureTableLabel name c = IdLabel name c ClosureTable
mkClosureLabel name c = IdLabel name c Closure mkClosureLabel name c = IdLabel name c Closure
mkInfoTableLabel name c = IdLabel name c InfoTable mkInfoTableLabel name c = IdLabel name c (InfoTable False)
mkEntryLabel name c = IdLabel name c Entry mkEntryLabel name c = IdLabel name c (Entry False)
mkClosureTableLabel name c = IdLabel name c ClosureTable mkClosureTableLabel name c = IdLabel name c ClosureTable
mkLocalConInfoTableLabel c con = IdLabel con c ConInfoTable mkLocalConInfoTableLabel c con = IdLabel con c ConInfoTable
mkLocalConEntryLabel c con = IdLabel con c ConEntry mkLocalConEntryLabel c con = IdLabel con c ConEntry
...@@ -498,7 +502,7 @@ mkPlainModuleInitLabel mod = PlainModuleInitLabel mod ...@@ -498,7 +502,7 @@ mkPlainModuleInitLabel mod = PlainModuleInitLabel mod
-- Converting between info labels and entry/ret labels. -- Converting between info labels and entry/ret labels.
infoLblToEntryLbl :: CLabel -> CLabel infoLblToEntryLbl :: CLabel -> CLabel
infoLblToEntryLbl (IdLabel n c InfoTable) = IdLabel n c Entry infoLblToEntryLbl (IdLabel n c (InfoTable lcl)) = IdLabel n c (Entry lcl)
infoLblToEntryLbl (IdLabel n c ConInfoTable) = IdLabel n c ConEntry infoLblToEntryLbl (IdLabel n c ConInfoTable) = IdLabel n c ConEntry
infoLblToEntryLbl (IdLabel n c StaticInfoTable) = IdLabel n c StaticConEntry infoLblToEntryLbl (IdLabel n c StaticInfoTable) = IdLabel n c StaticConEntry
infoLblToEntryLbl (CaseLabel n CaseReturnInfo) = CaseLabel n CaseReturnPt infoLblToEntryLbl (CaseLabel n CaseReturnInfo) = CaseLabel n CaseReturnPt
...@@ -509,7 +513,7 @@ infoLblToEntryLbl _ ...@@ -509,7 +513,7 @@ infoLblToEntryLbl _
entryLblToInfoLbl :: CLabel -> CLabel entryLblToInfoLbl :: CLabel -> CLabel
entryLblToInfoLbl (IdLabel n c Entry) = IdLabel n c InfoTable entryLblToInfoLbl (IdLabel n c (Entry lcl)) = IdLabel n c (InfoTable lcl)
entryLblToInfoLbl (IdLabel n c ConEntry) = IdLabel n c ConInfoTable entryLblToInfoLbl (IdLabel n c ConEntry) = IdLabel n c ConInfoTable
entryLblToInfoLbl (IdLabel n c StaticConEntry) = IdLabel n c StaticInfoTable entryLblToInfoLbl (IdLabel n c StaticConEntry) = IdLabel n c StaticInfoTable
entryLblToInfoLbl (CaseLabel n CaseReturnPt) = CaseLabel n CaseReturnInfo entryLblToInfoLbl (CaseLabel n CaseReturnPt) = CaseLabel n CaseReturnInfo
...@@ -519,8 +523,8 @@ entryLblToInfoLbl l ...@@ -519,8 +523,8 @@ entryLblToInfoLbl l
= pprPanic "CLabel.entryLblToInfoLbl" (pprCLabel l) = pprPanic "CLabel.entryLblToInfoLbl" (pprCLabel l)
cvtToClosureLbl (IdLabel n c InfoTable) = IdLabel n c Closure cvtToClosureLbl (IdLabel n c (InfoTable _)) = IdLabel n c Closure
cvtToClosureLbl (IdLabel n c Entry) = IdLabel n c Closure cvtToClosureLbl (IdLabel n c (Entry _)) = IdLabel n c Closure
cvtToClosureLbl (IdLabel n c ConEntry) = IdLabel n c Closure cvtToClosureLbl (IdLabel n c ConEntry) = IdLabel n c Closure
cvtToClosureLbl (IdLabel n c RednCounts) = IdLabel n c Closure cvtToClosureLbl (IdLabel n c RednCounts) = IdLabel n c Closure
cvtToClosureLbl l@(IdLabel n c Closure) = l cvtToClosureLbl l@(IdLabel n c Closure) = l
...@@ -528,13 +532,18 @@ cvtToClosureLbl l ...@@ -528,13 +532,18 @@ cvtToClosureLbl l
= pprPanic "cvtToClosureLbl" (pprCLabel l) = pprPanic "cvtToClosureLbl" (pprCLabel l)
cvtToSRTLbl (IdLabel n c InfoTable) = mkSRTLabel n c cvtToSRTLbl (IdLabel n c (InfoTable _)) = mkSRTLabel n c
cvtToSRTLbl (IdLabel n c Entry) = mkSRTLabel n c cvtToSRTLbl (IdLabel n c (Entry _)) = mkSRTLabel n c
cvtToSRTLbl (IdLabel n c ConEntry) = mkSRTLabel n c cvtToSRTLbl (IdLabel n c ConEntry) = mkSRTLabel n c
cvtToSRTLbl l@(IdLabel n c Closure) = mkSRTLabel n c cvtToSRTLbl l@(IdLabel n c Closure) = mkSRTLabel n c
cvtToSRTLbl l cvtToSRTLbl l
= pprPanic "cvtToSRTLbl" (pprCLabel l) = pprPanic "cvtToSRTLbl" (pprCLabel l)
localiseLabel :: CLabel -> CLabel
localiseLabel (IdLabel n c (Entry _)) = IdLabel n c (Entry True)
localiseLabel (IdLabel n c (InfoTable _)) = IdLabel n c (InfoTable True)
localiseLabel l = l
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- Does a CLabel refer to a CAF? -- Does a CLabel refer to a CAF?
...@@ -691,7 +700,7 @@ externallyVisibleCLabel (PlainModuleInitLabel _)= True ...@@ -691,7 +700,7 @@ externallyVisibleCLabel (PlainModuleInitLabel _)= True
externallyVisibleCLabel (RtsLabel _) = True externallyVisibleCLabel (RtsLabel _) = True
externallyVisibleCLabel (CmmLabel _ _ _) = True externallyVisibleCLabel (CmmLabel _ _ _) = True
externallyVisibleCLabel (ForeignLabel{}) = True externallyVisibleCLabel (ForeignLabel{}) = True
externallyVisibleCLabel (IdLabel name _ _) = isExternalName name externallyVisibleCLabel (IdLabel name _ info) = isExternalName name && externallyVisibleIdLabel info
externallyVisibleCLabel (CC_Label _) = True externallyVisibleCLabel (CC_Label _) = True
externallyVisibleCLabel (CCS_Label _) = True externallyVisibleCLabel (CCS_Label _) = True
externallyVisibleCLabel (DynamicLinkerLabel _ _) = False externallyVisibleCLabel (DynamicLinkerLabel _ _) = False
...@@ -699,6 +708,12 @@ externallyVisibleCLabel (HpcTicksLabel _) = True ...@@ -699,6 +708,12 @@ externallyVisibleCLabel (HpcTicksLabel _) = True
externallyVisibleCLabel (LargeBitmapLabel _) = False externallyVisibleCLabel (LargeBitmapLabel _) = False
externallyVisibleCLabel (LargeSRTLabel _) = False externallyVisibleCLabel (LargeSRTLabel _) = False
externallyVisibleIdLabel :: IdLabelInfo -> Bool
externallyVisibleIdLabel SRT = False
externallyVisibleIdLabel (Entry lcl) = not lcl
externallyVisibleIdLabel (InfoTable lcl) = not lcl
externallyVisibleIdLabel _ = True
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- Finding the "type" of a CLabel -- Finding the "type" of a CLabel
...@@ -744,7 +759,7 @@ labelType _ = DataLabel ...@@ -744,7 +759,7 @@ labelType _ = DataLabel
idInfoLabelType info = idInfoLabelType info =
case info of case info of
InfoTable -> DataLabel InfoTable _ -> DataLabel
Closure -> GcPtrLabel Closure -> GcPtrLabel
ConInfoTable -> DataLabel ConInfoTable -> DataLabel
StaticInfoTable -> DataLabel StaticInfoTable -> DataLabel
...@@ -847,6 +862,8 @@ entry. ...@@ -847,6 +862,8 @@ entry.
instance Outputable CLabel where instance Outputable CLabel where
ppr = pprCLabel ppr = pprCLabel
instance PlatformOutputable CLabel where
pprPlatform _ = pprCLabel
pprCLabel :: CLabel -> SDoc pprCLabel :: CLabel -> SDoc
...@@ -980,8 +997,8 @@ ppIdFlavor x = pp_cSEP <> ...@@ -980,8 +997,8 @@ ppIdFlavor x = pp_cSEP <>
(case x of (case x of
Closure -> ptext (sLit "closure") Closure -> ptext (sLit "closure")
SRT -> ptext (sLit "srt") SRT -> ptext (sLit "srt")
InfoTable -> ptext (sLit "info") InfoTable _ -> ptext (sLit "info")
Entry -> ptext (sLit "entry") Entry _ -> ptext (sLit "entry")
Slow -> ptext (sLit "slow") Slow -> ptext (sLit "slow")
RednCounts -> ptext (sLit "ct") RednCounts -> ptext (sLit "ct")
ConEntry -> ptext (sLit "con_entry") ConEntry -> ptext (sLit "con_entry")
......
...@@ -53,8 +53,8 @@ type CmmBwdRewrite f = BwdRewrite FuelUniqSM CmmNode f ...@@ -53,8 +53,8 @@ type CmmBwdRewrite f = BwdRewrite FuelUniqSM CmmNode f
data CmmStackInfo = StackInfo {arg_space :: ByteOff, updfr_space :: Maybe ByteOff} data CmmStackInfo = StackInfo {arg_space :: ByteOff, updfr_space :: Maybe ByteOff}
data CmmTopInfo = TopInfo {info_tbl :: CmmInfoTable, stack_info :: CmmStackInfo} data CmmTopInfo = TopInfo {info_tbl :: CmmInfoTable, stack_info :: CmmStackInfo}
type Cmm = GenCmm CmmStatic CmmTopInfo CmmGraph type Cmm = GenCmm CmmStatics CmmTopInfo CmmGraph
type CmmTop = GenCmmTop CmmStatic CmmTopInfo CmmGraph type CmmTop = GenCmmTop CmmStatics CmmTopInfo CmmGraph
------------------------------------------------- -------------------------------------------------
-- Manipulating CmmGraphs -- Manipulating CmmGraphs
......
...@@ -238,7 +238,7 @@ addCAF caf srt = ...@@ -238,7 +238,7 @@ addCAF caf srt =
where last = next_elt srt where last = next_elt srt
srtToData :: TopSRT -> Cmm srtToData :: TopSRT -> Cmm
srtToData srt = Cmm [CmmData RelocatableReadOnlyData (CmmDataLabel (lbl srt) : tbl)] srtToData srt = Cmm [CmmData RelocatableReadOnlyData (Statics (lbl srt) tbl)]
where tbl = map (CmmStaticLit . CmmLabel) (reverse (rev_elts srt)) where tbl = map (CmmStaticLit . CmmLabel) (reverse (rev_elts srt))
-- Once we have found the CAFs, we need to do two things: -- Once we have found the CAFs, we need to do two things:
...@@ -317,7 +317,7 @@ to_SRT top_srt off len bmp ...@@ -317,7 +317,7 @@ to_SRT top_srt off len bmp
= do id <- getUniqueM = do id <- getUniqueM
let srt_desc_lbl = mkLargeSRTLabel id let srt_desc_lbl = mkLargeSRTLabel id
tbl = CmmData RelocatableReadOnlyData $ tbl = CmmData RelocatableReadOnlyData $
CmmDataLabel srt_desc_lbl : map CmmStaticLit Statics srt_desc_lbl $ map CmmStaticLit
( cmmLabelOffW top_srt off ( cmmLabelOffW top_srt off
: mkWordCLit (fromIntegral len) : mkWordCLit (fromIntegral len)
: map mkWordCLit bmp) : map mkWordCLit bmp)
...@@ -336,7 +336,7 @@ localCAFInfo :: CAFEnv -> CmmTop -> Maybe (CLabel, CAFSet) ...@@ -336,7 +336,7 @@ localCAFInfo :: CAFEnv -> CmmTop -> Maybe (CLabel, CAFSet)
localCAFInfo _ (CmmData _ _) = Nothing localCAFInfo _ (CmmData _ _) = Nothing
localCAFInfo cafEnv (CmmProc top_info top_l (CmmGraph {g_entry=entry})) = localCAFInfo cafEnv (CmmProc top_info top_l (CmmGraph {g_entry=entry})) =
case info_tbl top_info of case info_tbl top_info of
CmmInfoTable False _ _ _ -> CmmInfoTable _ False _ _ _ ->
Just (cvtToClosureLbl top_l, Just (cvtToClosureLbl top_l,
expectJust "maybeBindCAFs" $ mapLookup entry cafEnv) expectJust "maybeBindCAFs" $ mapLookup entry cafEnv)
_ -> Nothing _ -> Nothing
...@@ -397,8 +397,8 @@ updInfo toVars toSrt (CmmProc top_info top_l g) = ...@@ -397,8 +397,8 @@ updInfo toVars toSrt (CmmProc top_info top_l g) =
updInfo _ _ t = t updInfo _ _ t = t
updInfoTbl :: (StackLayout -> StackLayout) -> (C_SRT -> C_SRT) -> CmmInfoTable -> CmmInfoTable updInfoTbl :: (StackLayout -> StackLayout) -> (C_SRT -> C_SRT) -> CmmInfoTable -> CmmInfoTable
updInfoTbl toVars toSrt (CmmInfoTable s p t typeinfo) updInfoTbl toVars toSrt (CmmInfoTable l s p t typeinfo)
= CmmInfoTable s p t typeinfo' = CmmInfoTable l s p t typeinfo'
where typeinfo' = case typeinfo of where typeinfo' = case typeinfo of
t@(ConstrInfo _ _ _) -> t t@(ConstrInfo _ _ _) -> t
(FunInfo c s a d e) -> FunInfo c (toSrt s) a d e (FunInfo c s a d e) -> FunInfo c (toSrt s) a d e
......
...@@ -13,6 +13,7 @@ import CmmExpr ...@@ -13,6 +13,7 @@ import CmmExpr
import MkGraph import MkGraph
import qualified OldCmm as Old import qualified OldCmm as Old
import OldPprCmm () import OldPprCmm ()
import Platform
import Compiler.Hoopl hiding ((<*>), mkLabel, mkBranch) import Compiler.Hoopl hiding ((<*>), mkLabel, mkBranch)
import Control.Monad import Control.Monad
...@@ -21,23 +22,23 @@ import Maybes ...@@ -21,23 +22,23 @@ import Maybes
import Outputable import Outputable
import UniqSupply import UniqSupply
cmmToZgraph :: Old.Cmm -> UniqSM Cmm cmmToZgraph :: Platform -> Old.Cmm -> UniqSM Cmm
cmmOfZgraph :: Cmm -> Old.Cmm cmmOfZgraph :: Cmm -> Old.Cmm
cmmToZgraph (Cmm tops) = liftM Cmm $ mapM mapTop tops cmmToZgraph platform (Cmm tops) = liftM Cmm $ mapM mapTop tops
where mapTop (CmmProc (Old.CmmInfo _ _ info_tbl) l g) = where mapTop (CmmProc (Old.CmmInfo _ _ info_tbl) l g) =
do (stack_info, g) <- toZgraph (showSDoc $ ppr l) g do (stack_info, g) <- toZgraph platform (showSDoc $ ppr l) g
return $ CmmProc (TopInfo {info_tbl=info_tbl, stack_info=stack_info}) l g return $ CmmProc (TopInfo {info_tbl=info_tbl, stack_info=stack_info}) l g
mapTop (CmmData s ds) = return $ CmmData s ds mapTop (CmmData s ds) = return $ CmmData s ds
cmmOfZgraph (Cmm tops) = Cmm $ map mapTop tops cmmOfZgraph (Cmm tops) = Cmm $ map mapTop tops
where mapTop (CmmProc h l g) = CmmProc (Old.CmmInfo Nothing Nothing (info_tbl h)) l (ofZgraph g) where mapTop (CmmProc h l g) = CmmProc (Old.CmmInfo Nothing Nothing (info_tbl h)) l (ofZgraph g)
mapTop (CmmData s ds) = CmmData s ds mapTop (CmmData s ds) = CmmData s ds
toZgraph :: String -> Old.ListGraph Old.CmmStmt -> UniqSM (CmmStackInfo, CmmGraph) toZgraph :: Platform -> String -> Old.ListGraph Old.CmmStmt -> UniqSM (CmmStackInfo, CmmGraph)
toZgraph _ (Old.ListGraph []) = toZgraph _ _ (Old.ListGraph []) =
do g <- lgraphOfAGraph emptyAGraph do g <- lgraphOfAGraph emptyAGraph
return (StackInfo {arg_space=0, updfr_space=Nothing}, g) return (StackInfo {arg_space=0, updfr_space=Nothing}, g)
toZgraph fun_name g@(Old.ListGraph (Old.BasicBlock id ss : other_blocks)) = toZgraph platform fun_name g@(Old.ListGraph (Old.BasicBlock id ss : other_blocks)) =
let (offset, entry) = mkCallEntry NativeNodeCall [] in let (offset, entry) = mkCallEntry NativeNodeCall [] in
do g <- labelAGraph id $ do g <- labelAGraph id $
entry <*> mkStmts ss <*> foldr addBlock emptyAGraph other_blocks entry <*> mkStmts ss <*> foldr addBlock emptyAGraph other_blocks
...@@ -64,7 +65,7 @@ toZgraph fun_name g@(Old.ListGraph (Old.BasicBlock id ss : other_blocks)) = ...@@ -64,7 +65,7 @@ toZgraph fun_name g@(Old.ListGraph (Old.BasicBlock id ss : other_blocks)) =
mkStmts (last : []) = mkLast last mkStmts (last : []) = mkLast last
mkStmts [] = bad "fell off end" mkStmts [] = bad "fell off end"
mkStmts (_ : _ : _) = bad "last node not at end" mkStmts (_ : _ : _) = bad "last node not at end"
bad msg = pprPanic (msg ++ " in function " ++ fun_name) (ppr g) bad msg = pprPanic (msg ++ " in function " ++ fun_name) (pprPlatform platform g)
mkLast (Old.CmmCall (Old.CmmCallee f conv) [] args _ Old.CmmNeverReturns) = mkLast (Old.CmmCall (Old.CmmCallee f conv) [] args _ Old.CmmNeverReturns) =
mkFinalCall f conv (map Old.hintlessCmm args) updfr_sz mkFinalCall f conv (map Old.hintlessCmm args) updfr_sz
mkLast (Old.CmmCall (Old.CmmPrim {}) _ _ _ Old.CmmNeverReturns) = mkLast (Old.CmmCall (Old.CmmPrim {}) _ _ _ Old.CmmNeverReturns) =
......
...@@ -11,7 +11,7 @@ module CmmDecl ( ...@@ -11,7 +11,7 @@ module CmmDecl (
CmmInfoTable(..), HasStaticClosure, ClosureTypeInfo(..), ConstrDescription, CmmInfoTable(..), HasStaticClosure, ClosureTypeInfo(..), ConstrDescription,
ProfilingInfo(..), ClosureTypeTag, ProfilingInfo(..), ClosureTypeTag,
CmmActual, CmmFormal, ForeignHint(..), CmmActual, CmmFormal, ForeignHint(..),
CmmStatic(..), Section(..), CmmStatics(..), CmmStatic(..), Section(..),
) where ) where
#include "HsVersions.h" #include "HsVersions.h"
...@@ -55,19 +55,12 @@ newtype GenCmm d h g = Cmm [GenCmmTop d h g] ...@@ -55,19 +55,12 @@ newtype GenCmm d h g = Cmm [GenCmmTop d h g]
data GenCmmTop d h g data GenCmmTop d h g
= CmmProc -- A procedure = CmmProc -- A procedure
h -- Extra header such as the info table h -- Extra header such as the info table
CLabel -- Used to generate both info & entry labels CLabel -- Used to generate both info & entry labels (though the info table label is in 'h' in RawCmmTop)
g -- Control-flow graph for the procedure's code g -- Control-flow graph for the procedure's code
| CmmData -- Static data | CmmData -- Static data
Section Section
[d] d
-- A basic block containing a single label, at the beginning.
-- The list of basic blocks in a top-level code block may be re-ordered.
-- Fall-through is not allowed: there must be an explicit jump at the
-- end of each basic block, but the code generator might rearrange basic
-- blocks in order to turn some jumps into fallthroughs.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -77,12 +70,16 @@ data GenCmmTop d h g ...@@ -77,12 +70,16 @@ data GenCmmTop d h g
-- Info table as a haskell data type -- Info table as a haskell data type
data CmmInfoTable data CmmInfoTable
= CmmInfoTable = CmmInfoTable
LocalInfoTable
HasStaticClosure HasStaticClosure
ProfilingInfo ProfilingInfo
ClosureTypeTag -- Int ClosureTypeTag -- Int
ClosureTypeInfo ClosureTypeInfo
| CmmNonInfoTable -- Procedure doesn't need an info table | CmmNonInfoTable -- Procedure doesn't need an info table
-- | If the table is local, we don't export its identifier even if the corresponding Id is exported.
-- It's always safe to say 'False' here, but it might save symbols to say 'True'
type LocalInfoTable = Bool
type HasStaticClosure = Bool type HasStaticClosure = Bool
-- TODO: The GC target shouldn't really be part of CmmInfo -- TODO: The GC target shouldn't really be part of CmmInfo
...@@ -139,10 +136,7 @@ data CmmStatic ...@@ -139,10 +136,7 @@ data CmmStatic
-- a literal value, size given by cmmLitRep of the literal. -- a literal value, size given by cmmLitRep of the literal.
| CmmUninitialised Int | CmmUninitialised Int
-- uninitialised data, N bytes long -- uninitialised data, N bytes long
| CmmAlign Int
-- align to next N-byte boundary (N must be a power of 2).
| CmmDataLabel CLabel
-- label the current position in this section.
| CmmString [Word8] | CmmString [Word8]
-- string of 8-bit values only, not zero terminated. -- string of 8-bit values only, not zero terminated.
data CmmStatics = Statics CLabel {- Label of statics -} [CmmStatic] {- The static data itself -}
...@@ -28,7 +28,7 @@ import Data.Bits ...@@ -28,7 +28,7 @@ import Data.Bits
-- When we split at proc points, we need an empty info table. -- When we split at proc points, we need an empty info table.
emptyContInfoTable :: CmmInfoTable emptyContInfoTable :: CmmInfoTable
emptyContInfoTable = CmmInfoTable False (ProfilingInfo zero zero) rET_SMALL emptyContInfoTable = CmmInfoTable False False (ProfilingInfo zero zero) rET_SMALL
(ContInfo [] NoC_SRT) (ContInfo [] NoC_SRT)
where zero = CmmInt 0 wordWidth where zero = CmmInt 0 wordWidth
...@@ -78,10 +78,10 @@ mkInfoTable _ (CmmData sec dat) = [CmmData sec dat] ...@@ -78,10 +78,10 @@ mkInfoTable _ (CmmData sec dat) = [CmmData sec dat]
mkInfoTable uniq (CmmProc (CmmInfo _ _ info) entry_label blocks) = mkInfoTable uniq (CmmProc (CmmInfo _ _ info) entry_label blocks) =
case info of case info of
-- Code without an info table. Easy. -- Code without an info table. Easy.
CmmNonInfoTable -> [CmmProc [] entry_label blocks] CmmNonInfoTable -> [CmmProc Nothing entry_label blocks]
CmmInfoTable _ (ProfilingInfo ty_prof cl_prof) type_tag type_info -> CmmInfoTable is_local _ (ProfilingInfo ty_prof cl_prof) type_tag type_info ->
let info_label = entryLblToInfoLbl entry_label let info_label = (if is_local then localiseLabel else id) $ entryLblToInfoLbl entry_label
ty_prof' = makeRelativeRefTo info_label ty_prof ty_prof' = makeRelativeRefTo info_label ty_prof
cl_prof' = makeRelativeRefTo info_label cl_prof cl_prof' = makeRelativeRefTo info_label cl_prof
in case type_info of in case type_info of
...@@ -153,7 +153,7 @@ mkInfoTableAndCode :: CLabel ...@@ -153,7 +153,7 @@ mkInfoTableAndCode :: CLabel
-> [RawCmmTop] -> [RawCmmTop]
mkInfoTableAndCode info_lbl std_info extra_bits entry_lbl blocks mkInfoTableAndCode info_lbl std_info extra_bits entry_lbl blocks
| tablesNextToCode -- Reverse the extra_bits; and emit the top-level proc | tablesNextToCode -- Reverse the extra_bits; and emit the top-level proc
= [CmmProc (map CmmStaticLit (reverse extra_bits ++ std_info)) = [CmmProc (Just (Statics info_lbl $ map CmmStaticLit (reverse extra_bits ++ std_info)))
entry_lbl blocks] entry_lbl blocks]
| ListGraph [] <- blocks -- No code; only the info table is significant | ListGraph [] <- blocks -- No code; only the info table is significant
...@@ -163,7 +163,7 @@ mkInfoTableAndCode info_lbl std_info extra_bits entry_lbl blocks ...@@ -163,7 +163,7 @@ mkInfoTableAndCode info_lbl std_info extra_bits entry_lbl blocks
| otherwise -- Separately emit info table (with the function entry | otherwise -- Separately emit info table (with the function entry
= -- point as first entry) and the entry code = -- point as first entry) and the entry code
[CmmProc [] entry_lbl blocks, [CmmProc Nothing entry_lbl blocks,
mkDataLits info_lbl (CmmLabel entry_lbl : std_info ++ extra_bits)] mkDataLits info_lbl (CmmLabel entry_lbl : std_info ++ extra_bits)]
mkSRTLit :: CLabel mkSRTLit :: CLabel
......
...@@ -23,6 +23,7 @@ import Outputable ...@@ -23,6 +23,7 @@ import Outputable
import OldPprCmm() import OldPprCmm()
import Constants import Constants
import FastString import FastString
import Platform
import Data.Maybe import Data.Maybe
...@@ -30,21 +31,22 @@ import Data.Maybe ...@@ -30,21 +31,22 @@ import Data.Maybe
-- Exported entry points: -- Exported entry points:
cmmLint :: (Outputable d, Outputable h) cmmLint :: (Outputable d, Outputable h)
=> GenCmm d h (ListGraph CmmStmt) -> Maybe SDoc => Platform -> GenCmm d h (ListGraph CmmStmt) -> Maybe SDoc
cmmLint (Cmm tops) = runCmmLint (mapM_ lintCmmTop) tops cmmLint platform (Cmm tops) = runCmmLint platform (mapM_ lintCmmTop) tops
cmmLintTop :: (Outputable d, Outputable h) cmmLintTop :: (Outputable d, Outputable h)
=> GenCmmTop d h (ListGraph CmmStmt) -> Maybe SDoc => Platform -> GenCmmTop d h (ListGraph CmmStmt) -> Maybe SDoc
cmmLintTop top = runCmmLint lintCmmTop top cmmLintTop platform top = runCmmLint platform lintCmmTop top
runCmmLint :: Outputable a => (a -> CmmLint b) -> a -> Maybe SDoc runCmmLint :: PlatformOutputable a
runCmmLint l p = => Platform -> (a -> CmmLint b) -> a -> Maybe SDoc
runCmmLint platform l p =
case unCL (l p) of case unCL (l p) of
Left err -> Just (vcat [ptext $ sLit ("Cmm lint error:"), Left err -> Just (vcat [ptext $ sLit ("Cmm lint error:"),
nest 2 err, nest 2 err,
ptext $ sLit ("Program was:"), ptext $ sLit ("Program was:"),
nest 2 (ppr p)]) nest 2 (pprPlatform platform p)])
Right _ -> Nothing Right _ -> Nothing
lintCmmTop :: (GenCmmTop h i (ListGraph CmmStmt)) -> CmmLint () lintCmmTop :: (GenCmmTop h i (ListGraph CmmStmt)) -> CmmLint ()
lintCmmTop (CmmProc _ lbl (ListGraph blocks)) lintCmmTop (CmmProc _ lbl (ListGraph blocks))
......
...@@ -30,31 +30,13 @@ import Outputable ...@@ -30,31 +30,13 @@ import Outputable
-- MachOp -- MachOp
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
{-
Implementation notes:
It might suffice to keep just a width, without distinguishing between
floating and integer types. However, keeping the distinction will
help the native code generator to assign registers more easily.
-}
{- | {- |
Machine-level primops; ones which we can reasonably delegate to the Machine-level primops; ones which we can reasonably delegate to the
native code generators to handle. Basically contains C's primops native code generators to handle.
and no others.
Most operations are parameterised by the 'Width' that they operate on.
Nomenclature: all ops indicate width and signedness, where Some operations have separate signed and unsigned versions, and float
appropriate. Widths: 8\/16\/32\/64 means the given size, obviously. and integer versions.
Nat means the operation works on STG word sized objects.
Signedness: S means signed, U means unsigned. For operations where
signedness is irrelevant or makes no difference (for example
integer add), the signedness component is omitted.
An exception: NatP is a ptr-typed native word. From the point of
view of the native code generators this distinction is irrelevant,
but the C code generator sometimes needs this info to emit the
right casts.
-} -}
data MachOp data MachOp
......