[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reverse control flow graph for control dependence
Neil Walkinshaw <Neil.Walkinshaw@cis.strath.ac.uk> wrote:
> I came back to try out what you recommended (iterating through blocks
Hehe, it isn't a "recommendation" so much as quick'n'dirty hack. :-)
> obtained from a CompleteBlockGraph and reversing the predecessors with
> the successors). It is easy to modify the list that I obtain from the
> CBG, but these changes are not reflected in subsequent calls to the
> graph.
What do you mean by this? Have you compared output of
System.out.println(cbg) before and after the transformation? I gave
it a quick try with my own reverseHeadsAndTails and it seems to give
the expected results. The units in the Blocks themselves are not
reversed but I'm assuming you don't need them to be. Also note that
this method *does* modify your original graph.
It's indeed quite possible I overlooked some subtle issue.
> I am thinking that the only other option would be to produce a mutable
> alternative to the current BlockGraph implementation with setter
> methods. Have you got any hints?
Not offhand... implementing a mutable block graph should probably be
coordinated with a bigger clean up of the BlockGraph/Block stuff so
that it becomes inherently mutable (incidentally BlockGraph has
already changed quite a bit in the Soot trunk branch... *BlockGraph is
now computed from *UnitGraph if I recall correctly).
Cheers,
Navin.