-
Notifications
You must be signed in to change notification settings - Fork 6.3k
refactor(formal): remove unused clear()/solver() from EncodingContext
#16164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(formal): remove unused clear()/solver() from EncodingContext
#16164
Conversation
|
Thank you for your contribution to the Solidity compiler! A team member will follow up shortly. If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother. If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if @blishko agrees, I think we should just remove clear as well as solver member functions
| void EncodingContext::clear() | ||
| { | ||
| m_variables.clear(); | ||
| m_expressions.clear(); | ||
| m_globalContext.clear(); | ||
| m_assertions.clear(); | ||
| m_solver = nullptr; | ||
| m_accumulateAssertions = true; | ||
| resetUniqueId(); | ||
| m_state.reset(); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clearly that method was never used, it would be better to remove it entirely instead of adding unused implementation detail IMO.
| void popSolver(); | ||
| void addAssertion(smtutil::Expression const& _e); | ||
| size_t solverStackHeight() { return m_assertions.size(); } const | ||
| size_t solverStackHeight() const { return m_assertions.size(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol this is a funny one, the const in the current version actually carries over to the next function and makes the return value pointer const (const smtutil::SolverInterface*). In any case, I dont think this (the solver method) is used anywhere, either.
dcf23ec to
5b773a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
Ah but actually @phrwlk could you rebase again? We are avoiding merge commits on the main |
|
6daae41 to
68364ab
Compare
done |
clear()/solver() from EncodingContext
Remove unused EncodingContext::clear() and EncodingContext::solver() from libsolidity/formal/EncodingContext.{h,cpp}.