[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read/write sets for a Unit



This works for me:

 import soot.jimple.toolkits.pointer.*;

 sea = Scene.v().getSideEffectAnalysis();
 SootMethod m = .....;
 sea.findNTRWSets(m);
 Stmt s = ....;
 RWSet reads = sea.readSet(m, s);
 RWSet writes = sea.readSet(m, s);

And now do a typecheck and cast before 
you read the sets (SiteRWSet is for
an invoke statement, StmtRWSet for
a non-invoke):
 if (reads instanceof StmtRWSet) { .... }
 if (writes instanceof SiteRWSet) { ... }

Manoj


Will Benton wrote (Tue, Nov 25, 2003 at 09:21:00AM -0600) :
> I'm curious as to what the correct way to access read/write sets for a  
> given Unit is from within a BodyTransformer.  I'm assuming that what  
> I'm doing is violating some precondition on the SideEffectTester code,  
> because it's not working.  (Therefore, the rest of this message, which  
> explains what I am doing now, can probably be skimmed or skipped if  
> it's clearly wrong.)
>