gimple-match: Make code_helper conversions explicit
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 30 Nov 2021 09:52:24 +0000 (09:52 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 30 Nov 2021 09:52:24 +0000 (09:52 +0000)
commit0c1fb64d961eb760aba2601870f19be2b5533bd3
tree1e39c421a085a3548b643bbed9c779cd43f045c4
parent33973fa754de1f95d459bfca66c0d80deec36537
gimple-match: Make code_helper conversions explicit

code_helper provides conversions to tree_code and combined_fn.
Now that the codebase is C++11, we can mark these conversions as
explicit.  This avoids accidentally using code_helpers with
functions that take tree_codes, which would previously entail
a hidden unchecked conversion.

gcc/
* gimple-match.h (code_helper): Provide == and != overloads.
(code_helper::operator tree_code): Make explicit.
(code_helper::operator combined_fn): Likewise.
* gimple-match-head.c (convert_conditional_op): Use explicit
conversions where necessary.
(gimple_resimplify1, gimple_resimplify2, gimple_resimplify3): Likewise.
(maybe_push_res_to_seq, gimple_simplify): Likewise.
* gimple-fold.c (replace_stmt_with_simplification): Likewise.
gcc/gimple-fold.c
gcc/gimple-match-head.c
gcc/gimple-match.h