Skip to content

Commit f9af202

Browse files
committed
format_expr now formats address_of_exprt
This adds a formatter to format_expr for address_of_exprt expressions.
1 parent ef65118 commit f9af202

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util/format_expr.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ void format_expr_configt::setup()
304304
return format_rec(os, to_constant_expr(expr));
305305
};
306306

307+
expr_map[ID_address_of] =
308+
[](std::ostream &os, const exprt &expr) -> std::ostream & {
309+
const auto &address_of = to_address_of_expr(expr);
310+
return os << "address_of(" << format(address_of.object()) << ')';
311+
};
312+
307313
expr_map[ID_annotated_pointer_constant] =
308314
[](std::ostream &os, const exprt &expr) -> std::ostream & {
309315
const auto &annotated_pointer = to_annotated_pointer_constant_expr(expr);

0 commit comments

Comments
 (0)