[Soot-list] Question about Value vs Stmt in Jimple
Jiaqi Tan
jiaqit at andrew.cmu.edu
Thu Oct 18 13:41:01 EDT 2012
Do the Stmts get populated only when I run the whole-program
transformation and the wjtp pack?
Thanks,
Jiaqi
On Thu, Oct 18, 2012 at 1:28 PM, Eric Bodden <eric.bodden at ec-spride.de> wrote:
>> If I'm getting UseBoxes that do not show up in any of the UnitBoxes
>> from getAllUnitBoxes(), does that mean that there are values that are
>> created but not used? Then what is the relationship between Stmt's and
>> the Boxes? Are all UseBoxes and DefBoxes contained within all Stmts
>> returned from getAllUnitBoxes()?
>
> What you describe actually cannot happen. Maybe you are
> misinterpreting something?
>
> Take a look at the definitions:
>
> public List<UnitBox> getAllUnitBoxes()
> {
> ArrayList<UnitBox> unitBoxList = new ArrayList<UnitBox>();
> {
> Iterator<Unit> it = unitChain.iterator();
> while(it.hasNext()) {
> Unit item = it.next();
> unitBoxList.addAll(item.getUnitBoxes());
> }
> }
>
> {
> Iterator<Trap> it = trapChain.iterator();
> while(it.hasNext()) {
> Trap item = it.next();
> unitBoxList.addAll(item.getUnitBoxes());
> }
> }
>
> {
> Iterator<Tag> it = getTags().iterator();
> while(it.hasNext()) {
> Tag t = it.next();
> if( t instanceof CodeAttribute)
> unitBoxList.addAll(((CodeAttribute) t).getUnitBoxes());
> }
> }
>
> return unitBoxList;
> }
>
> public List<ValueBox> getUseBoxes()
> {
> ArrayList<ValueBox> useBoxList = new ArrayList<ValueBox>();
>
> Iterator<Unit> it = unitChain.iterator();
> while(it.hasNext()) {
> Unit item = it.next();
> useBoxList.addAll(item.getUseBoxes());
> }
> return useBoxList;
> }
>
>
> Eric
More information about the Soot-list
mailing list