Skip to content

Commit

Permalink
Merge pull request #24 from thomie/master
Browse files Browse the repository at this point in the history
fix(Preprocessor): GHC 8.0 doesn't export replaceDynFlags
  • Loading branch information
rubik committed Jan 27, 2016
2 parents 382893e + 9b71611 commit c4b0839
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Argon/Preprocess.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import qualified DynFlags as GHC
import qualified MonadUtils as GHC
import qualified DriverPhases as GHC
import qualified DriverPipeline as GHC
import qualified HscTypes as GHC

data CppOptions = CppOptions
{ cppDefine :: [String] -- ^ CPP #define macros
Expand All @@ -36,8 +37,8 @@ getPreprocessedSrcDirect :: (GHC.GhcMonad m)
-> m (String, GHC.DynFlags)
getPreprocessedSrcDirect cppOptions file = do
hscEnv <- GHC.getSession
let dfs = GHC.extractDynFlags hscEnv
newEnv = GHC.replaceDynFlags hscEnv (injectCppOptions cppOptions dfs)
let dfs = GHC.hsc_dflags hscEnv
newEnv = hscEnv { GHC.hsc_dflags = injectCppOptions cppOptions dfs }
(dflags', hspp_fn) <-
GHC.liftIO $ GHC.preprocess newEnv (file, Just (GHC.Cpp GHC.HsSrcFile))
txt <- GHC.liftIO $ readFile hspp_fn
Expand Down

0 comments on commit c4b0839

Please sign in to comment.