[Soot-list] Associate transfer function on edges when doing data flow analysis

Eric Bodden eric.bodden at mail.mcgill.ca
Wed Feb 6 08:39:56 EST 2008


Alvin, in the current version of Soot, the interface of flowThrough is:

flowThrough(A in, N d, A out)

In particular, you can use any abstraction A and any node type (this
is what you want!) N. So in general you can fit pretty much anything
into this interface.

Right now, as far as I can see, we do not provide an adaptor that
switches nodes to edges and the other way around, but that's what you
need to get what you want. I have attached for you a class that I once
wrote and that does something similar: It makes FlowAnalysis iterate
over a state machine instead of a method body and in particular,
flowThrough flows through the machine's transitions, not its nodes.
Maybe you find this helpful.

Please not that right now our implementations of UnitGraph do not
actually store edges, they store just references from one node to the
other (e.g. a map unitToSuccs). When you want to have flowThrough
analyze edges, your custom version of DirectedGraph would therefore
have to create an object of some Edge class for each source/target
pair, so that you can have a function...

flowThrough(A in, Edge e, A out)

... and in particular something to pass to that function.

Eric

On 06/02/2008, Alvin Yan <feiya200 at cs.uregina.ca> wrote:
>
>
> Hello,
>
> I'm trying to do a data flow analysis with Soot. And we all know that the
> flowThrough(FlowSet in, Unit s, FlowSet out) defines transfer function on
> node s. I'm wondering does Soot support defining transfer function on edges?
> Do I need to write some kind of a flowThrough(FlowSet in, Unit s, Unit t,
> FlowSet out) to do that (s->t is the edge)?
>
> Alvin
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list