StoreInstruction/LValue

Expression.fillInGenSet added


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@774 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent f59b7cadff
commit fd7a8e40ff
  1. 20
      jode/jode/flow/InstructionContainer.java

@ -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() {

Loading…
Cancel
Save