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
  • nikshalark/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
  • gulin.serge/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
  • fp/ghc
  • zaquest/ghc
  • fangyi-zhou/ghc
  • augyg/ghc
640 results
Show changes
Commits on Source (20)
Showing
with 106 additions and 133 deletions
......@@ -2928,25 +2928,10 @@ genSwitch expr targets = do
let op = OpAddr (AddrBaseIndex (EABaseReg tableReg)
(EAIndex reg (platformWordSizeInBytes platform)) (ImmInt 0))
offsetReg <- getNewRegNat (intFormat (platformWordWidth platform))
return $ if is32bit || os == OSDarwin
then e_code `appOL` t_code `appOL` toOL [
return $ e_code `appOL` t_code `appOL` toOL [
ADD (intFormat (platformWordWidth platform)) op (OpReg tableReg),
JMP_TBL (OpReg tableReg) ids rosection lbl
]
else -- HACK: On x86_64 binutils<2.17 is only able to generate
-- PC32 relocations, hence we only get 32-bit offsets in
-- the jump table. As these offsets are always negative
-- we need to properly sign extend them to 64-bit. This
-- hack should be removed in conjunction with the hack in
-- PprMach.hs/pprDataItem once binutils 2.17 is standard.
e_code `appOL` t_code `appOL` toOL [
MOVSxL II32 op (OpReg offsetReg),
ADD (intFormat (platformWordWidth platform))
(OpReg offsetReg)
(OpReg tableReg),
JMP_TBL (OpReg tableReg) ids rosection lbl
]
else do
(reg,e_code) <- getSomeReg indexExpr
lbl <- getNewLabelNat
......
......@@ -532,29 +532,7 @@ pprDataItem config lit
<> int (fromIntegral
(fromIntegral (x `shiftR` 32) :: Word32))]
_ -> panic "X86.Ppr.ppr_item: no match for II64"
| otherwise ->
[text "\t.quad\t" <> pprImm platform imm]
_
| target32Bit platform ->
[text "\t.quad\t" <> pprImm platform imm]
| otherwise ->
-- x86_64: binutils can't handle the R_X86_64_PC64
-- relocation type, which means we can't do
-- pc-relative 64-bit addresses. Fortunately we're
-- assuming the small memory model, in which all such
-- offsets will fit into 32 bits, so we have to stick
-- to 32-bit offset fields and modify the RTS
-- appropriately
--
-- See Note [x86-64-relative] in rts/include/rts/storage/InfoTables.h
--
case lit of
-- A relative relocation:
CmmLabelDiffOff _ _ _ _ ->
[text "\t.long\t" <> pprImm platform imm,
text "\t.long\t0"]
_ ->
[text "\t.quad\t" <> pprImm platform imm]
_ -> [text "\t.quad\t" <> pprImm platform imm]
asmComment :: SDoc -> SDoc
......
......@@ -867,7 +867,7 @@ hscRecompStatus
-- If missing object code, just say we need to recompile because of object code.
(_, OutOfDateItem reason _) -> OutOfDateItem reason Nothing
-- If just missing byte code, just use the object code
-- so you should use -fprefer-byte-code with -fwrite-if-simplfied-core or you'll
-- so you should use -fprefer-byte-code with -fwrite-if-simplified-core or you'll
-- end up using bytecode on recompilation
(_, UpToDateItem {} ) -> just_o
......@@ -876,7 +876,7 @@ hscRecompStatus
-- If missing object code, just say we need to recompile because of object code.
(_, OutOfDateItem reason _) -> OutOfDateItem reason Nothing
-- If just missing byte code, just use the object code
-- so you should use -fprefer-byte-code with -fwrite-if-simplfied-core or you'll
-- so you should use -fprefer-byte-code with -fwrite-if-simplified-core or you'll
-- end up using bytecode on recompilation
(OutOfDateItem reason _, _ ) -> OutOfDateItem reason Nothing
......@@ -1129,7 +1129,7 @@ hscDesugarAndSimplify summary (FrontendTypecheck tc_result) tc_warnings mb_old_h
return $ HscUpdate iface
-- We are not generating code or writing an interface with simplfied core so we can skip simplification
-- We are not generating code or writing an interface with simplified core so we can skip simplification
-- and generate a simple interface.
_ -> do
(iface, _details) <- liftIO $
......
......@@ -3481,7 +3481,7 @@ fFlagsDeps = [
flagSpec "strictness" Opt_Strictness,
flagSpec "use-rpaths" Opt_RPath,
flagSpec "write-interface" Opt_WriteInterface,
flagSpec "write-if-simplfied-core" Opt_WriteIfSimplifiedCore,
flagSpec "write-if-simplified-core" Opt_WriteIfSimplifiedCore,
flagSpec "write-ide-info" Opt_WriteHie,
flagSpec "unbox-small-strict-fields" Opt_UnboxSmallStrictFields,
flagSpec "unbox-strict-fields" Opt_UnboxStrictFields,
......
......@@ -3489,6 +3489,8 @@ bindTyClTyVars tycon_name thing_inside
bindTyClTyVarsAndZonk :: Name -> ([TyConBinder] -> Kind -> TcM a) -> TcM a
-- Like bindTyClTyVars, but in addition
-- zonk the skolem TcTyVars of a PolyTcTyCon to TyVars
-- We always do this same zonking after a call to bindTyClTyVars, but
-- here we do it right away because there are no more unifications to come
bindTyClTyVarsAndZonk tycon_name thing_inside
= bindTyClTyVars tycon_name $ \ tc_bndrs tc_kind ->
do { ze <- mkEmptyZonkEnv NoFlexi
......
......@@ -411,21 +411,27 @@ TcTyCons are used for two distinct purposes
2. When checking a type/class declaration (in module GHC.Tc.TyCl), we come
upon knowledge of the eventual tycon in bits and pieces, and we use
a TcTyCon to record what we know before we are ready to build the
final TyCon.
final TyCon. Here is the plan:
We first build a MonoTcTyCon, then generalise to a PolyTcTyCon
See Note [TcTyCon, MonoTcTyCon, and PolyTcTyCon] in GHC.Tc.Utils.TcType
Specifically:
Step 1 (inferInitialKinds, inference only, skipped for checking):
Make a MonoTcTyCon whose binders are TcTyVars,
which may contain free unification variables
S1) In kcTyClGroup, we use checkInitialKinds to get the
utterly-final Kind of all TyCons in the group that
(a) have a kind signature or
(b) have a CUSK.
This produces a PolyTcTyCon, that is, a TcTyCon in which the binders
and result kind are full of TyVars (not TcTyVars). No unification
variables here; everything is in its final form.
Step 2 (generaliseTcTyCon)
Generalise that MonoTcTyCon to make a PolyTcTyCon
Its binders are skolem TcTyVars, with accurate SkolemInfo
Step 3 (tcTyClDecl)
Typecheck the type and class decls to produce a final TyCon
Its binders are final TyVars, not TcTyVars
Note that a MonoTcTyCon can contain unification variables,
but a PolyTcTyCon does not: only skolem TcTyVars. See
Note [TcTyCon, MonoTcTyCon, and PolyTcTyCon] in GHC.Tc.Utils.TcType
More details about /kind inference/:
S2) In kcTyClGroup, we use inferInitialKinds to look over the
S1) In kcTyClGroup, we use inferInitialKinds to look over the
declaration of any TyCon that lacks a kind signature or
CUSK, to determine its "shape"; for example, the number of
parameters, and any kind signatures.
......@@ -434,27 +440,30 @@ TcTyCons are used for two distinct purposes
"mono" because it has not been been generalised, and its binders
and result kind may have free unification variables.
S3) Still in kcTyClGroup, we use kcLTyClDecl to kind-check the
S2) Still in kcTyClGroup, we use kcLTyClDecl to kind-check the
body (class methods, data constructors, etc.) of each of
these MonoTcTyCons, which has the effect of filling in the
metavariables in the tycon's initial kind.
S4) Still in kcTyClGroup, we use generaliseTyClDecl to generalize
each MonoTcTyCon to get a PolyTcTyCon, with final TyVars in it,
S3) Still in kcTyClGroup, we use generaliseTyClDecl to generalize
each MonoTcTyCon to get a PolyTcTyCon, with skolem TcTyVars in it,
and a final, fixed kind.
S5) Finally, back in TcTyClDecls, we extend the environment with
S4) Finally, back in TcTyClDecls, we extend the environment with
the PolyTcTyCons, and typecheck each declaration (regardless
of kind signatures etc) to get final TyCon.
These TcTyCons are stored in the local environment in GHC.Tc.TyCl,
until the real full TyCons can be created during desugaring. A
desugared program should never have a TcTyCon.
More details about /kind checking/
3. A MonoTcTyCon can contain unification variables, but a PolyTcTyCon
does not: only skolem TcTyVars.
S5) In kcTyClGroup, we use checkInitialKinds to get the
utterly-final Kind of all TyCons in the group that
(a) have a separate kind signature or
(b) have a CUSK.
This produces a PolyTcTyCon, that is, a TcTyCon in which the binders
and result kind are full of TyVars (not TcTyVars). No unification
variables here; everything is in its final form.
4. tyConScopedTyVars. A challenging piece in all of this is that we
3. tyConScopedTyVars. A challenging piece in all of this is that we
end up taking three separate passes over every declaration:
- one in inferInitialKind (this pass look only at the head, not the body)
- one in kcTyClDecls (to kind-check the body)
......@@ -2425,15 +2434,15 @@ tcClassDecl1 :: RolesInfo -> Name -> Maybe (LHsContext GhcRn)
-> TcM Class
tcClassDecl1 roles_info class_name hs_ctxt meths fundeps sigs ats at_defs
= fixM $ \ clas -> -- We need the knot because 'clas' is passed into tcClassATs
bindTyClTyVars class_name $ \ binders res_kind ->
bindTyClTyVars class_name $ \ tc_bndrs res_kind ->
do { checkClassKindSig res_kind
; traceTc "tcClassDecl 1" (ppr class_name $$ ppr binders)
; traceTc "tcClassDecl 1" (ppr class_name $$ ppr tc_bndrs)
; let tycon_name = class_name -- We use the same name
roles = roles_info tycon_name -- for TyCon and Class
; (ctxt, fds, sig_stuff, at_stuff)
<- pushLevelAndSolveEqualities skol_info binders $
-- The (binderVars binders) is needed bring into scope the
<- pushLevelAndSolveEqualities skol_info tc_bndrs $
-- The (binderVars tc_bndrs) is needed bring into scope the
-- skolems bound by the class decl header (#17841)
do { ctxt <- tcHsContext hs_ctxt
; fds <- mapM (addLocMA tc_fundep) fundeps
......@@ -2458,9 +2467,10 @@ tcClassDecl1 roles_info class_name hs_ctxt meths fundeps sigs ats at_defs
-- any unfilled coercion variables unless there is such an error
-- The zonk also squeeze out the TcTyCons, and converts
-- Skolems to tyvars.
; ze <- mkEmptyZonkEnv NoFlexi
; ctxt <- zonkTcTypesToTypesX ze ctxt
; sig_stuff <- mapM (zonkTcMethInfoToMethInfoX ze) sig_stuff
; ze <- mkEmptyZonkEnv NoFlexi
; (ze, bndrs) <- zonkTyVarBindersX ze tc_bndrs -- From TcTyVars to TyVars
; ctxt <- zonkTcTypesToTypesX ze ctxt
; sig_stuff <- mapM (zonkTcMethInfoToMethInfoX ze) sig_stuff
-- ToDo: do we need to zonk at_stuff?
-- TODO: Allow us to distinguish between abstract class,
......@@ -2482,8 +2492,8 @@ tcClassDecl1 roles_info class_name hs_ctxt meths fundeps sigs ats at_defs
| otherwise
= Just (ctxt, at_stuff, sig_stuff, mindef)
; clas <- buildClass class_name binders roles fds body
; traceTc "tcClassDecl" (ppr fundeps $$ ppr binders $$
; clas <- buildClass class_name bndrs roles fds body
; traceTc "tcClassDecl" (ppr fundeps $$ ppr bndrs $$
ppr fds)
; return clas }
where
......@@ -2712,7 +2722,7 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
, fdResultSig = L _ sig
, fdInjectivityAnn = inj })
| DataFamily <- fam_info
= bindTyClTyVarsAndZonk tc_name $ \ binders res_kind -> do
= bindTyClTyVarsAndZonk tc_name $ \ tc_bndrs res_kind -> do
{ traceTc "tcFamDecl1 data family:" (ppr tc_name)
; checkFamFlag tc_name
......@@ -2729,8 +2739,8 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
-- See also Note [Datatype return kinds]
; checkDataKindSig DataFamilySort res_kind
; tc_rep_name <- newTyConRepName tc_name
; let inj = Injective $ replicate (length binders) True
tycon = mkFamilyTyCon tc_name binders
; let inj = Injective $ replicate (length tc_bndrs) True
tycon = mkFamilyTyCon tc_name tc_bndrs
res_kind
(resultVariableName sig)
(DataFamilyTyCon tc_rep_name)
......@@ -2738,12 +2748,12 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
; return tycon }
| OpenTypeFamily <- fam_info
= bindTyClTyVarsAndZonk tc_name $ \ binders res_kind -> do
= bindTyClTyVarsAndZonk tc_name $ \ tc_bndrs res_kind -> do
{ traceTc "tcFamDecl1 open type family:" (ppr tc_name)
; checkFamFlag tc_name
; inj' <- tcInjectivity binders inj
; inj' <- tcInjectivity tc_bndrs inj
; checkResultSigFlag tc_name sig -- check after injectivity for better errors
; let tycon = mkFamilyTyCon tc_name binders res_kind
; let tycon = mkFamilyTyCon tc_name tc_bndrs res_kind
(resultVariableName sig) OpenSynFamilyTyCon
parent inj'
; return tycon }
......@@ -2754,10 +2764,10 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
do { traceTc "tcFamDecl1 Closed type family:" (ppr tc_name)
-- the variables in the header scope only over the injectivity
-- declaration but this is not involved here
; (inj', binders, res_kind)
<- bindTyClTyVarsAndZonk tc_name $ \ binders res_kind ->
do { inj' <- tcInjectivity binders inj
; return (inj', binders, res_kind) }
; (inj', tc_bndrs, res_kind)
<- bindTyClTyVarsAndZonk tc_name $ \ tc_bndrs res_kind ->
do { inj' <- tcInjectivity tc_bndrs inj
; return (inj', tc_bndrs, res_kind) }
; checkFamFlag tc_name -- make sure we have -XTypeFamilies
; checkResultSigFlag tc_name sig
......@@ -2766,14 +2776,14 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
-- but eqns might be empty in the Just case as well
; case mb_eqns of
Nothing ->
return $ mkFamilyTyCon tc_name binders res_kind
return $ mkFamilyTyCon tc_name tc_bndrs res_kind
(resultVariableName sig)
AbstractClosedSynFamilyTyCon parent
inj'
Just eqns -> do {
-- Process the equations, creating CoAxBranches
; let tc_fam_tc = mkTcTyCon tc_name binders res_kind
; let tc_fam_tc = mkTcTyCon tc_name tc_bndrs res_kind
noTcTyConScopedTyVars
False {- this doesn't matter here -}
ClosedTypeFamilyFlavour
......@@ -2792,7 +2802,7 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
| null eqns = Nothing -- mkBranchedCoAxiom fails on empty list
| otherwise = Just (mkBranchedCoAxiom co_ax_name fam_tc branches)
fam_tc = mkFamilyTyCon tc_name binders res_kind (resultVariableName sig)
fam_tc = mkFamilyTyCon tc_name tc_bndrs res_kind (resultVariableName sig)
(ClosedSynFamilyTyCon mb_co_ax) parent inj'
-- We check for instance validity later, when doing validity
......@@ -2853,10 +2863,10 @@ tcInjectivity tcbs (Just (L loc (InjectivityAnn _ _ lInjNames)))
tcTySynRhs :: RolesInfo -> Name
-> LHsType GhcRn -> TcM TyCon
tcTySynRhs roles_info tc_name hs_ty
= bindTyClTyVars tc_name $ \ binders res_kind ->
= bindTyClTyVars tc_name $ \ tc_bndrs res_kind ->
do { env <- getLclEnv
; traceTc "tc-syn" (ppr tc_name $$ ppr (tcl_env env))
; rhs_ty <- pushLevelAndSolveEqualities skol_info binders $
; rhs_ty <- pushLevelAndSolveEqualities skol_info tc_bndrs $
tcCheckLHsType hs_ty (TheKind res_kind)
-- See Note [Error on unconstrained meta-variables] in GHC.Tc.Utils.TcMType
......@@ -2870,11 +2880,11 @@ tcTySynRhs roles_info tc_name hs_ty
, ppr rhs_ty ] ) }
; doNotQuantifyTyVars dvs mk_doc
; ze <- mkEmptyZonkEnv NoFlexi
; (ze, binders) <- zonkTyVarBindersX ze binders
; rhs_ty <- zonkTcTypeToTypeX ze rhs_ty
; ze <- mkEmptyZonkEnv NoFlexi
; (ze, bndrs) <- zonkTyVarBindersX ze tc_bndrs
; rhs_ty <- zonkTcTypeToTypeX ze rhs_ty
; let roles = roles_info tc_name
; return (buildSynTyCon tc_name binders res_kind roles rhs_ty) }
; return (buildSynTyCon tc_name bndrs res_kind roles rhs_ty) }
where
skol_info = TyConSkol TypeSynonymFlavour tc_name
......
......@@ -1735,12 +1735,6 @@ quantifyTyVars skol_info ns_strat dvs
= return Nothing -- this can happen for a covar that's associated with
-- a coercion hole. Test case: typecheck/should_compile/T2494
-- Omit: no TyVars now
-- | not (isTcTyVar tkv)
-- = return (Just tkv) -- For associated types in a class with a standalone
-- -- kind signature, we have the class variables in
-- -- scope, and they are TyVars not TcTyVars
| otherwise
= Just <$> skolemiseQuantifiedTyVar skol_info tkv
......@@ -1785,13 +1779,19 @@ skolemiseQuantifiedTyVar :: SkolemInfo -> TcTyVar -> TcM TcTyVar
skolemiseQuantifiedTyVar skol_info tv
= case tcTyVarDetails tv of
SkolemTv {} -> do { kind <- zonkTcType (tyVarKind tv)
; return (setTyVarKind tv kind) }
-- It might be a skolem type variable,
-- for example from a user type signature
MetaTv {} -> skolemiseUnboundMetaTyVar skol_info tv
SkolemTv _ lvl _ -- It might be a skolem type variable,
-- for example from a user type signature
-- But it might also be a shared meta-variable across several
-- type declarations, each with its own skol_info. The first
-- will skolemise it, but the other uses must update its
-- skolem info (#22379)
-> do { kind <- zonkTcType (tyVarKind tv)
; let details = SkolemTv skol_info lvl False
name = tyVarName tv
; return (mkTcTyVar name kind details) }
_other -> pprPanic "skolemiseQuantifiedTyVar" (ppr tv) -- RuntimeUnk
-- | Default a type variable using the given defaulting strategy.
......
......@@ -428,7 +428,7 @@ Invariants:
- Flag tcTyConIsPoly = True; this is used only to short-cut zonking
- tyConBinders are still TcTyConBinders, but they are /skolem/ TcTyVars,
with fixed kinds: no unification variables here
with fixed kinds, and accurate skolem info: no unification variables here
tyConBinders includes the Inferred binders if any
......
......@@ -979,17 +979,13 @@ cvtl e = wrapLA (cvt e)
l' <- cvt_lit l
let e' = mk_expr l'
if is_compound_lit l' then wrapParLA gHsPar e' else pure e'
cvt (AppE x@(LamE _ _) y) = do { x' <- cvtl x; y' <- cvtl y
; return $ HsApp noComments (mkLHsPar x')
(mkLHsPar y')}
cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y
; return $ HsApp noComments (mkLHsPar x')
(mkLHsPar y')}
cvt (AppTypeE e t) = do { e' <- cvtl e
; t' <- cvtType t
; let tp = parenthesizeHsType appPrec t'
cvt (AppE e1 e2) = do { e1' <- parenthesizeHsExpr opPrec <$> cvtl e1
; e2' <- parenthesizeHsExpr appPrec <$> cvtl e2
; return $ HsApp noComments e1' e2' }
cvt (AppTypeE e t) = do { e' <- parenthesizeHsExpr opPrec <$> cvtl e
; t' <- parenthesizeHsType appPrec <$> cvtType t
; return $ HsAppType noExtField e' noHsTok
$ mkHsWildCardBndrs tp }
$ mkHsWildCardBndrs t' }
cvt (LamE [] e) = cvt e -- Degenerate case. We convert the body as its
-- own expression to avoid pretty-printing
-- oddities that can result from zero-argument
......
......@@ -37,6 +37,7 @@ module GHC.Unit.Env
, addHomeModInfoToHug
-- * UnitEnvGraph
, UnitEnvGraph (..)
, UnitEnvGraphKey
, unitEnv_insert
, unitEnv_delete
, unitEnv_adjust
......
......@@ -34,7 +34,7 @@ The lifecycle of a WholeCoreBindings typically proceeds as follows:
3. Then when bytecode is needed, the LoadedBCOs value is inspected and unpacked and
the linkable is used as before.
The flag `-fwrite-if-simplfied-core` determines whether the extra information is written
The flag `-fwrite-if-simplified-core` determines whether the extra information is written
to an interface file. The program which is written is the core bindings of the module
after whatever simplification the user requested has been performed. So the simplified core bindings
of the interface file agree with the optimisation level as reported by the interface
......@@ -43,7 +43,7 @@ file.
Note [Size of Interface Files with Core Definitions]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How much overhead does `-fwrite-if-simplfied-core` add to a typical interface file?
How much overhead does `-fwrite-if-simplified-core` add to a typical interface file?
As an experiment I compiled the `Cabal` library and `ghc` library (Aug 22) with
| Project | .hi | .hi (fat) | .o |
......
......@@ -641,7 +641,7 @@ Options affecting code generation
useful if you want to type check over multiple runs of GHC without
compiling dependencies.
.. ghc-flag:: -fwrite-if-simplfied-core
.. ghc-flag:: -fwrite-if-simplified-core
:shortdesc: Write an interface file containing the simplified core of the module.
:type: dynamic
:category: codegen
......@@ -679,9 +679,9 @@ Options affecting code generation
:category: codegen
Generate object code and byte-code. This is useful with the flags
:ghc-flag:`-fprefer-byte-code` and :ghc-flag:`-fwrite-if-simplfied-core`.
:ghc-flag:`-fprefer-byte-code` and :ghc-flag:`-fwrite-if-simplified-core`.
This flag implies :ghc-flag:`-fwrite-if-simplfied-core`.
This flag implies :ghc-flag:`-fwrite-if-simplified-core`.
:ghc-flag:`-fbyte-code` and :ghc-flag:`-fobject-code` disable this flag as
they specify that GHC should *only* write object code or byte-code respectively.
......@@ -787,7 +787,7 @@ Options affecting code generation
and object file (if that's available) to evaluate and run TH splices.
This is useful with flags such as :ghc-flag:`-fbyte-code-and-object-code`, which
tells the compiler to generate byte-code, and :ghc-flag:`-fwrite-if-simplfied-core` which
tells the compiler to generate byte-code, and :ghc-flag:`-fwrite-if-simplified-core` which
allows byte-code to be generated from an interface file.
This flag also interacts with :ghc-flag:`-fno-code`, if this flag is enabled
......
......@@ -132,9 +132,10 @@ type family MultMul (a :: Multiplicity) (b :: Multiplicity) :: Multiplicity wher
********************************************************************* -}
-- | (Kind) This is the kind of type-level symbols.
-- Declared here because class IP needs it
data Symbol
-- Symbol is declared here because class IP needs it
{- *********************************************************************
* *
Any
......
......@@ -98,7 +98,7 @@ void handleCloneStackMessage(MessageCloneStack *msg){
#else // !defined(THREADED_RTS)
GNU_ATTRIBUTE(__noreturn__)
STG_NORETURN
void sendCloneStackMessage(StgTSO *tso STG_UNUSED, HsStablePtr mvar STG_UNUSED) {
barf("Sending CloneStackMessages is only available in threaded RTS!");
}
......
......@@ -278,7 +278,7 @@ StgMutArrPtrs *heap_view_closurePtrs(Capability *cap, StgClosure *closure) {
for (StgWord i = 0; i<nptrs; i++) {
arr->payload[i] = ptrs[i];
}
free(ptrs);
stgFree(ptrs);
return arr;
}
......@@ -45,7 +45,7 @@ HpcModuleInfo *modules = 0;
static char *tixFilename = NULL;
static void GNU_ATTRIBUTE(__noreturn__)
static void STG_NORETURN
failure(char *msg) {
debugTrace(DEBUG_hpc,"hpc failure: %s\n",msg);
fprintf(stderr,"Hpc failure: %s\n",msg);
......
......@@ -1971,7 +1971,7 @@ void * loadNativeObj (pathchar *path, char **errmsg)
return r;
}
#else
void * GNU_ATTRIBUTE(__noreturn__)
void * STG_NORETURN
loadNativeObj (pathchar *path, char **errmsg)
{
UNUSED(path);
......
......@@ -862,7 +862,7 @@ void rts_listMiscRoots (ListRootsCb cb, void *user)
}
#else
PauseToken GNU_ATTRIBUTE(__noreturn__)
PauseToken STG_NORETURN
*rts_pause (void)
{
errorBelch("Warning: Pausing the RTS is only possible for "
......@@ -870,7 +870,7 @@ PauseToken GNU_ATTRIBUTE(__noreturn__)
stg_exit(EXIT_FAILURE);
}
void GNU_ATTRIBUTE(__noreturn__)
void STG_NORETURN
rts_resume (PauseToken *pauseToken STG_UNUSED)
{
errorBelch("Warning: Resuming the RTS is only possible for "
......
......@@ -119,7 +119,7 @@ static bool read_heap_profiling_flag(const char *arg);
static void read_trace_flags(const char *arg);
#endif
static void errorUsage (void) GNU_ATTRIBUTE(__noreturn__);
static void errorUsage (void) STG_NORETURN;
#if defined(mingw32_HOST_OS)
static char** win32_full_utf8_argv;
......@@ -2421,7 +2421,7 @@ static void read_trace_flags(const char *arg)
}
#endif
static void GNU_ATTRIBUTE(__noreturn__)
static void STG_NORETURN
bad_option(const char *s)
{
errorBelch("bad RTS option: %s", s);
......
......@@ -139,7 +139,7 @@ isGUIApp(void)
}
#endif
void GNU_ATTRIBUTE(__noreturn__)
void STG_NORETURN
rtsFatalInternalErrorFn(const char *s, va_list ap)
{
#if defined(mingw32_HOST_OS)
......@@ -322,7 +322,7 @@ rtsDebugMsgFn(const char *s, va_list ap)
// Used in stg_badAlignment_entry defined in StgStartup.cmm.
void rtsBadAlignmentBarf(void) GNUC3_ATTRIBUTE(__noreturn__);
void rtsBadAlignmentBarf(void) STG_NORETURN;
void
rtsBadAlignmentBarf()
......@@ -331,7 +331,7 @@ rtsBadAlignmentBarf()
}
// Used by code generator
void rtsOutOfBoundsAccess(void) GNUC3_ATTRIBUTE(__noreturn__);
void rtsOutOfBoundsAccess(void) STG_NORETURN;
void
rtsOutOfBoundsAccess()
......