X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FGraphBase.hs;h=04eda9612013f94f35b2fe547e2e0caf91fec061;hb=b8a64b8ec9cd3d8f6e3f23e44312c4903eccac45;hp=e3b80c4215392077203924dcb6dd883ac7b4ea58;hpb=17b297d97d327620ed6bfab942f8992b2446f1bf;p=ghc-hetmet.git diff --git a/compiler/nativeGen/GraphBase.hs b/compiler/nativeGen/GraphBase.hs index e3b80c4..04eda96 100644 --- a/compiler/nativeGen/GraphBase.hs +++ b/compiler/nativeGen/GraphBase.hs @@ -1,11 +1,5 @@ -- | Types for the general graph colorer. -{-# OPTIONS_GHC -w #-} --- The above warning supression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings --- for details module GraphBase ( Triv, @@ -22,6 +16,7 @@ where import UniqSet import UniqFM + -- | A fn to check if a node is trivially colorable -- For graphs who's color classes are disjoint then a node is 'trivially colorable' -- when it has less neighbors and exclusions than available colors for that node. @@ -51,7 +46,9 @@ data Graph k cls color -- | All active nodes in the graph. graphMap :: UniqFM (Node k cls color) } + -- | An empty graph. +initGraph :: Graph k cls color initGraph = Graph { graphMap = emptyUFM } @@ -87,7 +84,7 @@ data Node k cls color , nodeConflicts :: UniqSet k -- | Colors that cannot be used by this node. - , nodeExclusions :: UniqSet color + , nodeExclusions :: UniqSet color -- | Colors that this node would prefer to be, in decending order. , nodePreference :: [color] @@ -111,3 +108,4 @@ newNode k cls +