Skip to content

Commit

Permalink
Merge branch 'develop' of ssh://github.com/Sable/soot into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre-Bartel committed Jan 14, 2014
2 parents 91c0813 + 62d066d commit 3592314
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 12 additions & 10 deletions src/soot/Pack.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ public void add(Transform t) {
public void insertAfter(Transform t, String phaseName)
{
PhaseOptions.v().getPM().notifyAddPack();
Iterator<Transform> it = opts.iterator();
while (it.hasNext())
{
Transform tr = (Transform)it.next();
for (Transform tr : opts) {
if (tr.getPhaseName().equals(phaseName))
{
opts.insertAfter(t, tr);
Expand All @@ -75,10 +72,7 @@ public void insertAfter(Transform t, String phaseName)
public void insertBefore(Transform t, String phaseName)
{
PhaseOptions.v().getPM().notifyAddPack();
Iterator<Transform> it = opts.iterator();
while (it.hasNext())
{
Transform tr = (Transform)it.next();
for (Transform tr : opts) {
if (tr.getPhaseName().equals(phaseName))
{
opts.insertBefore(t, tr);
Expand All @@ -89,14 +83,22 @@ public void insertBefore(Transform t, String phaseName)
}

public Transform get( String phaseName ) {
for( Iterator<Transform> trIt = opts.iterator(); trIt.hasNext(); ) {
final Transform tr = (Transform) trIt.next();
for (Transform tr : opts) {
if( tr.getPhaseName().equals(phaseName) ) {
return tr;
}
}
return null;
}

public boolean remove(String phaseName) {
for (Transform tr : opts)
if (tr.getPhaseName().equals(phaseName)) {
opts.remove(tr);
return true;
}
return false;
}

protected void internalApply() {
throw new RuntimeException("wrong type of pack");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,14 @@ private synchronized void ensureClassHasBodies(SootClass cl) {

@Override
public Set<SootMethod> getCalleesOfCallAt(Unit u) {
assert Scene.v().hasFastHierarchy();
Set<SootMethod> targets = unitToCallees.getUnchecked(u);
assert Scene.v().hasFastHierarchy();
for (SootMethod m : targets) {
addCallerForMethod(u, m);
initForMethod(m);
}
return targets;
}

private void addCallerForMethod(Unit callSite, SootMethod target) {
synchronized (methodToCallers) {
Set<Unit> callers = methodToCallers.get(target);
Expand Down

0 comments on commit 3592314

Please sign in to comment.