|
|
@ -168,17 +168,15 @@ public class SequentialBlock extends StructuredBlock { |
|
|
|
* block (this is <i>not</i> the used set). |
|
|
|
* block (this is <i>not</i> the used set). |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public VariableSet propagateUsage() { |
|
|
|
public VariableSet propagateUsage() { |
|
|
|
if (used == null) |
|
|
|
used = new VariableSet(); |
|
|
|
used = new VariableSet();/*XXX*/ |
|
|
|
|
|
|
|
VariableSet allUse = new VariableSet(); |
|
|
|
VariableSet allUse = new VariableSet(); |
|
|
|
VariableSet childUse0 = subBlocks[0].propagateUsage(); |
|
|
|
VariableSet childUse0 = subBlocks[0].propagateUsage(); |
|
|
|
VariableSet childUse1 = subBlocks[1].propagateUsage(); |
|
|
|
VariableSet childUse1 = subBlocks[1].propagateUsage(); |
|
|
|
/* All variables used somewhere inside both sub blocks, are |
|
|
|
/* All variables used somewhere inside both sub blocks, are |
|
|
|
* used in this block, too. |
|
|
|
* used in this block, too. |
|
|
|
* Also the variables used in first block are used in this |
|
|
|
* Also the variables used in first block are used in this |
|
|
|
* block two, except when it can be declared locally. |
|
|
|
* block, except when it can be declared locally. (Note that |
|
|
|
* (Note that subBlocks[0].used != childUse0) |
|
|
|
* subBlocks[0].used != childUse0) */ |
|
|
|
*/ |
|
|
|
|
|
|
|
used.unionExact(subBlocks[0].used); |
|
|
|
used.unionExact(subBlocks[0].used); |
|
|
|
if (subBlocks[0] instanceof LoopBlock) |
|
|
|
if (subBlocks[0] instanceof LoopBlock) |
|
|
|
((LoopBlock) subBlocks[0]).removeLocallyDeclareable(used); |
|
|
|
((LoopBlock) subBlocks[0]).removeLocallyDeclareable(used); |
|
|
|