[Soot-list] Inter-procedure constant propagation

Guru Devanla gdevan2 at uic.edu
Thu Oct 17 23:19:56 EDT 2013


There is an example implementation
in soot.jimple.toolkits.ide.exampleproblems.IFDSReachingDefinitions.

Currently, I use it to find all reaching definitions. Looks like you could
use that information or supplement that information for your purpose. There
may be a better way to do it though.

Thanks
Guru


On Thu, Oct 17, 2013 at 7:35 PM, P Lee <paulur at gmail.com> wrote:

> (I saw there is a thread discussing constant propagation, but it seems
> stop at intra-procedure constant. So I start a new thread.)
>
> The use-case is very simple. Suppose we have a constant that is defined in
> one class and the constant is used in another class, as the following code:
>
> public interface CONST {
> String c = "xyz";
> }
>
> public class SampleClass{
> static aMethod(String s){
>  String a = CONST.c + "abc";
> String b = s + "opq";
>  System.out.println( a + b );
> }
>  public static void main(String arg[]){
> aMethod(CONST.c);
>  }
> }
>
> I want to report that "a" is always a constant and b is a constant  in the
> main method.Thanks in advance  for any advise!
>
> Paul
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20131017/27a7bd08/attachment.html 


More information about the Soot-list mailing list