Commit a08759d1 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

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.
parent 8ed0bdab
......@@ -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
......
#include "Rts.h"
static HsInt GenSymCounter = 0;
HsInt genSym(void) {
return GenSymCounter++;
}
......@@ -99,6 +99,7 @@ Library
c-sources:
ghci/keepCAFsForGHCi.c
cbits/genSym.c
hs-source-dirs:
basicTypes
......
......@@ -13,11 +13,6 @@
#ifndef RTS_UTILS_H
#define RTS_UTILS_H
// Used in GHC (basicTypes/Unique.lhs, and Data.Unique in the base
// package.
HsInt genSymZh(void);
HsInt resetGenSymZh(void);
/* Alternate to raise(3) for threaded rts, for BSD-based OSes */
int genericRaise(int sig);
......
......@@ -1108,7 +1108,6 @@ typedef struct _RtsSymbolVal {
SymI_HasProto(getOrSetSystemTimerThreadIOManagerThreadStore) \
SymI_HasProto(getGCStats) \
SymI_HasProto(getGCStatsEnabled) \
SymI_HasProto(genSymZh) \
SymI_HasProto(genericRaise) \
SymI_HasProto(getProgArgv) \
SymI_HasProto(getFullProgArgv) \
......
......@@ -136,26 +136,6 @@ heapOverflow(void)
}
}
/* -----------------------------------------------------------------------------
genSym stuff, used by GHC itself for its splitting unique supply.
ToDo: put this somewhere sensible.
------------------------------------------------------------------------- */
static HsInt __GenSymCounter = 0;
HsInt
genSymZh(void)
{
return(__GenSymCounter++);
}
HsInt
resetGenSymZh(void) /* it's your funeral */
{
__GenSymCounter=0;
return(__GenSymCounter);
}
/* -----------------------------------------------------------------------------
Get the current time as a string. Used in profiling reports.
-------------------------------------------------------------------------- */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment