Skip to content

Commit 7cd6cfb

Browse files
authored
Merge pull request #2146 from MarcMil/tidyup
Remove getParameterRefs()
2 parents 560570b + afe8586 commit 7cd6cfb

File tree

4 files changed

+0
-56
lines changed

4 files changed

+0
-56
lines changed

src/main/java/soot/Body.java

-31
Original file line numberDiff line numberDiff line change
@@ -444,37 +444,6 @@ public List<Local> getParameterLocals() {
444444
return Arrays.asList(res);
445445
}
446446

447-
/**
448-
* Returns the list of parameter references used in this body. The list is as long as the number of parameters declared in
449-
* the associated method's signature. The list may have <code>null</code> entries for parameters not referenced in the
450-
* body. The returned list is of fixed size.
451-
*
452-
* @return
453-
*/
454-
public List<Value> getParameterRefs() {
455-
final int numParams = getMethod().getParameterCount();
456-
Value[] res = new Value[numParams];
457-
int numFound = 0;
458-
for (Unit u : getUnits()) {
459-
if (u instanceof IdentityStmt) {
460-
Value rightOp = ((IdentityStmt) u).getRightOp();
461-
if (rightOp instanceof ParameterRef) {
462-
ParameterRef pr = (ParameterRef) rightOp;
463-
int idx = pr.getIndex();
464-
if (res[idx] != null) {
465-
throw new RuntimeException("duplicate parameterref" + idx + " in " + getMethod());
466-
}
467-
res[idx] = pr;
468-
numFound++;
469-
if (numFound >= numParams) {
470-
break;
471-
}
472-
}
473-
}
474-
}
475-
return Arrays.asList(res);
476-
}
477-
478447
/**
479448
* Returns the Chain of Units that make up this body. The units are returned as a PatchingChain. The client can then
480449
* manipulate the chain, adding and removing units, and the changes will be reflected in the body. Since a PatchingChain is

src/main/java/soot/jimple/toolkits/ide/icfg/AbstractJimpleBasedICFG.java

-15
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import soot.SootMethod;
4343
import soot.Unit;
4444
import soot.UnitBox;
45-
import soot.Value;
4645
import soot.jimple.Stmt;
4746
import soot.toolkits.graph.BriefUnitGraph;
4847
import soot.toolkits.graph.DirectedGraph;
@@ -64,15 +63,6 @@ public DirectedGraph<Unit> load(Body body) throws Exception {
6463
}
6564
});
6665

67-
@SynchronizedBy("by use of synchronized LoadingCache class")
68-
protected LoadingCache<SootMethod, List<Value>> methodToParameterRefs
69-
= IDESolver.DEFAULT_CACHE_BUILDER.build(new CacheLoader<SootMethod, List<Value>>() {
70-
@Override
71-
public List<Value> load(SootMethod m) throws Exception {
72-
return m.getActiveBody().getParameterRefs();
73-
}
74-
});
75-
7666
@SynchronizedBy("by use of synchronized LoadingCache class")
7767
protected LoadingCache<SootMethod, Set<Unit>> methodToCallsFromWithin
7868
= IDESolver.DEFAULT_CACHE_BUILDER.build(new CacheLoader<SootMethod, Set<Unit>>() {
@@ -185,11 +175,6 @@ public boolean isBranchTarget(Unit u, Unit succ) {
185175
return false;
186176
}
187177

188-
@Override
189-
public List<Value> getParameterRefs(SootMethod m) {
190-
return methodToParameterRefs.getUnchecked(m);
191-
}
192-
193178
@Override
194179
public Collection<Unit> getStartPointsOf(SootMethod m) {
195180
if (m.hasActiveBody()) {

src/main/java/soot/jimple/toolkits/ide/icfg/BackwardsInterproceduralCFG.java

-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
import soot.SootMethod;
3030
import soot.Unit;
31-
import soot.Value;
3231
import soot.toolkits.graph.DirectedGraph;
3332

3433
/**
@@ -139,12 +138,6 @@ public DirectedGraph<Unit> getOrCreateUnitGraph(SootMethod m) {
139138
return delegate.getOrCreateUnitGraph(m);
140139
}
141140

142-
// same
143-
@Override
144-
public List<Value> getParameterRefs(SootMethod m) {
145-
return delegate.getParameterRefs(m);
146-
}
147-
148141
@Override
149142
public boolean isFallThroughSuccessor(Unit stmt, Unit succ) {
150143
throw new UnsupportedOperationException("not implemented because semantics unclear");

src/main/java/soot/jimple/toolkits/ide/icfg/BiDiInterproceduralCFG.java

-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.util.List;
2929
import java.util.Set;
3030

31-
import soot.Value;
3231
import soot.toolkits.graph.DirectedGraph;
3332

3433
/**
@@ -47,8 +46,6 @@ public interface BiDiInterproceduralCFG<N, M> extends InterproceduralCFG<N, M> {
4746
// also exposed to some clients who need it
4847
public DirectedGraph<N> getOrCreateUnitGraph(M body);
4948

50-
public List<Value> getParameterRefs(M m);
51-
5249
/**
5350
* Gets whether the given statement is a return site of at least one call
5451
*

0 commit comments

Comments
 (0)