summaryrefslogtreecommitdiff
path: root/compiler/utils/GraphOps.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/GraphOps.hs')
-rw-r--r--compiler/utils/GraphOps.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/utils/GraphOps.hs b/compiler/utils/GraphOps.hs
index 17c14d0925..87e77bfc83 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.