Clean up in the value set API#4690
Conversation
501cf06 to
46ffcec
Compare
|
@romainbrenguier Various CI steps in Travis are failing. |
src/pointer-analysis/value_set.h
Outdated
| /// to the internal map. | ||
| /// instead of a set of pairs to make lookup by `exprt` easier. | ||
| class object_map_dt | ||
| : public std::map<object_numberingt::number_type, offsett> |
There was a problem hiding this comment.
This basically is a revert of 3b5263f. We should have really good reasons if that's what should happen.
There was a problem hiding this comment.
Ok I see. I will drop that commit for now and try to find a better solution
|
|
||
| /// Appears to be unimplemented. | ||
| DEPRECATED(SINCE(2019, 05, 22, "Unimplemented")) | ||
| expr_sett &get(const irep_idt &identifier, const std::string &suffix); |
There was a problem hiding this comment.
I think we can just remove what isn't even implemented.
There was a problem hiding this comment.
I don't know. In test-gen there were cases of cpp files used instead of the cbmc ones which could add new implementation not existing in cbmc
|
@owen-jones-diffblue could you check if |
| void | ||
| get_value_set(const exprt &expr, value_setst::valuest &dest) const override; | ||
|
|
||
| std::list<exprt> get_value_set(const exprt &expr) const override; |
There was a problem hiding this comment.
If we're adding a new entry-point we probably shouldn't use std::list, there's no call for a doubly-linked list here AFAICT
There was a problem hiding this comment.
but it is a list, and the fact that value_setst::valuest is a list is public, by writing value_setst::valuest we are just making it more complicated for the reader
There was a problem hiding this comment.
I'm not suggesting valuest, I'm suggesting std::vector because that's the most performant C++ sequence container when you don't have a good reason for something else (e.g. deque or list)
46ffcec to
8265d1f
Compare
|
@tautschnig @smowton here is a PR to go instead of the std::map inheritance #4694 |
|
@smowton It does, but we can just add that field ourselves |
|
actually it seems location_number is used by value_set_domain_templatet so I will have to drop that commit too... |
f015a95 to
1d13bfa
Compare
|
@smowton I have now replace the use of list by vector |
| goto_symext::statet &state; | ||
| const namespacet &ns; | ||
|
|
||
| DEPRECATED(SINCE(2019, 05, 22, "use list returning version instead")) |
| public: | ||
| virtual ~dereference_callbackt() = default; | ||
|
|
||
| DEPRECATED(SINCE(2019, 05, 22, "use list returning version instead")) |
src/pointer-analysis/value_sets.h
Outdated
| typedef std::list<exprt> valuest; | ||
|
|
||
| // this is not const to allow a lazy evaluation | ||
| DEPRECATED(SINCE(2019, 05, 22, "use list returning version instead")) |
c138014 to
9b387f1
Compare
9b387f1 to
a4b2eed
Compare
|
@owen-jones-diffblue @smowton I've added a commit which gets rid of doxygen warning that were generated for this pull request, in case you want to have a look |
|
@romainbrenguier Please rebase now that #4729 is in to make CI happy. |
a4b2eed to
88cc5c5
Compare
40b65af to
27f87e8
Compare
allredj
left a comment
There was a problem hiding this comment.
✔️
Passed Diffblue compatibility checks (cbmc commit: 27f87e8).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/113842424
This avoids having to create a tmp expression and allows moving into the function.
This is unused
This is not implemented.
This is unused.
These return the computed value, which makes the information flow clearer in the program. We deprecate at the same time the functions from the previous version.
vectors are generally more efficient than list, unless we use concatenation or insertion which doesn't appear to be case here.
This prevents the macro from making doxyfile miss method definitions that are deprecated and automatically add the deprecated methods to the Deprecated List generated by doxygen
27f87e8 to
fa1412c
Compare
allredj
left a comment
There was a problem hiding this comment.
✔️
Passed Diffblue compatibility checks (cbmc commit: fa1412c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/114073541
Several methods/members of value set are actually not used and should be deprecated to simplify the API.
The
get_value_setinterface in which the result has to be given as argument is also not clear and it is better to return the result.