summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-05-17 16:50:08 +0100
committerIan Lynagh <ian@well-typed.com>2013-05-17 16:50:08 +0100
commita08759d165ca1a0cfe9ada26f6ea6b9a38ad8853 (patch)
tree2043ea39590b0780e4e9443be680108b3bc325f5 /compiler
parent8ed0bdab7e69bfec14b1de2d662349626f587119 (diff)
downloadhaskell-a08759d165ca1a0cfe9ada26f6ea6b9a38ad8853.tar.gz
Move the genSym stuff from rts into compiler
It's no longer used by Data.Unique, so there's no need to have it in rts any more.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/basicTypes/UniqSupply.lhs4
-rw-r--r--compiler/cbits/genSym.c9
-rw-r--r--compiler/ghc.cabal.in1
3 files changed, 12 insertions, 2 deletions
diff --git a/compiler/basicTypes/UniqSupply.lhs b/compiler/basicTypes/UniqSupply.lhs
index f3fb28ac21..fb07e73824 100644
--- a/compiler/basicTypes/UniqSupply.lhs
+++ b/compiler/basicTypes/UniqSupply.lhs
@@ -81,7 +81,7 @@ mkSplitUniqSupply c
-- This is one of the most hammered bits in the whole compiler
mk_supply
= unsafeDupableInterleaveIO (
- genSymZh >>= \ u_ -> case iUnbox u_ of { u -> (
+ genSym >>= \ u_ -> case iUnbox u_ of { u -> (
mk_supply >>= \ s1 ->
mk_supply >>= \ s2 ->
return (MkSplitUniqSupply (mask `bitOrFastInt` u) s1 s2)
@@ -89,7 +89,7 @@ mkSplitUniqSupply c
in
mk_supply
-foreign import ccall unsafe "genSymZh" genSymZh :: IO Int
+foreign import ccall unsafe "genSym" genSym :: IO Int
splitUniqSupply (MkSplitUniqSupply _ s1 s2) = (s1, s2)
listSplitUniqSupply (MkSplitUniqSupply _ s1 s2) = s1 : listSplitUniqSupply s2
diff --git a/compiler/cbits/genSym.c b/compiler/cbits/genSym.c
new file mode 100644
index 0000000000..2d9779b898
--- /dev/null
+++ b/compiler/cbits/genSym.c
@@ -0,0 +1,9 @@
+
+#include "Rts.h"
+
+static HsInt GenSymCounter = 0;
+
+HsInt genSym(void) {
+ return GenSymCounter++;
+}
+
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 7ce0a52fa1..90a241f8d4 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -99,6 +99,7 @@ Library
c-sources:
ghci/keepCAFsForGHCi.c
+ cbits/genSym.c
hs-source-dirs:
basicTypes