summaryrefslogtreecommitdiff
path: root/compiler/utils/Util.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/Util.hs')
-rw-r--r--compiler/utils/Util.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs
index 5c09959f6d..30026c5016 100644
--- a/compiler/utils/Util.hs
+++ b/compiler/utils/Util.hs
@@ -164,6 +164,10 @@ import qualified Data.Set as Set
import Data.Time
+#ifdef DEBUG
+import {-# SOURCE #-} Outputable ( warnPprTrace, text )
+#endif
+
infixr 9 `thenCmp`
{-
@@ -558,7 +562,7 @@ isIn msg x ys
elem100 :: Eq a => Int -> a -> [a] -> Bool
elem100 _ _ [] = False
elem100 i x (y:ys)
- | i > 100 = trace ("Over-long elem in " ++ msg) (x `elem` (y:ys))
+ | i > 100 = WARN(True, text ("Over-long elem in " ++ msg)) (x `elem` (y:ys))
| otherwise = x == y || elem100 (i + 1) x ys
isn'tIn msg x ys
@@ -567,7 +571,7 @@ isn'tIn msg x ys
notElem100 :: Eq a => Int -> a -> [a] -> Bool
notElem100 _ _ [] = True
notElem100 i x (y:ys)
- | i > 100 = trace ("Over-long notElem in " ++ msg) (x `notElem` (y:ys))
+ | i > 100 = WARN(True, text ("Over-long notElem in " ++ msg)) (x `notElem` (y:ys))
| otherwise = x /= y && notElem100 (i + 1) x ys
# endif /* DEBUG */