diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-01-01 23:31:12 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-01-01 23:31:12 +0000 |
| commit | b3da2791fdea27bd5061ad939e31915e36c03f1d (patch) | |
| tree | af833a1c211211ed9c72d63cfaf4ab6b4b84c4ac /src/GF/Compile/Compile.hs | |
| parent | e7611aefb4c3cdbd0befc017a5b6e22e84fefd30 (diff) | |
subex elim in gfr generation
Diffstat (limited to 'src/GF/Compile/Compile.hs')
| -rw-r--r-- | src/GF/Compile/Compile.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs index cf07fdb65..faece6a99 100644 --- a/src/GF/Compile/Compile.hs +++ b/src/GF/Compile/Compile.hs @@ -40,6 +40,7 @@ import GF.Compile.Optimize import GF.Compile.Evaluate import GF.Compile.GrammarToCanon --import GF.Devel.GrammarToGFCC ----- +import GF.Devel.OptimizeGF (subexpModule,unsubexpModule) import GF.Canon.Share import GF.Canon.Subexpressions (elimSubtermsMod,unSubelimModule) import GF.UseGrammar.Linear (unoptimizeCanonMod) ---- @@ -202,7 +203,8 @@ compileOne opts env@((_,srcgr,cancgr0,eenv),_) file = do -- for compiled resource, parse and organize, then update environment "gfr" -> do sm0 <- putp ("| reading" +++ file) $ getSourceModule opts file - sm <- {- putp "creating indirections" $ -} ioeErr $ extendModule mos sm0 + let sm1 = unsubexpModule sm0 + sm <- {- putp "creating indirections" $ -} ioeErr $ extendModule mos sm1 ---- experiment with not optimizing gfr ---- sm:_ <- putp " optimizing " $ ioeErr $ evalModule mos sm1 let gfc = gfcFile name @@ -330,7 +332,8 @@ generateModuleCode opts path minfo@(name,info) = do --- Also for incomplete, to create timestamped gfc/gfr files case info of ModMod m | emitsGFR m && emit && nomulti -> do - let rminfo = if isCompilable info then minfo + let rminfo = if isCompilable info + then subexpModule minfo else (name, ModMod emptyModule) let (file,out) = (gfrFile pname, prGrammar (MGrammar [rminfo])) putp (" wrote file" +++ file) $ ioeIO $ writeFile file $ compactPrint out |
