Switch more uniqFromSupply+splitUniqSupply's to takeUniqFromSupply
[ghc-hetmet.git] / compiler / nativeGen / RegAlloc / Graph / Spill.hs
index d82e8a8..7e744e6 100644 (file)
@@ -292,12 +292,11 @@ type SpillM a     = State SpillS a
 
 newUnique :: SpillM Unique
 newUnique
- = do  us      <- gets stateUS
-       case splitUniqSupply us of
-        (us1, us2)
-         -> do let uniq = uniqFromSupply us1
-               modify $ \s -> s { stateUS = us2 }
-               return uniq
+ = do   us      <- gets stateUS
+        case takeUniqFromSupply us of
+         (uniq, us')
+          -> do modify $ \s -> s { stateUS = us' }
+                return uniq
 
 accSpillSL (r1, s1, l1) (_, s2, l2)
        = (r1, s1 + s2, l1 + l2)