Conversation
src/ansi-c/ansi_c_entry_point.cpp
Outdated
| index.copy_to_operands(zero_string, from_integer(0, uint_type())); | ||
| exprt address_of("address_of", pointer_typet()); | ||
| address_of.type().subtype()=char_type(); | ||
| exprt address_of("address_of", pointer_type(char_type())); |
There was a problem hiding this comment.
Please use address_of_exprt
There was a problem hiding this comment.
Happy to approve once pushed.
src/cpp/cpp_constructor.cpp
Outdated
| address_of.type().subtype()=object_tc.type(); | ||
| address_of.copy_to_operands(object_tc); | ||
| exprt address_of= | ||
| address_of_exprt(object_tc, pointer_type(object_tc.type())); |
There was a problem hiding this comment.
address_of_exprt address_of(object_tc...);
src/cpp/cpp_destructor.cpp
Outdated
| address_of.type().subtype()=object.type(); | ||
| address_of.copy_to_operands(object); | ||
| exprt address_of= | ||
| address_of_exprt(object, pointer_type(object.type())); |
| index_exprt index( | ||
| expr, | ||
| from_integer(0, index_type()), | ||
| expr.type().subtype()); |
There was a problem hiding this comment.
The third argument is not necessary
| expr_pfrom, pto, expr_ptmp, tmp_rank)) | ||
| // try derived-to-base conversion | ||
| exprt expr_pfrom= | ||
| address_of_exprt(expr, pointer_type(expr.type())); |
There was a problem hiding this comment.
addres_of_exprt expr_pfrom...
src/goto-symex/auto_objects.cpp
Outdated
|
|
||
| address_of_exprt address_of_expr= | ||
| address_of_exprt(make_auto_object(type.subtype())); | ||
| address_of_exprt( |
There was a problem hiding this comment.
Use constructor, not assignment
|
|
||
| #include <util/namespace.h> | ||
| #include <util/std_expr.h> | ||
| #include <util/c_types.h> |
| #include <util/arith_tools.h> | ||
| #include <util/ieee_float.h> | ||
| #include <util/simplify_expr.h> | ||
| #include <util/c_types.h> |
src/solvers/smt2/smt2_conv.cpp
Outdated
| #include <util/base_type.h> | ||
| #include <util/string2int.h> | ||
| #include <util/invariant.h> | ||
| #include <util/c_types.h> |
|
|
||
| \*******************************************************************/ | ||
|
|
||
| address_of_exprt::address_of_exprt(const exprt &_op): |
There was a problem hiding this comment.
Is this actually being used? Most (all?) calls above appear to use a two-argument constructor
There was a problem hiding this comment.
Now using it more.
894a5b3 to
c73ee7a
Compare
src/ansi-c/ansi_c_entry_point.cpp
Outdated
There was a problem hiding this comment.
Could use array_of_exprt array_of(... here
src/ansi-c/ansi_c_entry_point.cpp
Outdated
There was a problem hiding this comment.
index_exprt index_expr(...) and the lines below should be eliminated
src/ansi-c/ansi_c_entry_point.cpp
Outdated
There was a problem hiding this comment.
index_exprt index_expr(... and again code below to be eliminated
There was a problem hiding this comment.
Might be a candidate for address_of_exprt address_of(...
There was a problem hiding this comment.
Unfortunately not, as this might turn into a dereference expression.
c73ee7a to
9dd44d6
Compare
9dd44d6 to
db71221
Compare
This is in preparation for giving pointers a width (much like integers), using constructors and a service function to produce pointer and reference types whenever appropriate.
Split off PR #970.