diff options
Diffstat (limited to 'src/GF/Compile/BackOpt.hs')
| -rw-r--r-- | src/GF/Compile/BackOpt.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/GF/Compile/BackOpt.hs b/src/GF/Compile/BackOpt.hs index 089a192d5..70dbcc9ba 100644 --- a/src/GF/Compile/BackOpt.hs +++ b/src/GF/Compile/BackOpt.hs @@ -15,7 +15,7 @@ -- following advice of Josef Svenningsson ----------------------------------------------------------------------------- -module GF.Compile.BackOpt (shareModule, OptSpec) where +module GF.Compile.BackOpt (shareModule) where import GF.Grammar.Grammar import GF.Infra.Ident @@ -29,10 +29,12 @@ import qualified Data.ByteString.Char8 as BS import Data.Set (Set) import qualified Data.Set as Set -type OptSpec = Set Optimization +shareModule :: Options -> SourceModule -> SourceModule +shareModule opts (i,mo) = (i,M.replaceJudgements mo (mapTree (shareInfo optim) (M.jments mo))) + where + optim = flag optOptimizations opts -shareModule :: OptSpec -> SourceModule -> SourceModule -shareModule opt (i,mo) = (i,M.replaceJudgements mo (mapTree (shareInfo opt) (M.jments mo))) +type OptSpec = Set Optimization shareInfo :: OptSpec -> (Ident, Info) -> Info shareInfo opt (c, CncCat ty (Just t) m) = CncCat ty (Just (shareOptim opt c t)) m |
