This allows for use of the same solver used by the DAC for additional solving post-analysis and thus shared use of MaxIterations in WatchedLiteralsSolver.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h | ||
---|---|---|
179–182 | nit: Given that these are options of Solver::Result, I think you can just delete these lines. |
Updated function comment to remove unnecessary repetition and include newly-discovered caveat re: flow conditions.
Thanks!
As discussed offline, I had some concerns about whether there were any cases where it was safe to use formulas separate from the FC that might constrain them.
But we found some: these are formulas produced by the downstream analysis that have known structure.
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h | ||
---|---|---|
184 | FWIW, I'd probably prefer exposing the solver object itself, having all capabilities exposed directly through DataflowAnalysisContext gives it this ugly "god object" quality and the places that we want to use it really just need arena + solver. | |
184 | this should be ArrayRef<BoolValue*> now... sorry for the churn |
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h | ||
---|---|---|
184 | HEAD says SetVector, so updated to that. Is there another change coming that makes it ArrayRef? | |
184 | If all capabilities was more than 1 capability and this function didn't already exist, I'd me more inclined to agree. But requiring users to duplicate the body of this function seems worse to me than forwarding an API from a member. I'm noticing as well that the body of this function adds true and !false constraints to the provided set, which I hadn't been doing when using a solver and for which I can find no documentation indicating that it's necessary. Either we should document why that's done and would need to expect users to know to do it if we expose the solver only directly, or we should remove that from this function. |
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h | ||
---|---|---|
184 | @sammccall |
LG as is, sorry for the noise!
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h | ||
---|---|---|
184 | The public APIs for "set of constraints" are ArrayRef (on Solver::solve). Nevertheless, let's go with this change as-is, the alternatives are complicated for now. | |
184 |
I'll just eliminate the requirement to do so at all, soon. |
It looks like D153485 changes the context for the last few comments significantly. What's the appetite for adding yet another child commit to the chain D153485 is in that exposes the solver directly? Instead of committing this and having D153485 make a breaking change to expose the solver directly if that's better in the new context.
Yeah, that's fewer steps but more stuff stacked on top.
I don't feel strongly - happy to make that change later if you'd like to have this available now.
Since the timeline for being able to use this is dependent not only on commits but integrates as well, lets go ahead with this then.
Can someone commit it for me when we're ready?
nit: Given that these are options of Solver::Result, I think you can just delete these lines.