Macro for common OP checks: "is this X or was it before NULLing?"
For example,
if (OP_TYPE_IS_OR_WAS(o, OP_LIST))
...
is now available instead of either of the following:
if ( o
&& ( o->op_type == OP_LIST
|| (o->op_type == OP_NULL
&& o->op_targ == OP_LIST) ) )
...
if ( o &&
(o->op_type == OP_NULL ? o->op_targ ? o->op_type) == OP_LIST )
...
In case the above logic is a bit unclear: It checks whether that OP is
an OP_LIST or used to be one before being NULLed using op_null.
(FTR, the resulting OP_NULLs have their op_targ set to the old OP type).
This sort of check (and it's reverse "isn't and didn't use to be") are a
relatively common pattern in the part of op.c that tries to intuit
structures from optimization-mangled OP trees. Hopefully, using these
macros will make some code a fair amount clearer.