diff options
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 0439272..685eb72 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -355,68 +355,6 @@ avoid_overflow_infinity (tree val) } -/* Return true if ARG is marked with the nonnull attribute in the - current function signature. */ - -static bool -nonnull_arg_p (const_tree arg) -{ - tree t, attrs, fntype; - unsigned HOST_WIDE_INT arg_num; - - gcc_assert (TREE_CODE (arg) == PARM_DECL && POINTER_TYPE_P (TREE_TYPE (arg))); - - /* The static chain decl is always non null. */ - if (arg == cfun->static_chain_decl) - return true; - - /* THIS argument of method is always non-NULL. */ - if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE - && arg == DECL_ARGUMENTS (current_function_decl) - && flag_delete_null_pointer_checks) - return true; - - /* Values passed by reference are always non-NULL. */ - if (TREE_CODE (TREE_TYPE (arg)) == REFERENCE_TYPE - && flag_delete_null_pointer_checks) - return true; - - fntype = TREE_TYPE (current_function_decl); - for (attrs = TYPE_ATTRIBUTES (fntype); attrs; attrs = TREE_CHAIN (attrs)) - { - attrs = lookup_attribute ("nonnull", attrs); - - /* If "nonnull" wasn't specified, we know nothing about the argument. */ - if (attrs == NULL_TREE) - return false; - - /* If "nonnull" applies to all the arguments, then ARG is non-null. */ - if (TREE_VALUE (attrs) == NULL_TREE) - return true; - - /* Get the position number for ARG in the function signature. */ - for (arg_num = 1, t = DECL_ARGUMENTS (current_function_decl); - t; - t = DECL_CHAIN (t), arg_num++) - { - if (t == arg) - break; - } - - gcc_assert (t == arg); - - /* Now see if ARG_NUM is mentioned in the nonnull list. */ - for (t = TREE_VALUE (attrs); t; t = TREE_CHAIN (t)) - { - if (compare_tree_int (TREE_VALUE (t), arg_num) == 0) - return true; - } - } - - return false; -} - - /* Set value range VR to VR_UNDEFINED. */ static inline void |