diff options
author | dos-reis <gdr@axiomatics.org> | 2010-06-22 17:20:38 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-06-22 17:20:38 +0000 |
commit | b06599402ca23cce8ba7eea03886dc11a5d29af4 (patch) | |
tree | 763ae52bb73dfb7f76feb7433b7853056acb9605 /src/interp/c-util.boot | |
parent | 48d55f8e89cdc22afbf661b823bf059d231b0db4 (diff) | |
download | open-axiom-b06599402ca23cce8ba7eea03886dc11a5d29af4.tar.gz |
Group sequence of LETT definitions into LET/LET* expressions where
appropriate.
* interp/g-opt.boot (jumpToToplevel?): New.
(singleAssignment?): Likewise.
(groupVariableDefinitions): Likewise. Use them.
(optimizeFunctionDef): Group toplevel variable definitions into
a bind expression.
* interp/g-util.boot (expandBind): Tidy.
* interp/c-util.boot (transformToBackendCode): Refrain from
enclosing let-expressions in SEQ if not needed.
Diffstat (limited to 'src/interp/c-util.boot')
-rw-r--r-- | src/interp/c-util.boot | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index ab80ac63..17d630b4 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -1620,8 +1620,10 @@ transformToBackendCode x == -- Make it explicitly a sequence of statements if it is not a one liner. body := body is [stmt] and - (atom stmt or stmt.op = "SEQ" or not CONTAINED("EXIT",stmt)) => - body + (atom stmt + or stmt.op in '(SEQ LET LET_*) + or not CONTAINED("EXIT",stmt)) => + body [simplifySEQ ["SEQ",:body]] $FluidVars := removeDuplicates nreverse $FluidVars $LocalVars := S_-(S_-(removeDuplicates nreverse $LocalVars,$FluidVars), |