summaryrefslogtreecommitdiff
path: root/src/GF/Compile/Compile.hs
diff options
context:
space:
mode:
authoraarne <unknown>2005-02-05 09:52:04 +0000
committeraarne <unknown>2005-02-05 09:52:04 +0000
commit45f3b7d5e74dde250a3e0eb92469efc22479cd30 (patch)
treedac6258b5188e5b618f3d0828e525437bcca6758 /src/GF/Compile/Compile.hs
parentbc05653e825e082b70eebf2f420eb5a97610f56c (diff)
optimization flags and improver eng
Diffstat (limited to 'src/GF/Compile/Compile.hs')
-rw-r--r--src/GF/Compile/Compile.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs
index 2c8016a61..bfd8f64f2 100644
--- a/src/GF/Compile/Compile.hs
+++ b/src/GF/Compile/Compile.hs
@@ -9,7 +9,7 @@
-- > CVS $Author $
-- > CVS $Revision $
--
--- (Description of the module)
+-- The top-level compilation chain from source file to gfc/gfr.
-----------------------------------------------------------------------------
module Compile where
@@ -276,12 +276,16 @@ generateModuleCode :: Options -> InitPath -> SourceModule -> IOE GFC.CanonModule
generateModuleCode opts path minfo@(name,info) = do
let pname = prefixPathName path (prt name)
minfo0 <- ioeErr $ redModInfo minfo
+ let oopts = addOptions opts (iOpts (flagsModule minfo))
+ optim = maybe "share" id $ getOptVal oopts useOptimizer
minfo' <- return $
- if optim
- then shareModule fullOpt minfo0 -- parametrization and sharing
- else if values
- then shareModule valOpt minfo0 -- tables as courses-of-values
- else shareModule basicOpt minfo0 -- sharing only
+ case optim of
+ "parametrize" -> shareModule paramOpt minfo0 -- parametrization and sharing
+ "values" -> shareModule valOpt minfo0 -- tables as courses-of-values
+ "share" -> shareModule shareOpt minfo0 -- sharing of branches
+ "all" -> shareModule allOpt minfo0 -- first parametrize then values
+ "none" -> minfo0 -- no optimization
+ _ -> shareModule shareOpt minfo0 -- sharing; default
-- for resource, also emit gfr
case info of
@@ -305,8 +309,6 @@ generateModuleCode opts path minfo@(name,info) = do
_ -> True
nomulti = not $ oElem makeMulti opts
emit = oElem emitCode opts && not (oElem notEmitCode opts)
- optim = oElem optimizeCanon opts
- values = oElem optimizeValues opts
-- for old GF: sort into modules, write files, compile as usual