summaryrefslogtreecommitdiff
path: root/compiler/utils/Digraph.lhs
Commit message (Collapse)AuthorAgeFilesLines
* utils: detabify/dewhitespace DigraphAustin Seipp2014-07-201-43/+36
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix discarding of unreachable code in the register allocator (#9155)Simon Marlow2014-06-061-20/+12
| | | | | | | A previous fix to this was wrong: f5879acd018494b84233f26fba828ce376d0f81d and left some unreachable code behind. So rather than try to be clever and do this at the same time as the strongly-connected-component analysis, I'm doing a separate reachability pass first.
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-2/+2
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-011-1/+1
|
* Discard unreachable code in the register allocator (#7574)Simon Marlow2013-09-231-5/+25
| | | | | | | | | | | | | | | | | | | The problem with unreachable code is that it might refer to undefined registers. This happens accidentally: a block can be orphaned by an optimisation, for example when the result of a comparsion becomes known. The register allocator panics when it finds an undefined register, because they shouldn't occur in generated code. So we need to also discard unreachable code to prevent this panic being triggered by optimisations. The register alloator already does a strongly-connected component analysis, so it ought to be easy to make it discard unreachable code as part of that traversal. It turns out that we need a different variant of the scc algorithm to do that (see Digraph), however the new variant also generates slightly better code by putting the blocks within a loop in a better order for register allocation.
* Remove some uses of sortLeIan Lynagh2012-06-221-4/+4
| | | | | | Technically the behaviour of sortWith has changed, as it used x `le` y = get_key x < get_key y (note "<" rather than "<="), but I assume that that was just a mistake.
* Remove PlatformOutputableIan Lynagh2012-06-131-3/+0
| | | | | We can now get the Platform from the DynFlags inside an SDoc, so we no longer need to pass the Platform in.
* Remove Show instance for ForestSimon Peyton Jones2012-03-281-6/+0
| | | | | | | | | A Forest is just a list, and we have a Show instance for lists already. We don't need a special Show instance for Forests. If we change our minds we can add a newtype, but I don't think it's worth it. Fixes Trac #5960
* Use -fwarn-tabs when validatingIan Lynagh2011-11-041-0/+7
| | | | | We only use it for "compiler" sources, i.e. not for libraries. Many modules have a -fno-warn-tabs kludge for now.
* rewrite branchChainElim; other refactoring in CmmContFlowOptSimon Marlow2011-08-251-1/+7
|
* Implement a findCycle function in Digraph,Simon Peyton Jones2011-07-221-8/+77
| | | | | | | | | | | | | | and use it to report module loops nicely This fixes Trac #5307. Now we get Module imports form a cycle: module `M8' (.\M8.hs) imports `M1' (M1.hs) which imports `M9' (.\M9.hs-boot) which imports `M8' (.\M8.hs) And the algorithm is linear time.
* More work towards cross-compilationIan Lynagh2011-07-151-0/+3
| | | | | | | | | | | | There's now a variant of the Outputable class that knows what platform we're targetting: class PlatformOutputable a where pprPlatform :: Platform -> a -> SDoc pprPlatformPrec :: Platform -> Rational -> a -> SDoc and various instances have had to be converted to use that class, and we pass Platform around accordingly.
* Remove code that is dead now that we need >= 6.12 to buildIan Lynagh2010-12-151-5/+0
|
* Super-monster patch implementing the new typechecker -- at lastsimonpj@microsoft.com2010-09-131-1/+1
| | | | | | | | | This major patch implements the new OutsideIn constraint solving algorithm in the typecheker, following our JFP paper "Modular type inference with local assumptions". Done with major help from Dimitrios Vytiniotis and Brent Yorgey.
* Move allM to MonadUtilsMax Bolingbroke2008-08-071-4/+1
|
* Add more functionality to Digraph and refactor it's interface somewhat, ↵Max Bolingbroke2008-07-311-137/+299
| | | | including adding a Graph ADT
* Don't import FastString in HsVersions.hIan Lynagh2008-03-291-2/+0
| | | | Modules that need it import it themselves instead.
* Fixed warnings in utils/DigraphTwan van Laarhoven2008-01-261-17/+15
|
* lots of portability changes (#1405)Isaac Dupree2008-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | re-recording to avoid new conflicts was too hard, so I just put it all in one big patch :-( (besides, some of the changes depended on each other.) Here are what the component patches were: Fri Dec 28 11:02:55 EST 2007 Isaac Dupree <id@isaac.cedarswampstudios.org> * document BreakArray better Fri Dec 28 11:39:22 EST 2007 Isaac Dupree <id@isaac.cedarswampstudios.org> * properly ifdef BreakArray for GHCI Fri Jan 4 13:50:41 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * change ifs on __GLASGOW_HASKELL__ to account for... (#1405) for it not being defined. I assume it being undefined implies a compiler with relatively modern libraries but without most unportable glasgow extensions. Fri Jan 4 14:21:21 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * MyEither-->EitherString to allow Haskell98 instance Fri Jan 4 16:13:29 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * re-portabilize Pretty, and corresponding changes Fri Jan 4 17:19:55 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * Augment FastTypes to be much more complete Fri Jan 4 20:14:19 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * use FastFunctions, cleanup FastString slightly Fri Jan 4 21:00:22 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * Massive de-"#", mostly Int# --> FastInt (#1405) Fri Jan 4 21:02:49 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * miscellaneous unnecessary-extension-removal Sat Jan 5 19:30:13 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * add FastFunctions
* Comments onlysimonpj@microsoft.com2008-01-161-0/+10
|
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-041-1/+1
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-031-2/+2
| | | | | | | Older GHCs can't parse OPTIONS_GHC. This also changes the URL referenced for the -w options from WorkingConventions#Warnings to CodingStyle#Warnings for the compiler modules.
* Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modulesIan Lynagh2007-09-011-0/+7
|
* Optimise Digraph.postOrd, used when finding strongly connected componentsIan Lynagh2007-08-161-8/+8
|
* Replace _scc_'s in the GHC source with SCC pragmasIan Lynagh2007-08-161-2/+2
|
* Cosmetic changes onlyIan Lynagh2007-08-151-81/+82
|
* Remove code that is dead, as we require __GLASGOW_HASKELL__ >= 504Ian Lynagh2007-04-061-14/+3
|
* Module header tidyup #2Simon Marlow2006-10-111-8/+10
| | | | Push this further along, and fix build problems in the first patch.
* Fix Array importsEsa Ilari Vuokko2006-08-091-1/+3
|
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+426
Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.