X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FGraphOps.hs;h=87e77bfc83b15297de0aaaa007f71194854af07d;hb=c74c72f60dcc4cbea519826e98ec90ad8016b49d;hp=17c14d0925559c91298a8cb96fc14e66ccd9b832;hpb=2d4952d959b3056cff6de9d1663c621d2b4efc70;p=ghc-hetmet.git diff --git a/compiler/utils/GraphOps.hs b/compiler/utils/GraphOps.hs index 17c14d0..87e77bf 100644 --- a/compiler/utils/GraphOps.hs +++ b/compiler/utils/GraphOps.hs @@ -8,7 +8,7 @@ module GraphOps ( union, addConflict, delConflict, addConflicts, addCoalesce, delCoalesce, - addExclusion, + addExclusion, addExclusions, addPreference, coalesceNodes, coalesceGraph, freezeNode, freezeOneInGraph, freezeAllInGraph, @@ -213,6 +213,14 @@ addExclusion u getClass color (newNode u (getClass u)) { nodeExclusions = unitUniqSet color } u +addExclusions + :: (Uniquable k, Uniquable color) + => k -> (k -> cls) -> [color] + -> Graph k cls color -> Graph k cls color + +addExclusions u getClass colors graph + = foldr (addExclusion u getClass) graph colors + -- | Add a coalescence edge to the graph, creating nodes if requried. -- It is considered adventageous to assign the same color to nodes in a coalesence.