summaryrefslogtreecommitdiff
path: root/compiler/utils/FastString.lhs
diff options
context:
space:
mode:
authorNicolas Frisby <nicolas.frisby@gmail.com>2013-07-03 18:23:54 -0500
committerNicolas Frisby <nicolas.frisby@gmail.com>2013-07-03 18:23:54 -0500
commit163de25813d12764aa5ded1666af7c06fee0d67e (patch)
tree7e1a2f5684f1d5edc55608af5209bc932cee1000 /compiler/utils/FastString.lhs
parenta5b7ee5fc26ac322e7dc79de96e478cde819640c (diff)
downloadhaskell-163de25813d12764aa5ded1666af7c06fee0d67e.tar.gz
include FastString.string_table in CoreMonad.reinitializeGlobals
Diffstat (limited to 'compiler/utils/FastString.lhs')
-rw-r--r--compiler/utils/FastString.lhs15
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/utils/FastString.lhs b/compiler/utils/FastString.lhs
index 36b1b1e63e..0bdf0a04c4 100644
--- a/compiler/utils/FastString.lhs
+++ b/compiler/utils/FastString.lhs
@@ -91,7 +91,10 @@ module FastString
unpackLitString,
-- ** Operations
- lengthLS
+ lengthLS,
+
+ -- * Saving/restoring globals
+ saveFSTable, restoreFSTable, FastStringTable
) where
#include "HsVersions.h"
@@ -573,4 +576,14 @@ fsLit x = mkFastString x
forall x . sLit (unpackCString# x) = mkLitString# x #-}
{-# RULES "fslit"
forall x . fsLit (unpackCString# x) = mkFastString# x #-}
+
+
+--------------------
+-- for plugins; see Note [Initializing globals] in CoreMonad
+
+saveFSTable :: IO FastStringTable
+saveFSTable = readIORef string_table
+
+restoreFSTable :: FastStringTable -> IO ()
+restoreFSTable = writeIORef string_table
\end{code}