Open maemre opened 2 years ago
This is a very good question. I would suggest going for the first option.
In fact, SVF has a demand-driven context-sensitive pointer analysis using CondPTAImpl
in the DDA folder (https://github.com/SVF-tools/SVF/blob/master/include/DDA/ContextDDA.h). You can have a look to get started with a similar data structure for whole-program context-sensitive analysis on top of a constraint graph rather than SVFG.
I don't think the optimization at this stage matters, but you can always map a CxtVar
to a single ID to leverage the bit-vector-based points-to structure optimization from @mbarbar
To clarify some terminology, #80 mentions the SVFG only because he wanted a flow-sensitive analysis. The SVFG corresponds to the DUG in other literature.
Thank you for the hints, and keeping me from worrying about the SVFG! The analogy with the def-use graph really helps. I am looking into whether I can fit the flow-sensitive demand-driven analysis to my use case, and if it doesn't work then I'll go with the first option.
Hi @yuleisui ,
I want to build a context-sensitive and flow-insensitive analysis on SVF. Specifically, I want to make an Andersen-style analysis context sensitive by making objects on the stack, and on the heap context sensitive. I am interested in this combination to model potential effects of some program transformations (inlining, function duplication) on Andersen-style analysis. Does any of the approaches below (or another approach) sound good to you? Are there any gotchas I should be aware of?
As far as I can see, there are two possibilities:
Andersen
class that inherits fromCondPTAImpl<ContextCond>
(instead ofBVDataPTAImpl
and be careful about the assumptionsAndersen
makes about the backing set data structure. Issue #80 seems a bit relevant here, but I am not sure if/how I can parameterize SVFG to generate a call graph that would correspond to what would be built alongside the PTA I am trying to build. Edit: @mbarbar also noted thatCondPTAImpl
supports only mutable points-to data, which may prohibit some optimized variants of Andersen-style analysis.