Navigation Menu

Skip to content

Commit

Permalink
Updated GHCI ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulmutt committed Aug 6, 2016
1 parent ac7d4e8 commit e1ba820
Show file tree
Hide file tree
Showing 19 changed files with 3,052 additions and 3,034 deletions.
8 changes: 4 additions & 4 deletions compiler/GHCVM/Main/DriverPipeline.hs
Expand Up @@ -1524,11 +1524,11 @@ doCpp dflags raw input_fn output_fn = do

backend_defs <- getBackendDefs dflags

-- TODO:#ifdef GHCI
-- let th_defs = [ "-D__GLASGOW_HASKELL_TH__=YES" ]
-- #else
#ifdef GHCI
let th_defs = [ "-D__GLASGOW_HASKELL_TH__=YES" ]
#else
let th_defs = [ "-D__GLASGOW_HASKELL_TH__=NO" ]
-- #endif
#endif
-- Default CPP defines in Haskell source
ghcVersionH <- getGhcVersionPathName dflags
let hsSourceCppOpts =
Expand Down
14 changes: 7 additions & 7 deletions compiler/GHCVM/Main/DynFlags.hs
Expand Up @@ -113,9 +113,9 @@ module GHCVM.Main.DynFlags (
StgToDo(..),
getStgToDo,

-- #ifdef GHCI
-- rtsIsProfiled,
-- #endif
#ifdef GHCI
rtsIsProfiled,
#endif
dynamicGhc,

-- #include "../includes/dist-derivedconstants/header/GHCConstantsHaskellExports.hs"
Expand Down Expand Up @@ -163,10 +163,10 @@ import qualified GHCVM.Utils.Pretty as Pretty
import GHCVM.BasicTypes.SrcLoc
import GHCVM.Utils.FastString
import GHCVM.Utils.Outputable
--TODO: #ifdef GHCI
-- import Foreign.C ( CInt(..) )
-- import System.IO.Unsafe ( unsafeDupablePerformIO )
-- #endif
#ifdef GHCI
import Foreign.C ( CInt(..) )
import System.IO.Unsafe ( unsafeDupablePerformIO )
#endif
import {-# SOURCE #-} GHCVM.Main.ErrUtils ( Severity(..), MsgDoc, mkLocMessage )

import System.IO.Unsafe ( unsafePerformIO )
Expand Down
20 changes: 11 additions & 9 deletions compiler/GHCVM/Rename/RnEnv.hs
Expand Up @@ -4,6 +4,8 @@
\section[RnEnv]{Environment manipulation for the renamer monad}
-}

{-# LANGUAGE CPP #-}

module GHCVM.Rename.RnEnv (
newTopSrcBinder,
lookupLocatedTopBndrRn, lookupTopBndrRn,
Expand Down Expand Up @@ -351,16 +353,16 @@ lookupExactOcc_either name
; if name `inLocalRdrEnvScope` lcl_env
then return (Right name)
else
-- #ifdef GHCI
-- do { th_topnames_var <- fmap tcg_th_topnames getGblEnv
-- ; th_topnames <- readTcRef th_topnames_var
-- ; if name `elemNameSet` th_topnames
-- then return (Right name)
-- else return (Left exact_nm_err)
-- }
-- #else /* !GHCI */
#ifdef GHCI
do { th_topnames_var <- fmap tcg_th_topnames getGblEnv
; th_topnames <- readTcRef th_topnames_var
; if name `elemNameSet` th_topnames
then return (Right name)
else return (Left exact_nm_err)
}
#else /* !GHCI */
return (Left exact_nm_err)
-- #endif /* !GHCI */
#endif /* !GHCI */
}

[gre] -> return (Right (gre_name gre))
Expand Down

0 comments on commit e1ba820

Please sign in to comment.