This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Moved non solver specific code from Z3ConstraintManager to SMTConstraintManager
ClosedPublic

Authored by mikhail.ramalho on Jul 23 2018, 7:20 AM.

Details

Summary

This patch moves a lot of code from Z3ConstraintManager to SMTConstraintManager, leaving only the necessary:

  • canReasonAbout which returns if a Solver can handle a given SVal (should be moved to SMTSolver in the future).
  • removeDeadBindings, assumeExpr and print: methods that need to use ConstraintZ3Ty, can probably be moved to SMTConstraintManager in the future.

The patch creates a new file, SMTConstraintManager.cpp with the moved code. Conceptually, this is move in the right direction and needs further improvements: SMTConstraintManager still does a lot of things that are not required by a ConstraintManager.

We ought to move the unrelated to SMTSolver and remove everything that's not related to a ConstraintManager. In particular, we could remove addRangeConstraints and isModelFeasible, and make the refutation manager create an Z3Solver directly.

Diff Detail

Repository
rC Clang

Event Timeline

OK but let's not do too many refactorings.

This revision is now accepted and ready to land.Jul 23 2018, 10:44 AM

Return addStateConstraints to SMTConstraintManager, as the SMT API shouldn't know about ProgramStateRefs

This revision was automatically updated to reflect the committed changes.