Re: [abc-users] unconditional branch in jimple

From: Amjad Nusayr <anusayr_at_cs.nmsu.edu>
Date: Wed, 17 Sep 2008 08:08:44 -0600

Umm, interesting. I will look the two things you told me about.

Thanks
Amjad

Eric Bodden wrote:
> 2008/9/17 Amjad Nusayr <anusayr_at_cs.nmsu.edu>:
>
>> Hi Eric
>> I'm doing some analysis to determine the start and end of a loop (if
>> possible).
>>
>
> See, that's what I was thinking ;-) There are predefined classes for
> that in Soot, like soot.toolkits.graph.MHGDominatorsFinder
> (establishes the dominator relationship) and
> soot.jimple.toolkits.annotation.logic.LoopFinder (finds all reducible
> loops). Maybe you will find these helpful.
>
>
>> I have another question. In what cases does jimple generate unconditional
>> goto stmts? I know that it does it for loops, do you know any another case?
>>
>
> IIRC then you need one for if/then/else
>
> if(!cond) goto /*else-branch*/
> //if-branch
> goto end;
> else-branch:
> //else-branch
> end:
> //rest of the program
>
> But in general optimizations etc. could introduce (or remove) them
> anywhere. That's why one actually should usually not rely on the
> presence or absence of goto stmts but should rather work on
> abstractions of those, like a control flow graph.
>
>
>> I will try to see what I can get from body.getUnits() I hope it works for
>> me.
>>
>
> It may be more useful to think about your problem in terms of a
> control flow graph.
>
> Eric
>
>
Received on Wed Sep 17 2008 - 15:08:51 BST

This archive was generated by hypermail 2.2.0 : Thu Sep 18 2008 - 23:00:12 BST