diff options
Diffstat (limited to 'compiler/main/DynamicLoading.hs')
-rw-r--r-- | compiler/main/DynamicLoading.hs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/compiler/main/DynamicLoading.hs b/compiler/main/DynamicLoading.hs index 64cc0a1216..ea09a8ceb5 100644 --- a/compiler/main/DynamicLoading.hs +++ b/compiler/main/DynamicLoading.hs @@ -3,7 +3,6 @@ -- | Dynamically lookup up values from modules and loading them. module DynamicLoading ( initializePlugins, -#if defined(HAVE_INTERPRETER) -- * Loading plugins loadFrontendPlugin, @@ -19,15 +18,11 @@ module DynamicLoading ( getValueSafely, getHValueSafely, lessUnsafeCoerce -#else - pluginError -#endif ) where import GhcPrelude import DynFlags -#if defined(HAVE_INTERPRETER) import Linker ( linkModule, getHValue ) import GHCi ( wormhole ) import SrcLoc ( noSrcSpan ) @@ -60,28 +55,11 @@ import Control.Monad ( when, unless ) import Data.Maybe ( mapMaybe ) import GHC.Exts ( unsafeCoerce# ) -#else - -import HscTypes ( HscEnv ) -import Module ( ModuleName, moduleNameString ) -import Panic - -import Data.List ( intercalate ) -import Control.Monad ( unless ) - -#endif - -- | Loads the plugins specified in the pluginModNames field of the dynamic -- flags. Should be called after command line arguments are parsed, but before -- actual compilation starts. Idempotent operation. Should be re-called if -- pluginModNames or pluginModNameOpts changes. initializePlugins :: HscEnv -> DynFlags -> IO DynFlags -#if !defined(HAVE_INTERPRETER) -initializePlugins _ df - = do let pluginMods = pluginModNames df - unless (null pluginMods) (pluginError pluginMods) - return df -#else initializePlugins hsc_env df | map lpModuleName (cachedPlugins df) == pluginModNames df -- plugins not changed @@ -93,10 +71,6 @@ initializePlugins hsc_env df = do loadedPlugins <- loadPlugins (hsc_env { hsc_dflags = df }) return $ df { cachedPlugins = loadedPlugins } where argumentsForPlugin p = map snd . filter ((== lpModuleName p) . fst) -#endif - - -#if defined(HAVE_INTERPRETER) loadPlugins :: HscEnv -> IO [LoadedPlugin] loadPlugins hsc_env @@ -302,15 +276,3 @@ throwCmdLineErrorS dflags = throwCmdLineError . showSDoc dflags throwCmdLineError :: String -> IO a throwCmdLineError = throwGhcExceptionIO . CmdLineError - -#else - -pluginError :: [ModuleName] -> a -pluginError modnames = throwGhcException (CmdLineError msg) - where - msg = "not built for interactive use - can't load plugins (" - -- module names are not z-encoded - ++ intercalate ", " (map moduleNameString modnames) - ++ ")" - -#endif |