projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FIX panic from the GHC API
[ghc-hetmet.git]
/
compiler
/
utils
/
UniqFM.lhs
diff --git
a/compiler/utils/UniqFM.lhs
b/compiler/utils/UniqFM.lhs
index
84294aa
..
bb5b33e
100644
(file)
--- a/
compiler/utils/UniqFM.lhs
+++ b/
compiler/utils/UniqFM.lhs
@@
-1,7
+1,9
@@
-%ilter
+%
+% (c) The University of Glasgow 2006
% (c) The AQUA Project, Glasgow University, 1994-1998
%
% (c) The AQUA Project, Glasgow University, 1994-1998
%
-\section[UniqFM]{Specialised finite maps, for things with @Uniques@}
+
+UniqFM: Specialised finite maps, for things with @Uniques@
Based on @FiniteMaps@ (as you would expect).
Based on @FiniteMaps@ (as you would expect).
@@
-29,6
+31,7
@@
module UniqFM (
plusUFM,
plusUFM_C,
minusUFM,
plusUFM,
plusUFM_C,
minusUFM,
+ intersectsUFM,
intersectUFM,
intersectUFM_C,
foldUFM,
intersectUFM,
intersectUFM_C,
foldUFM,
@@
-51,7
+54,7
@@
import Maybes ( maybeToBool )
import FastTypes
import Outputable
import FastTypes
import Outputable
-import GLAEXTS -- Lots of Int# operations
+import GHC.Exts -- Lots of Int# operations
\end{code}
%************************************************************************
\end{code}
%************************************************************************
@@
-107,6
+110,8
@@
minusUFM :: UniqFM elt1 -> UniqFM elt2 -> UniqFM elt1
intersectUFM :: UniqFM elt -> UniqFM elt -> UniqFM elt
intersectUFM_C :: (elt1 -> elt2 -> elt3)
-> UniqFM elt1 -> UniqFM elt2 -> UniqFM elt3
intersectUFM :: UniqFM elt -> UniqFM elt -> UniqFM elt
intersectUFM_C :: (elt1 -> elt2 -> elt3)
-> UniqFM elt1 -> UniqFM elt2 -> UniqFM elt3
+intersectsUFM :: UniqFM elt1 -> UniqFM elt2 -> Bool
+
foldUFM :: (elt -> a -> a) -> a -> UniqFM elt -> a
mapUFM :: (elt1 -> elt2) -> UniqFM elt1 -> UniqFM elt2
filterUFM :: (elt -> Bool) -> UniqFM elt -> UniqFM elt
foldUFM :: (elt -> a -> a) -> a -> UniqFM elt -> a
mapUFM :: (elt1 -> elt2) -> UniqFM elt1 -> UniqFM elt2
filterUFM :: (elt -> Bool) -> UniqFM elt -> UniqFM elt
@@
-450,7
+455,8
@@
minusUFM fm1 fm2 = minus_trees fm1 fm2
And taking the intersection of two UniqFM's.
\begin{code}
And taking the intersection of two UniqFM's.
\begin{code}
-intersectUFM t1 t2 = intersectUFM_C use_snd t1 t2
+intersectUFM t1 t2 = intersectUFM_C use_snd t1 t2
+intersectsUFM t1 t2 = isNullUFM (intersectUFM_C (\ _ _ -> error "urk") t1 t2)
intersectUFM_C f EmptyUFM _ = EmptyUFM
intersectUFM_C f _ EmptyUFM = EmptyUFM
intersectUFM_C f EmptyUFM _ = EmptyUFM
intersectUFM_C f _ EmptyUFM = EmptyUFM
@@
-821,18
+827,8
@@
shiftR_ :: FastInt -> FastInt -> FastInt
#if __GLASGOW_HASKELL__
{-# INLINE shiftL_ #-}
{-# INLINE shiftR_ #-}
#if __GLASGOW_HASKELL__
{-# INLINE shiftL_ #-}
{-# INLINE shiftR_ #-}
-#if __GLASGOW_HASKELL__ >= 503
shiftL_ n p = word2Int#((int2Word# n) `uncheckedShiftL#` p)
shiftL_ n p = word2Int#((int2Word# n) `uncheckedShiftL#` p)
-#else
-shiftL_ n p = word2Int#((int2Word# n) `shiftL#` p)
-#endif
-shiftR_ n p = word2Int#((int2Word# n) `shiftr` p)
- where
-#if __GLASGOW_HASKELL__ >= 503
- shiftr x y = uncheckedShiftRL# x y
-#else
- shiftr x y = shiftRL# x y
-#endif
+shiftR_ n p = word2Int#((int2Word# n) `uncheckedShiftRL#` p)
#else /* not GHC */
shiftL_ n p = n * (2 ^ p)
#else /* not GHC */
shiftL_ n p = n * (2 ^ p)