(JMethod method)
| 72 | private int tempCounter = 0; |
| 73 | |
| 74 | public IRBuildHelper(JMethod method) { |
| 75 | this.method = method; |
| 76 | // build this variable |
| 77 | vars = new ArrayList<>(); |
| 78 | thisVar = method.isStatic() ? null : |
| 79 | newVar(THIS, method.getDeclaringClass().getType()); |
| 80 | // build parameters |
| 81 | params = new ArrayList<>(method.getParamCount()); |
| 82 | for (int i = 0; i < method.getParamCount(); ++i) { |
| 83 | params.add(newVar(PARAM + i, method.getParamType(i))); |
| 84 | } |
| 85 | // build return variable |
| 86 | Type retType = method.getReturnType(); |
| 87 | if (!retType.equals(VoidType.VOID)) { |
| 88 | returnVar = newVar(RETURN, retType); |
| 89 | returnVars = Set.of(returnVar); |
| 90 | } else { |
| 91 | returnVar = null; |
| 92 | returnVars = Set.of(); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * @return {@code this} variable of the IR being built. |
nothing calls this directly
no test coverage detected