globalmaphack: be more general (fmap, factoring, ...)
[mate.git] / Mate / RegisterAllocation.hs
index 9fc43ae51d5a4deeb6de6e3ba994e70ae8cfa7dc..249840a43af1386ba664a738e797d9995f3eea3e 100644 (file)
@@ -1,5 +1,9 @@
+{-# LANGUAGE CPP #-}
 module Mate.RegisterAllocation where
 
+
+#include "debug.h"
+
 import Data.List
 import Data.Maybe
 
@@ -23,9 +27,10 @@ edgeEq (from,to) (from',to') = from == from' && to == to'
 -- TODO: find combinator do match try semantics here
 -- Solution: use list because list is MonadPlus instance
 -- other solution add maybe monadplus implementation
-conflicts (IGraph xs) (label,anotherLabel) = let comparison  = edgeEq (label,anotherLabel)
-                                                 comparison' = edgeEq (anotherLabel,label) 
-                                             in isJust (find comparison xs) || isJust (find comparison' xs) 
+conflicts (IGraph xs) (label,anotherLabel) =
+  let comparison  = edgeEq (label,anotherLabel)
+      comparison' = edgeEq (anotherLabel,label)
+  in isJust (find comparison xs) || isJust (find comparison' xs)
 
 
 isParticipiant label (from,to) = from == label || to == label
@@ -35,7 +40,7 @@ count p = length . filter p
 degree g@(IGraph xs) label = count (isParticipiant label) xs
 
 
-doChaitin81 :: (Eq a) => IArchitecture -> (IGraph a) -> [Assignment a]
+doChaitin81 :: (Eq a) => IArchitecture -> IGraph a -> [Assignment a]
 doChaitin81 numberOfRegisters graph = []
 
 type IState a = ([a],IGraph a)