Add null identifiers to genmatch
This patch adds a null identifier that can never match anything and
can never be generated. It is only valid in operator lists and fors.
Later patches will add uses of it.
The idea is to allow operator lists for maths functions that have
four entries:
- float built-in
- double built-in
- long double built-in
- internal function
Not all maths functions have an associated internal function,
and for those the final operator will be "null". Any simplification
that tries to use a null substitution will be skipped.
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
gcc/
* doc/match-and-simplify.texi: Document the "null" identifier.
* genmatch.c (id_base::NULL_ID): New kind.
(null_id): New variable.
(get_operator): Add a parameter that says whether null identifiers
are allowed.
(contains_id): New function.
(lower_for): Skip substitutions that would have a null_id in
either the match or the result.
(parser::parse_for): Allow the null identifier to be used.
(parser::parse_operator_list): Likewise.
(main): Initialize null_id.
From-SVN: r230485