[Soot-list] type qualifiers?

Patrick LAM plam at sable.mcgill.ca
Thu Feb 9 15:54:19 EST 2006


On Thu, 9 Feb 2006, Will Benton wrote:

> I'm interested in using Soot to analyze and generate extension to
> Java that uses type qualifiers.  Therefore, I'd like a way for my
> analyses to be able to see, for example, that the type of a variable
> is "String {s,t}" (where {s,t} is a set of qualifiers).  For the
> particular problem I'm working on, a variable of type T can receive a
> value of type T' iff the qualifier set for T' is a subset of the
> qualifier set for T.

I'm assuming that you're going to infer the type qualifiers through some
analysis, and that for now you don't want to read them from the source or
from the class files.

> What would be the least painful way to do this?  Should I extend
> RefType to include information about qualifier sets, override the
> equals() method, etc., or is there some kind of "hook" into Soot's
> typechecker that I could exploit?

You probably don't want to extend RefType; that tends to be a painful way
of making changes, in that they'll be trampled by new Soot releases.
Probably you want to have a HashMap that associates particular RefType or
Local objects with the augumented type and read the information when you
need it, in your FlowAnalysis classes.  You can also have a typechecking
FlowAnalysis that checks the validity of your extended types.

Let me know if that was unclear.

pat




More information about the Soot-list mailing list