diff options
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r-- | gcc/objc/objc-act.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index cda345b..ff5d1e5 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "tree-iterator.h" #include "hash-table.h" +#include "wide-int.h" #include "langhooks-def.h" /* Different initialization, code gen and meta data generation for each runtime. */ @@ -4899,12 +4900,10 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags) number = TREE_VALUE (second_argument); if (number && TREE_CODE (number) == INTEGER_CST - && TREE_INT_CST_HIGH (number) == 0) - { - TREE_VALUE (second_argument) - = build_int_cst (integer_type_node, - TREE_INT_CST_LOW (number) + 2); - } + && !wi::eq_p (number, 0)) + TREE_VALUE (second_argument) + = wide_int_to_tree (TREE_TYPE (number), + wi::add (number, 2)); /* This is the third argument, the "first-to-check", which specifies the index of the first argument to @@ -4914,13 +4913,10 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags) number = TREE_VALUE (third_argument); if (number && TREE_CODE (number) == INTEGER_CST - && TREE_INT_CST_HIGH (number) == 0 - && TREE_INT_CST_LOW (number) != 0) - { - TREE_VALUE (third_argument) - = build_int_cst (integer_type_node, - TREE_INT_CST_LOW (number) + 2); - } + && !wi::eq_p (number, 0)) + TREE_VALUE (third_argument) + = wide_int_to_tree (TREE_TYPE (number), + wi::add (number, 2)); } filtered_attributes = chainon (filtered_attributes, new_attribute); @@ -4952,15 +4948,11 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags) { /* Get the value of the argument and add 2. */ tree number = TREE_VALUE (argument); - if (number - && TREE_CODE (number) == INTEGER_CST - && TREE_INT_CST_HIGH (number) == 0 - && TREE_INT_CST_LOW (number) != 0) - { - TREE_VALUE (argument) - = build_int_cst (integer_type_node, - TREE_INT_CST_LOW (number) + 2); - } + if (number && TREE_CODE (number) == INTEGER_CST + && !wi::eq_p (number, 0)) + TREE_VALUE (argument) + = wide_int_to_tree (TREE_TYPE (number), + wi::add (number, 2)); argument = TREE_CHAIN (argument); } |