X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FGraphBase.hs;h=04eda9612013f94f35b2fe547e2e0caf91fec061;hb=295d2a0018243d94a7bd4e72d88d056db32ff3cf;hp=efc59b947859d1c68b63e1bdcb8016047facb77f;hpb=0f7d268d00795a58a06ae3c92ebbd14571295b84;p=ghc-hetmet.git diff --git a/compiler/nativeGen/GraphBase.hs b/compiler/nativeGen/GraphBase.hs index efc59b9..04eda96 100644 --- a/compiler/nativeGen/GraphBase.hs +++ b/compiler/nativeGen/GraphBase.hs @@ -1,5 +1,6 @@ -- | Types for the general graph colorer. + module GraphBase ( Triv, Graph (..), @@ -15,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. @@ -44,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 } @@ -80,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] @@ -104,3 +108,4 @@ newNode k cls +