local.getExpression() instead of name checking when creating this operators

setCodeAnalyzer() / setLocalInfo() (used for moving super calls for jikes
constructors)


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@852 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent eeeb1083c0
commit 6ede3d2f6c
  1. 17
      jode/jode/expr/LocalLoadOperator.java

@ -59,6 +59,15 @@ public class LocalLoadOperator extends Operator
return local.getLocalInfo(); return local.getLocalInfo();
} }
public void setCodeAnalyzer(CodeAnalyzer ca) {
codeAnalyzer = ca;
}
public void setLocalInfo(LocalInfo newLocal) {
local = newLocal;
updateType();
}
public void updateSubTypes() { public void updateSubTypes() {
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0) if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0)
GlobalOptions.err.println("setType of "+local.getName()+": " GlobalOptions.err.println("setType of "+local.getName()+": "
@ -80,12 +89,8 @@ public class LocalLoadOperator extends Operator
} }
public Expression simplify() { public Expression simplify() {
if (local.getName().equals("this") && codeAnalyzer != null) if (local.getExpression() != null)
return new ThisOperator(codeAnalyzer.getClazz(), true).simplify(); return local.getExpression().simplify();
if (local.getName().equals("this$-1") && codeAnalyzer != null)
return new ThisOperator
(((ClassAnalyzer)codeAnalyzer.getClassAnalyzer().getParent())
.getClazz()).simplify();
return super.simplify(); return super.simplify();
} }

Loading…
Cancel
Save