|
|
@ -33,8 +33,8 @@ public abstract class InstructionContainer extends StructuredBlock { |
|
|
|
|
|
|
|
|
|
|
|
public InstructionContainer(Expression instr) { |
|
|
|
public InstructionContainer(Expression instr) { |
|
|
|
this.instr = instr; |
|
|
|
this.instr = instr; |
|
|
|
if (instr instanceof LocalVarOperator) |
|
|
|
if (instr != null) |
|
|
|
used.addElement(((LocalVarOperator)instr).getLocalInfo()); |
|
|
|
instr.fillInGenSet(null, used); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public InstructionContainer(Expression instr, Jump jump) { |
|
|
|
public InstructionContainer(Expression instr, Jump jump) { |
|
|
@ -44,11 +44,8 @@ public abstract class InstructionContainer extends StructuredBlock { |
|
|
|
|
|
|
|
|
|
|
|
public void setJump(Jump jump) { |
|
|
|
public void setJump(Jump jump) { |
|
|
|
super.setJump(jump); |
|
|
|
super.setJump(jump); |
|
|
|
if (instr instanceof LocalVarOperator) { |
|
|
|
jump.gen.add(used); |
|
|
|
LocalVarOperator varOp = (LocalVarOperator) instr; |
|
|
|
jump.kill.add(used); |
|
|
|
jump.gen.addElement(varOp.getLocalInfo()); |
|
|
|
|
|
|
|
jump.kill.addElement(varOp.getLocalInfo()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -71,13 +68,8 @@ public abstract class InstructionContainer extends StructuredBlock { |
|
|
|
* @param in The VariableSet, the in variables should be stored to. |
|
|
|
* @param in The VariableSet, the in variables should be stored to. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void fillInGenSet(VariableSet in, VariableSet gen) { |
|
|
|
public void fillInGenSet(VariableSet in, VariableSet gen) { |
|
|
|
if (instr instanceof LocalVarOperator) { |
|
|
|
if (instr != null) |
|
|
|
LocalVarOperator varOp = (LocalVarOperator) instr; |
|
|
|
instr.fillInGenSet(in, gen); |
|
|
|
if (varOp.isRead()) { |
|
|
|
|
|
|
|
in.addElement(varOp.getLocalInfo()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
gen.addElement(varOp.getLocalInfo()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean doTransformations() { |
|
|
|
public boolean doTransformations() { |
|
|
|