[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Spark Pointer analysis
An aside that is not at all relevant to your specific question....
Nikhil Mahajan <niks729@yahoo.com> wrote:
> HashMap map = new HashMap();
> System.out.println("*** Reading default options ");
> String defaultOptions = SparkOptions.getDefaultOptions();
> StringTokenizer decoupe = new StringTokenizer(defaultOptions, " ");
> while(decoupe.hasMoreElements()){
> String option = decoupe.nextToken();
> StringTokenizer decoupeOption = new StringTokenizer(option, ":");
> String key = decoupeOption.nextToken();
> String value = decoupeOption.nextToken();
> map.put(key, value);
> System.out.println("Option "+key+" * Set "+value);
> }
> SparkOptions options = new SparkOptions(map);
> SparkTransformer.v().internalTransform("wjtp", map);
It looks like what you're doing here is constructing an options Map
from the default options String. If I'm not mistaken, I think it is
safe for you to use Scene.computePhaseOptions... so all you would
have to do is:
Map map = Scene.computePhaseOptions(SparkOptions.getDefaultOptions());
SparkTransformer.v().internalTransform("wjtp", map);
Hmmm, in fact it seems strange that you're using internalTransform at
all (though I guess that could be intentional since it seems to be a
public method -- Ondrej, if this is not intentional it should probably
go back to protected in Soot 2.0). If you used the SceneTransformer
interface you wouldn't even have to use computePhaseOptions:
SparkTransformer.v().transform("wjtp", "");
should be equivalent to your code and will automatically fetch the
default Spark options and use them. You can simply override the
defaults by putting them in the second argument. For example:
SparkTransformer.v().transform("wjtp", "verbose:true");
should flip the default value of verbose from false to true.
Cheers,
Navin.