Allow comparing all pointer types to nil

This commit is contained in:
2025-02-03 23:04:00 +01:00
parent 607bf09434
commit aab16e4941
7 changed files with 187 additions and 98 deletions

View File

@ -23,6 +23,12 @@ namespace gcc
return TREE_CODE(type) == POINTER_TYPE;
}
bool are_compatible_pointers(tree lhs, tree rhs)
{
return (lhs == null_pointer_node || rhs == null_pointer_node)
&& is_pointer_type(TREE_TYPE(lhs)) && is_pointer_type(TREE_TYPE(rhs));
}
tree tree_chain_base::head()
{
return first;