Skip to content

Commit 8cbe8ef

Browse files
committed
add a formatter for address_of_exprt
1 parent 0ed6acd commit 8cbe8ef

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
@@ -303,6 +303,12 @@ void format_expr_configt::setup()
303303
return format_rec(os, to_constant_expr(expr));
304304
};
305305

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

0 commit comments

Comments
 (0)