analyzer
analyzer copied to clipboard
Type-based incremental restarting
In some cases it might be necessary to do manual incremental restarting not by a global variable name, but a type name. In particular, the access analysis has some type-based unknowns which cannot be manually restarted otherwise.
In particular, the access analysis has some type-based unknowns which cannot be manually restarted otherwise.
Can you elaborate on this? Which typed-based unknowns cannot be manually restarted in the access analysis?
If there's an access to a struct field on an unknown pointer, then that's collected under the memory location (struct foo).bar. To restart those, you need to restart the type struct foo.
@just-max Ok, so I guess the general steps to implement this would be as follows:
- Extend the type
VarQuery.twith a variant for C-types. - Allow for types as input for the restarting mechanism This would enable the general mechanism requested by this issue, i.e. that analyses can provide some iteration by type
- Adapt the
AccessAnalysis, to implement an answer to theIterSysVarsquery, that in particular implements the case that the query is about a type.
Regarding 3:
Currently, the globals in the AccessAnalysis are program Nodes, which are mapped to a set of accesses.
Since we want to be able iterate over program variables / types in these sets, one would have to iterate over all unknowns (i.e. nodes) and check the sets that are associated with them to see whether the set contains one of the variables / types of interest.
Actually now that race analysis is split off from access analysis, IterSysVars should be in RaceAnalysis instead.