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
  • taimoorzaeem/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
  • rmullanix/ghc
652 results
Show changes
Commits on Source (9)
Showing
with 98 additions and 87 deletions
...@@ -56,13 +56,13 @@ name = Util.globalMVar (value); ...@@ -56,13 +56,13 @@ name = Util.globalMVar (value);
#ifdef DEBUG #ifdef DEBUG
#define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else #define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
#define ASSERT2(e,msg) if (not (e)) then (assertPprPanic __FILE__ __LINE__ (msg)) else #define ASSERT2(e,msg) if (not (e)) then (assertPprPanic __FILE__ __LINE__ (msg)) else
#define WARN( e, msg ) (warnPprTrace (e) __FILE__ __LINE__ (msg)) $ #define WARN( dflags, e, msg ) (warnPprTrace (e) __FILE__ __LINE__ (msg)) $
#else #else
-- We have to actually use all the variables we are given or we may get -- We have to actually use all the variables we are given or we may get
-- unused variable warnings when DEBUG is off. -- unused variable warnings when DEBUG is off.
#define ASSERT(e) if False && (not (e)) then panic "ASSERT" else #define ASSERT(e) if False && (not (e)) then panic "ASSERT" else
#define ASSERT2(e,msg) if False && (const False (e,msg)) then pprPanic "ASSERT2" (msg) else #define ASSERT2(e,msg) if False && (const False (e,msg)) then pprPanic "ASSERT2" (msg) else
#define WARN(e,msg) if False && (e) then pprPanic "WARN" (msg) else #define WARN(dflags,e,msg) if False && (e) then pprPanic (dflags) "WARN" (msg) else
-- Here we deliberately don't use when as Control.Monad might not be imported -- Here we deliberately don't use when as Control.Monad might not be imported
#endif #endif
......
...@@ -72,6 +72,7 @@ module Name ( ...@@ -72,6 +72,7 @@ module Name (
#include "Typeable.h" #include "Typeable.h"
import {-# SOURCE #-} TypeRep( TyThing ) import {-# SOURCE #-} TypeRep( TyThing )
import {-# SOURCE #-} DynFlags (DynFlags)
import OccName import OccName
import Module import Module
...@@ -164,7 +165,7 @@ All built-in syntax is for wired-in things. ...@@ -164,7 +165,7 @@ All built-in syntax is for wired-in things.
\begin{code} \begin{code}
nameUnique :: Name -> Unique nameUnique :: Name -> Unique
nameOccName :: Name -> OccName nameOccName :: Name -> OccName
nameModule :: Name -> Module nameModule :: DynFlags -> Name -> Module
nameSrcLoc :: Name -> SrcLoc nameSrcLoc :: Name -> SrcLoc
nameSrcSpan :: Name -> SrcSpan nameSrcSpan :: Name -> SrcSpan
...@@ -181,7 +182,7 @@ nameSrcSpan name = n_loc name ...@@ -181,7 +182,7 @@ nameSrcSpan name = n_loc name
%************************************************************************ %************************************************************************
\begin{code} \begin{code}
nameIsLocalOrFrom :: Module -> Name -> Bool nameIsLocalOrFrom :: DynFlags -> Module -> Name -> Bool
isInternalName :: Name -> Bool isInternalName :: Name -> Bool
isExternalName :: Name -> Bool isExternalName :: Name -> Bool
isSystemName :: Name -> Bool isSystemName :: Name -> Bool
...@@ -204,14 +205,14 @@ isExternalName _ = False ...@@ -204,14 +205,14 @@ isExternalName _ = False
isInternalName name = not (isExternalName name) isInternalName name = not (isExternalName name)
nameModule name = nameModule_maybe name `orElse` pprPanic "nameModule" (ppr name) nameModule dflags name = nameModule_maybe name `orElse` pprPanic dflags "nameModule" (ppr name)
nameModule_maybe :: Name -> Maybe Module nameModule_maybe :: Name -> Maybe Module
nameModule_maybe (Name { n_sort = External mod}) = Just mod nameModule_maybe (Name { n_sort = External mod}) = Just mod
nameModule_maybe (Name { n_sort = WiredIn mod _ _}) = Just mod nameModule_maybe (Name { n_sort = WiredIn mod _ _}) = Just mod
nameModule_maybe _ = Nothing nameModule_maybe _ = Nothing
nameIsLocalOrFrom from name nameIsLocalOrFrom dflags from name
| isExternalName name = from == nameModule name | isExternalName name = from == nameModule dflags name
| otherwise = True | otherwise = True
isTyVarName :: Name -> Bool isTyVarName :: Name -> Bool
...@@ -220,8 +221,8 @@ isTyVarName name = isTvOcc (nameOccName name) ...@@ -220,8 +221,8 @@ isTyVarName name = isTvOcc (nameOccName name)
isTyConName :: Name -> Bool isTyConName :: Name -> Bool
isTyConName name = isTcOcc (nameOccName name) isTyConName name = isTcOcc (nameOccName name)
isDataConName :: Name -> Bool isDataConName :: DynFlags -> Name -> Bool
isDataConName name = isDataOcc (nameOccName name) isDataConName dflags name = isDataOcc dflags (nameOccName name)
isValName :: Name -> Bool isValName :: Name -> Bool
isValName name = isValOcc (nameOccName name) isValName name = isValOcc (nameOccName name)
...@@ -484,7 +485,9 @@ pprNameLoc name ...@@ -484,7 +485,9 @@ pprNameLoc name
| isGoodSrcSpan loc = pprDefnLoc loc | isGoodSrcSpan loc = pprDefnLoc loc
| isInternalName name || isSystemName name | isInternalName name || isSystemName name
= ptext (sLit "<no location info>") = ptext (sLit "<no location info>")
| otherwise = ptext (sLit "Defined in ") <> ppr (nameModule name) | otherwise = sdocWithDynFlags $ \dflags ->
(ptext (sLit "Defined in ") <>
ppr (nameModule dflags name))
where loc = nameSrcSpan name where loc = nameSrcSpan name
\end{code} \end{code}
......
...@@ -101,6 +101,7 @@ import UniqFM ...@@ -101,6 +101,7 @@ import UniqFM
import UniqSet import UniqSet
import FastString import FastString
import Outputable import Outputable
import {-# SOURCE #-} DynFlags (DynFlags)
import Binary import Binary
import StaticFlags( opt_SuppressUniques ) import StaticFlags( opt_SuppressUniques )
import Data.Char import Data.Char
...@@ -427,7 +428,8 @@ occNameString (OccName _ s) = unpackFS s ...@@ -427,7 +428,8 @@ occNameString (OccName _ s) = unpackFS s
setOccNameSpace :: NameSpace -> OccName -> OccName setOccNameSpace :: NameSpace -> OccName -> OccName
setOccNameSpace sp (OccName _ occ) = OccName sp occ setOccNameSpace sp (OccName _ occ) = OccName sp occ
isVarOcc, isTvOcc, isTcOcc, isDataOcc :: OccName -> Bool isVarOcc, isTvOcc, isTcOcc :: OccName -> Bool
isDataOcc :: DynFlags -> OccName -> Bool
isVarOcc (OccName VarName _) = True isVarOcc (OccName VarName _) = True
isVarOcc _ = False isVarOcc _ = False
...@@ -445,20 +447,20 @@ isValOcc (OccName VarName _) = True ...@@ -445,20 +447,20 @@ isValOcc (OccName VarName _) = True
isValOcc (OccName DataName _) = True isValOcc (OccName DataName _) = True
isValOcc _ = False isValOcc _ = False
isDataOcc (OccName DataName _) = True isDataOcc _ (OccName DataName _) = True
isDataOcc (OccName VarName s) isDataOcc dflags (OccName VarName s)
| isLexCon s = pprPanic "isDataOcc: check me" (ppr s) | isLexCon s = pprPanic dflags "isDataOcc: check me" (ppr s)
-- Jan06: I don't think this should happen -- Jan06: I don't think this should happen
isDataOcc _ = False isDataOcc _ _ = False
-- | Test if the 'OccName' is a data constructor that starts with -- | Test if the 'OccName' is a data constructor that starts with
-- a symbol (e.g. @:@, or @[]@) -- a symbol (e.g. @:@, or @[]@)
isDataSymOcc :: OccName -> Bool isDataSymOcc :: DynFlags -> OccName -> Bool
isDataSymOcc (OccName DataName s) = isLexConSym s isDataSymOcc _ (OccName DataName s) = isLexConSym s
isDataSymOcc (OccName VarName s) isDataSymOcc dflags (OccName VarName s)
| isLexConSym s = pprPanic "isDataSymOcc: check me" (ppr s) | isLexConSym s = pprPanic dflags "isDataSymOcc: check me" (ppr s)
-- Jan06: I don't think this should happen -- Jan06: I don't think this should happen
isDataSymOcc _ = False isDataSymOcc _ _ = False
-- Pretty inefficient! -- Pretty inefficient!
-- | Test if the 'OccName' is that for any operator (whether -- | Test if the 'OccName' is that for any operator (whether
......
...@@ -67,6 +67,7 @@ import SrcLoc ...@@ -67,6 +67,7 @@ import SrcLoc
import FastString import FastString
import Outputable import Outputable
import Util import Util
import {-# SOURCE #-} DynFlags (DynFlags)
import Data.Data import Data.Data
\end{code} \end{code}
...@@ -129,7 +130,7 @@ rdrNameOcc (Exact name) = nameOccName name ...@@ -129,7 +130,7 @@ rdrNameOcc (Exact name) = nameOccName name
rdrNameSpace :: RdrName -> NameSpace rdrNameSpace :: RdrName -> NameSpace
rdrNameSpace = occNameSpace . rdrNameOcc rdrNameSpace = occNameSpace . rdrNameOcc
setRdrNameSpace :: RdrName -> NameSpace -> RdrName setRdrNameSpace :: DynFlags -> RdrName -> NameSpace -> RdrName
-- ^ This rather gruesome function is used mainly by the parser. -- ^ This rather gruesome function is used mainly by the parser.
-- When parsing: -- When parsing:
-- --
...@@ -143,12 +144,12 @@ setRdrNameSpace :: RdrName -> NameSpace -> RdrName ...@@ -143,12 +144,12 @@ setRdrNameSpace :: RdrName -> NameSpace -> RdrName
-- > data [] a = [] | a : [a] -- > data [] a = [] | a : [a]
-- --
-- For the exact-name case we return an original name. -- For the exact-name case we return an original name.
setRdrNameSpace (Unqual occ) ns = Unqual (setOccNameSpace ns occ) setRdrNameSpace _ (Unqual occ) ns = Unqual (setOccNameSpace ns occ)
setRdrNameSpace (Qual m occ) ns = Qual m (setOccNameSpace ns occ) setRdrNameSpace _ (Qual m occ) ns = Qual m (setOccNameSpace ns occ)
setRdrNameSpace (Orig m occ) ns = Orig m (setOccNameSpace ns occ) setRdrNameSpace _ (Orig m occ) ns = Orig m (setOccNameSpace ns occ)
setRdrNameSpace (Exact n) ns = ASSERT( isExternalName n ) setRdrNameSpace dflags (Exact n) ns = ASSERT( isExternalName n )
Orig (nameModule n) Orig (nameModule dflags n)
(setOccNameSpace ns (nameOccName n)) (setOccNameSpace ns (nameOccName n))
\end{code} \end{code}
\begin{code} \begin{code}
...@@ -185,9 +186,9 @@ nameRdrName name = Exact name ...@@ -185,9 +186,9 @@ nameRdrName name = Exact name
-- unique is still there for debug printing, particularly -- unique is still there for debug printing, particularly
-- of Types (which are converted to IfaceTypes before printing) -- of Types (which are converted to IfaceTypes before printing)
nukeExact :: Name -> RdrName nukeExact :: DynFlags -> Name -> RdrName
nukeExact n nukeExact dflags n
| isExternalName n = Orig (nameModule n) (nameOccName n) | isExternalName n = Orig (nameModule dflags n) (nameOccName n)
| otherwise = Unqual (nameOccName n) | otherwise = Unqual (nameOccName n)
\end{code} \end{code}
...@@ -504,17 +505,17 @@ mkGlobalRdrEnv gres ...@@ -504,17 +505,17 @@ mkGlobalRdrEnv gres
(nameOccName (gre_name gre)) (nameOccName (gre_name gre))
gre gre
findLocalDupsRdrEnv :: GlobalRdrEnv -> [OccName] -> (GlobalRdrEnv, [[Name]]) findLocalDupsRdrEnv :: DynFlags -> GlobalRdrEnv -> [OccName] -> (GlobalRdrEnv, [[Name]])
-- ^ For each 'OccName', see if there are multiple local definitions -- ^ For each 'OccName', see if there are multiple local definitions
-- for it. If so, remove all but one (to suppress subsequent error messages) -- for it. If so, remove all but one (to suppress subsequent error messages)
-- and return a list of the duplicate bindings -- and return a list of the duplicate bindings
findLocalDupsRdrEnv rdr_env occs findLocalDupsRdrEnv dflags rdr_env occs
= go rdr_env [] occs = go rdr_env [] occs
where where
go rdr_env dups [] = (rdr_env, dups) go rdr_env dups [] = (rdr_env, dups)
go rdr_env dups (occ:occs) go rdr_env dups (occ:occs)
= case filter isLocalGRE gres of = case filter isLocalGRE gres of
[] -> WARN( True, ppr occ <+> ppr rdr_env ) [] -> WARN( dflags, True, ppr occ <+> ppr rdr_env )
go rdr_env dups occs -- Weird! No binding for occ go rdr_env dups occs -- Weird! No binding for occ
[_] -> go rdr_env dups occs -- The common case [_] -> go rdr_env dups occs -- The common case
dup_gres -> go (extendOccEnv rdr_env occ (head dup_gres : nonlocal_gres)) dup_gres -> go (extendOccEnv rdr_env occ (head dup_gres : nonlocal_gres))
......
...@@ -74,6 +74,7 @@ module SrcLoc ( ...@@ -74,6 +74,7 @@ module SrcLoc (
import Util import Util
import Outputable import Outputable
import FastString import FastString
import {-# SOURCE #-} DynFlags (DynFlags)
import Data.Bits import Data.Bits
import Data.Data import Data.Data
...@@ -127,14 +128,14 @@ srcLocFile (SrcLoc fname _ _) = fname ...@@ -127,14 +128,14 @@ srcLocFile (SrcLoc fname _ _) = fname
srcLocFile _other = (fsLit "<unknown file") srcLocFile _other = (fsLit "<unknown file")
-- | Raises an error when used on a "bad" 'SrcLoc' -- | Raises an error when used on a "bad" 'SrcLoc'
srcLocLine :: SrcLoc -> Int srcLocLine :: DynFlags -> SrcLoc -> Int
srcLocLine (SrcLoc _ l _) = l srcLocLine _ (SrcLoc _ l _) = l
srcLocLine (UnhelpfulLoc s) = pprPanic "srcLocLine" (ftext s) srcLocLine dflags (UnhelpfulLoc s) = pprPanic dflags "srcLocLine" (ftext s)
-- | Raises an error when used on a "bad" 'SrcLoc' -- | Raises an error when used on a "bad" 'SrcLoc'
srcLocCol :: SrcLoc -> Int srcLocCol :: DynFlags -> SrcLoc -> Int
srcLocCol (SrcLoc _ _ c) = c srcLocCol _ (SrcLoc _ _ c) = c
srcLocCol (UnhelpfulLoc s) = pprPanic "srcLocCol" (ftext s) srcLocCol dflags (UnhelpfulLoc s) = pprPanic dflags "srcLocCol" (ftext s)
-- | Move the 'SrcLoc' down by one line if the character is a newline, -- | Move the 'SrcLoc' down by one line if the character is a newline,
-- to the next 8-char tabstop if it is a tab, and across by one -- to the next 8-char tabstop if it is a tab, and across by one
...@@ -256,19 +257,19 @@ srcLocSpan (UnhelpfulLoc str) = UnhelpfulSpan str ...@@ -256,19 +257,19 @@ srcLocSpan (UnhelpfulLoc str) = UnhelpfulSpan str
srcLocSpan (SrcLoc file line col) = SrcSpanPoint file line col srcLocSpan (SrcLoc file line col) = SrcSpanPoint file line col
-- | Create a 'SrcSpan' between two points in a file -- | Create a 'SrcSpan' between two points in a file
mkSrcSpan :: SrcLoc -> SrcLoc -> SrcSpan mkSrcSpan :: DynFlags -> SrcLoc -> SrcLoc -> SrcSpan
mkSrcSpan (UnhelpfulLoc str) _ = UnhelpfulSpan str mkSrcSpan _ (UnhelpfulLoc str) _ = UnhelpfulSpan str
mkSrcSpan _ (UnhelpfulLoc str) = UnhelpfulSpan str mkSrcSpan _ _ (UnhelpfulLoc str) = UnhelpfulSpan str
mkSrcSpan loc1 loc2 mkSrcSpan dflags loc1 loc2
| line1 == line2 = if col1 == col2 | line1 == line2 = if col1 == col2
then SrcSpanPoint file line1 col1 then SrcSpanPoint file line1 col1
else SrcSpanOneLine file line1 col1 col2 else SrcSpanOneLine file line1 col1 col2
| otherwise = SrcSpanMultiLine file line1 col1 line2 col2 | otherwise = SrcSpanMultiLine file line1 col1 line2 col2
where where
line1 = srcLocLine loc1 line1 = srcLocLine dflags loc1
line2 = srcLocLine loc2 line2 = srcLocLine dflags loc2
col1 = srcLocCol loc1 col1 = srcLocCol dflags loc1
col2 = srcLocCol loc2 col2 = srcLocCol dflags loc2
file = srcLocFile loc1 file = srcLocFile loc1
-- | Combines two 'SrcSpan' into one that spans at least all the characters -- | Combines two 'SrcSpan' into one that spans at least all the characters
......
...@@ -76,6 +76,7 @@ import Util ...@@ -76,6 +76,7 @@ import Util
import FastTypes import FastTypes
import FastString import FastString
import Outputable import Outputable
import DynFlags
import Data.Data import Data.Data
\end{code} \end{code}
...@@ -272,9 +273,9 @@ mkTcTyVar name kind details ...@@ -272,9 +273,9 @@ mkTcTyVar name kind details
tc_tv_details = details tc_tv_details = details
} }
tcTyVarDetails :: TyVar -> TcTyVarDetails tcTyVarDetails :: DynFlags -> TyVar -> TcTyVarDetails
tcTyVarDetails (TcTyVar { tc_tv_details = details }) = details tcTyVarDetails _ (TcTyVar { tc_tv_details = details }) = details
tcTyVarDetails var = pprPanic "tcTyVarDetails" (ppr var) tcTyVarDetails dflags var = pprPanic dflags "tcTyVarDetails" (ppr var)
setTcTyVarDetails :: TyVar -> TcTyVarDetails -> TyVar setTcTyVarDetails :: TyVar -> TcTyVarDetails -> TyVar
setTcTyVarDetails tv details = tv { tc_tv_details = details } setTcTyVarDetails tv details = tv { tc_tv_details = details }
......
...@@ -19,6 +19,7 @@ where ...@@ -19,6 +19,7 @@ where
import Constants import Constants
import FastString import FastString
import Outputable import Outputable
import DynFlags
import Data.Word import Data.Word
import Data.Int import Data.Int
...@@ -197,14 +198,14 @@ widthInBytes W64 = 8 ...@@ -197,14 +198,14 @@ widthInBytes W64 = 8
widthInBytes W128 = 16 widthInBytes W128 = 16
widthInBytes W80 = 10 widthInBytes W80 = 10
widthFromBytes :: Int -> Width widthFromBytes :: DynFlags -> Int -> Width
widthFromBytes 1 = W8 widthFromBytes _ 1 = W8
widthFromBytes 2 = W16 widthFromBytes _ 2 = W16
widthFromBytes 4 = W32 widthFromBytes _ 4 = W32
widthFromBytes 8 = W64 widthFromBytes _ 8 = W64
widthFromBytes 16 = W128 widthFromBytes _ 16 = W128
widthFromBytes 10 = W80 widthFromBytes _ 10 = W80
widthFromBytes n = pprPanic "no width for given number of bytes" (ppr n) widthFromBytes dflags n = pprPanic dflags "no width for given number of bytes" (ppr n)
-- log_2 of the width in bytes, useful for generating shifts. -- log_2 of the width in bytes, useful for generating shifts.
widthInLog :: Width -> Int widthInLog :: Width -> Int
......
...@@ -81,7 +81,7 @@ pprCs dflags cmms ...@@ -81,7 +81,7 @@ pprCs dflags cmms
writeCs :: DynFlags -> Handle -> [RawCmm] -> IO () writeCs :: DynFlags -> Handle -> [RawCmm] -> IO ()
writeCs dflags handle cmms writeCs dflags handle cmms
= printForC handle (pprCs dflags cmms) = printForC dflags handle (pprCs dflags cmms)
-- -------------------------------------------------------------------------- -- --------------------------------------------------------------------------
-- Now do some real work -- Now do some real work
...@@ -775,10 +775,10 @@ pprReg r = case r of ...@@ -775,10 +775,10 @@ pprReg r = case r of
CmmLocal local -> pprLocalReg local CmmLocal local -> pprLocalReg local
CmmGlobal global -> pprGlobalReg global CmmGlobal global -> pprGlobalReg global
pprAsPtrReg :: CmmReg -> SDoc pprAsPtrReg :: DynFlags -> CmmReg -> SDoc
pprAsPtrReg (CmmGlobal (VanillaReg n gcp)) pprAsPtrReg dflags (CmmGlobal (VanillaReg n gcp))
= WARN( gcp /= VGcPtr, ppr n ) char 'R' <> int n <> ptext (sLit ".p") = WARN( dflags, gcp /= VGcPtr, ppr n ) char 'R' <> int n <> ptext (sLit ".p")
pprAsPtrReg other_reg = pprReg other_reg pprAsPtrReg _ other_reg = pprReg other_reg
pprGlobalReg :: GlobalReg -> SDoc pprGlobalReg :: GlobalReg -> SDoc
pprGlobalReg gr = case gr of pprGlobalReg gr = case gr of
......
...@@ -44,6 +44,7 @@ import PprCmmExpr ...@@ -44,6 +44,7 @@ import PprCmmExpr
import Outputable import Outputable
import FastString import FastString
import DynFlags
import Data.List import Data.List
import System.IO import System.IO
...@@ -59,8 +60,8 @@ pprCmms cmms = pprCode CStyle (vcat (intersperse separator $ map ppr cmms)) ...@@ -59,8 +60,8 @@ pprCmms cmms = pprCode CStyle (vcat (intersperse separator $ map ppr cmms))
where where
separator = space $$ ptext (sLit "-------------------") $$ space separator = space $$ ptext (sLit "-------------------") $$ space
writeCmms :: (Outputable info, Outputable g) => Handle -> [GenCmm CmmStatic info g] -> IO () writeCmms :: (Outputable info, Outputable g) => DynFlags -> Handle -> [GenCmm CmmStatic info g] -> IO ()
writeCmms handle cmms = printForC handle (pprCmms cmms) writeCmms dflags handle cmms = printForC dflags handle (pprCmms cmms)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
......
...@@ -211,7 +211,7 @@ mkStackLayout = do ...@@ -211,7 +211,7 @@ mkStackLayout = do
[(offset - frame_sp - retAddrSizeW, b) [(offset - frame_sp - retAddrSizeW, b)
| (offset, b) <- binds] | (offset, b) <- binds]
WARN( not (all (\bind -> fst bind >= 0) rel_binds), WARN( dflags, not (all (\bind -> fst bind >= 0) rel_binds),
ppr binds $$ ppr rel_binds $$ ppr binds $$ ppr rel_binds $$
ppr frame_size $$ ppr real_sp $$ ppr frame_sp ) ppr frame_size $$ ppr real_sp $$ ppr frame_sp )
return $ stack_layout rel_binds frame_size return $ stack_layout rel_binds frame_size
......
...@@ -636,7 +636,7 @@ getCallMethod _ _ _ (LFUnknown True) _ ...@@ -636,7 +636,7 @@ getCallMethod _ _ _ (LFUnknown True) _
getCallMethod _ name _ (LFUnknown False) n_args getCallMethod _ name _ (LFUnknown False) n_args
| n_args > 0 | n_args > 0
= WARN( True, ppr name <+> ppr n_args ) = WARN( dflags, True, ppr name <+> ppr n_args )
SlowCall -- Note [Unsafe coerce complications] SlowCall -- Note [Unsafe coerce complications]
| otherwise | otherwise
......
...@@ -776,7 +776,7 @@ mkEtaWW orig_n orig_expr in_scope orig_ty ...@@ -776,7 +776,7 @@ mkEtaWW orig_n orig_expr in_scope orig_ty
| otherwise -- We have an expression of arity > 0, | otherwise -- We have an expression of arity > 0,
-- but its type isn't a function. -- but its type isn't a function.
= WARN( True, (ppr orig_n <+> ppr orig_ty) $$ ppr orig_expr ) = WARN( dflags, True, (ppr orig_n <+> ppr orig_ty) $$ ppr orig_expr )
(getTvInScope subst, reverse eis) (getTvInScope subst, reverse eis)
-- This *can* legitmately happen: -- This *can* legitmately happen:
-- e.g. coerce Int (\x. x) Essentially the programmer is -- e.g. coerce Int (\x. x) Essentially the programmer is
......
...@@ -363,7 +363,7 @@ cpePair top_lvl is_rec is_strict_or_unlifted env bndr rhs ...@@ -363,7 +363,7 @@ cpePair top_lvl is_rec is_strict_or_unlifted env bndr rhs
; (floats3, rhs') ; (floats3, rhs')
<- if manifestArity rhs1 <= arity <- if manifestArity rhs1 <= arity
then return (floats2, cpeEtaExpand arity rhs2) then return (floats2, cpeEtaExpand arity rhs2)
else WARN(True, text "CorePrep: silly extra arguments:" <+> ppr bndr) else WARN(dflags, True, text "CorePrep: silly extra arguments:" <+> ppr bndr)
-- Note [Silly extra arguments] -- Note [Silly extra arguments]
(do { v <- newVar (idType bndr) (do { v <- newVar (idType bndr)
; let float = mkFloat False False v rhs2 ; let float = mkFloat False False v rhs2
......
...@@ -251,7 +251,7 @@ lookupIdSubst doc (Subst in_scope ids _ _) v ...@@ -251,7 +251,7 @@ lookupIdSubst doc (Subst in_scope ids _ _) v
| Just e <- lookupVarEnv ids v = e | Just e <- lookupVarEnv ids v = e
| Just v' <- lookupInScope in_scope v = Var v' | Just v' <- lookupInScope in_scope v = Var v'
-- Vital! See Note [Extending the Subst] -- Vital! See Note [Extending the Subst]
| otherwise = WARN( True, ptext (sLit "CoreSubst.lookupIdSubst") <+> ppr v $$ ppr in_scope $$ doc) | otherwise = WARN( dflags, True, ptext (sLit "CoreSubst.lookupIdSubst") <+> ppr v $$ ppr in_scope $$ doc)
Var v Var v
-- | Find the substitution for a 'TyVar' in the 'Subst' -- | Find the substitution for a 'TyVar' in the 'Subst'
...@@ -645,13 +645,13 @@ substUnfoldingSource (Subst in_scope ids _ _) (InlineWrapper wkr) ...@@ -645,13 +645,13 @@ substUnfoldingSource (Subst in_scope ids _ _) (InlineWrapper wkr)
| Just wkr_expr <- lookupVarEnv ids wkr | Just wkr_expr <- lookupVarEnv ids wkr
= case wkr_expr of = case wkr_expr of
Var w1 -> InlineWrapper w1 Var w1 -> InlineWrapper w1
_other -> -- WARN( True, text "Interesting! CoreSubst.substWorker1:" <+> ppr wkr _other -> -- WARN( dflags, True, text "Interesting! CoreSubst.substWorker1:" <+> ppr wkr
-- <+> ifPprDebug (equals <+> ppr wkr_expr) ) -- <+> ifPprDebug (equals <+> ppr wkr_expr) )
-- Note [Worker inlining] -- Note [Worker inlining]
InlineStable -- It's not a wrapper any more, but still inline it! InlineStable -- It's not a wrapper any more, but still inline it!
| Just w1 <- lookupInScope in_scope wkr = InlineWrapper w1 | Just w1 <- lookupInScope in_scope wkr = InlineWrapper w1
| otherwise = -- WARN( True, text "Interesting! CoreSubst.substWorker2:" <+> ppr wkr ) | otherwise = -- WARN( dflags, True, text "Interesting! CoreSubst.substWorker2:" <+> ppr wkr )
-- This can legitimately happen. The worker has been inlined and -- This can legitimately happen. The worker has been inlined and
-- dropped as dead code, because we don't treat the UnfoldingSource -- dropped as dead code, because we don't treat the UnfoldingSource
-- as an "occurrence". -- as an "occurrence".
......
...@@ -821,7 +821,7 @@ cmpAltCon (DataAlt _) DEFAULT = GT ...@@ -821,7 +821,7 @@ cmpAltCon (DataAlt _) DEFAULT = GT
cmpAltCon (LitAlt l1) (LitAlt l2) = l1 `compare` l2 cmpAltCon (LitAlt l1) (LitAlt l2) = l1 `compare` l2
cmpAltCon (LitAlt _) DEFAULT = GT cmpAltCon (LitAlt _) DEFAULT = GT
cmpAltCon con1 con2 = WARN( True, text "Comparing incomparable AltCons" <+> cmpAltCon con1 con2 = WARN( dflags, True, text "Comparing incomparable AltCons" <+>
ppr con1 <+> ppr con2 ) ppr con1 <+> ppr con2 )
LT LT
\end{code} \end{code}
......
...@@ -210,7 +210,7 @@ mkCoerce co expr ...@@ -210,7 +210,7 @@ mkCoerce co expr
-- if to_ty `eqType` from_ty -- if to_ty `eqType` from_ty
-- then expr -- then expr
-- else -- else
WARN(not (from_ty `eqType` exprType expr), text "Trying to coerce" <+> text "(" <> ppr expr $$ text "::" <+> ppr (exprType expr) <> text ")" $$ ppr co $$ pprEqPred (coercionKind co)) WARN(dflags, not (from_ty `eqType` exprType expr), text "Trying to coerce" <+> text "(" <> ppr expr $$ text "::" <+> ppr (exprType expr) <> text ")" $$ ppr co $$ pprEqPred (coercionKind co))
(Cast expr co) (Cast expr co)
\end{code} \end{code}
...@@ -1223,10 +1223,10 @@ hash_expr env (Let (NonRec b r) e) = hash_expr (extend_env env b) e * fast_ha ...@@ -1223,10 +1223,10 @@ hash_expr env (Let (NonRec b r) e) = hash_expr (extend_env env b) e * fast_ha
hash_expr env (Let (Rec ((b,_):_)) e) = hash_expr (extend_env env b) e hash_expr env (Let (Rec ((b,_):_)) e) = hash_expr (extend_env env b) e
hash_expr env (Case e _ _ _) = hash_expr env e hash_expr env (Case e _ _ _) = hash_expr env e
hash_expr env (Lam b e) = hash_expr (extend_env env b) e hash_expr env (Lam b e) = hash_expr (extend_env env b) e
hash_expr _ (Type _) = WARN(True, text "hash_expr: type") 1 hash_expr _ (Type _) = WARN(dflags, True, text "hash_expr: type") 1
-- Shouldn't happen. Better to use WARN than trace, because trace -- Shouldn't happen. Better to use WARN than trace, because trace
-- prevents the CPR optimisation kicking in for hash_expr. -- prevents the CPR optimisation kicking in for hash_expr.
hash_expr _ (Coercion _) = WARN(True, text "hash_expr: coercion") 1 hash_expr _ (Coercion _) = WARN(dflags, True, text "hash_expr: coercion") 1
fast_hash_expr :: HashEnv -> CoreExpr -> Word32 fast_hash_expr :: HashEnv -> CoreExpr -> Word32
fast_hash_expr env (Var v) = hashVar env v fast_hash_expr env (Var v) = hashVar env v
......
...@@ -128,7 +128,7 @@ addCoverageTicksToBinds dflags mod mod_loc tyCons binds = ...@@ -128,7 +128,7 @@ addCoverageTicksToBinds dflags mod mod_loc tyCons binds =
} }
doIfSet_dyn dflags Opt_D_dump_hpc $ do doIfSet_dyn dflags Opt_D_dump_hpc $ do
printDump (pprLHsBinds binds1) printDump dflags (pprLHsBinds binds1)
return (binds1, HpcInfo (tickBoxCount st) hashNo, modBreaks) return (binds1, HpcInfo (tickBoxCount st) hashNo, modBreaks)
\end{code} \end{code}
......
...@@ -58,7 +58,8 @@ pprintClosureCommand bindThings force str = do ...@@ -58,7 +58,8 @@ pprintClosureCommand bindThings force str = do
-- Finally, print the Terms -- Finally, print the Terms
unqual <- GHC.getPrintUnqual unqual <- GHC.getPrintUnqual
docterms <- mapM showTerm terms docterms <- mapM showTerm terms
liftIO $ (printForUser stdout unqual . vcat) dflags <- getSessionDynFlags
liftIO $ (printForUser dflags stdout unqual . vcat)
(zipWith (\id docterm -> ppr id <+> char '=' <+> docterm) (zipWith (\id docterm -> ppr id <+> char '=' <+> docterm)
ids ids
docterms) docterms)
...@@ -162,7 +163,7 @@ showTerm term = do ...@@ -162,7 +163,7 @@ showTerm term = do
-- XXX: this tries to disable logging of errors -- XXX: this tries to disable logging of errors
-- does this still do what it is intended to do -- does this still do what it is intended to do
-- with the changed error handling and logging? -- with the changed error handling and logging?
let noop_log _ _ _ _ = return () let noop_log _ _ _ _ _ = return ()
expr = "show " ++ showSDoc (ppr bname) expr = "show " ++ showSDoc (ppr bname)
_ <- GHC.setSessionDynFlags dflags{log_action=noop_log} _ <- GHC.setSessionDynFlags dflags{log_action=noop_log}
txt_ <- withExtendedLinkEnv [(bname, val)] txt_ <- withExtendedLinkEnv [(bname, val)]
...@@ -225,4 +226,4 @@ pprTypeAndContents ids = do ...@@ -225,4 +226,4 @@ pprTypeAndContents ids = do
traceOptIf :: GhcMonad m => DynFlag -> SDoc -> m () traceOptIf :: GhcMonad m => DynFlag -> SDoc -> m ()
traceOptIf flag doc = do traceOptIf flag doc = do
dflags <- GHC.getSessionDynFlags dflags <- GHC.getSessionDynFlags
when (dopt flag dflags) $ liftIO $ printForUser stderr alwaysQualify doc when (dopt flag dflags) $ liftIO $ printForUser dflags stderr alwaysQualify doc
...@@ -331,13 +331,13 @@ filterNameMap mods env ...@@ -331,13 +331,13 @@ filterNameMap mods env
\begin{code} \begin{code}
-- | Display the persistent linker state. -- | Display the persistent linker state.
showLinkerState :: IO () showLinkerState :: DynFlags -> IO ()
showLinkerState showLinkerState dflags
= do pls <- readMVar v_PersistentLinkerState = do pls <- readMVar v_PersistentLinkerState
printDump (vcat [text "----- Linker state -----", printDump dflags (vcat [text "----- Linker state -----",
text "Pkgs:" <+> ppr (pkgs_loaded pls), text "Pkgs:" <+> ppr (pkgs_loaded pls),
text "Objs:" <+> ppr (objs_loaded pls), text "Objs:" <+> ppr (objs_loaded pls),
text "BCOs:" <+> ppr (bcos_loaded pls)]) text "BCOs:" <+> ppr (bcos_loaded pls)])
\end{code} \end{code}
......
...@@ -67,7 +67,7 @@ readBinIface_ :: DynFlags -> CheckHiWay -> TraceBinIFaceReading -> FilePath ...@@ -67,7 +67,7 @@ readBinIface_ :: DynFlags -> CheckHiWay -> TraceBinIFaceReading -> FilePath
readBinIface_ dflags checkHiWay traceBinIFaceReading hi_path update_nc = do readBinIface_ dflags checkHiWay traceBinIFaceReading hi_path update_nc = do
let printer :: SDoc -> IO () let printer :: SDoc -> IO ()
printer = case traceBinIFaceReading of printer = case traceBinIFaceReading of
TraceBinIFaceReading -> \sd -> printSDoc sd defaultDumpStyle TraceBinIFaceReading -> \sd -> printSDoc dflags sd defaultDumpStyle
QuietBinIFaceReading -> \_ -> return () QuietBinIFaceReading -> \_ -> return ()
wantedGot :: Outputable a => String -> a -> a -> IO () wantedGot :: Outputable a => String -> a -> a -> IO ()
wantedGot what wanted got wantedGot what wanted got
......