From 3f2771a0791db3e678e65bde7ecb051cc5ecdd5b Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Mon, 27 Feb 2012 12:37:11 +0900 Subject: [PATCH] TH expand hack. --- Check.hs | 2 +- GHCApi.hs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Check.hs b/Check.hs index 6ce246f..ce44437 100644 --- a/Check.hs +++ b/Check.hs @@ -26,5 +26,5 @@ check opt fileName = withGHC $ checkIt `gcatch` handleErrMsg load LoadAllTargets liftIO readLog options - | expandSplice opt = ghcOpts opt + | expandSplice opt = ["-w:"] ++ ghcOpts opt | otherwise = ["-Wall","-fno-warn-unused-do-bind"] ++ ghcOpts opt diff --git a/GHCApi.hs b/GHCApi.hs index f525036..ef2cb41 100644 --- a/GHCApi.hs +++ b/GHCApi.hs @@ -38,17 +38,16 @@ initSession opt cmdOpts idirs logging = do ---------------------------------------------------------------- setFlags :: Options -> DynFlags -> [FilePath] -> DynFlags -setFlags opt d idirs = d' +setFlags opt d idirs + | expandSplice opt = dopt_set d' Opt_D_dump_splices + | otherwise = d' where d' = d { packageFlags = ghcPackage : packageFlags d , importPaths = idirs , ghcLink = NoLink , hscTarget = HscInterpreted - , flags = if expandSplice opt then - flags d ++ [Opt_D_dump_splices] - else - flags d + , flags = flags d } ghcPackage :: PackageFlag