[Soot-list] trying to generate reverse block graph

Neil Walkinshaw Neil.Walkinshaw at cis.strath.ac.uk
Tue Jan 11 06:43:09 EST 2005


Hi,

I have recently updated to soot version 2.1.1. I use it to produce 
control dependence graphs for methods. This involves generating a 
reverse control flow graph from a completeblockgraph (ref. 
http://www.sable.mcgill.ca/list_archives/old_publicarchives/soot-list/msg01139.html). 
Using the previous soot version, the following method seemed to do the 
trick:

    private CompleteBlockGraph 
buildReverseControlFlowGraph(CompleteBlockGraph bg){
        List l = bg.getBlocks();
       for(int i = 0;i<l.size();i++){
           Block b = (Block)l.get(i);
           List preds = b.getPreds();
           List succs = b.getSuccs();
           b.setPreds(succs);
           b.setSuccs(preds);
            l.set(i, b);
       }
       CompleteBlockGraph rcbg = reverseHeadsAndTails(bg);
       return rcbg;
    }

The new soot version however returns an unmodifiablelist when 
bg.getBlocks() is called, so when the l.set(i, b) is called, it throws 
an exception. Does the new soot version include any convenience methods 
that will enable me to produce a reverse block graph?

Thanks and best regards,

Neil


More information about the Soot-list mailing list