]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-decl.c (grokdeclarator): Update.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Mon, 1 Apr 2002 20:26:18 +0000 (20:26 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Mon, 1 Apr 2002 20:26:18 +0000 (20:26 +0000)
* c-decl.c (grokdeclarator): Update.
* c-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
* c-tree.h (c_mark_addressable): New.
* c-typeck.c (default_function_array_conversion, build_unary_op,
build_array_ref, convert_for_assignment): Update.
(mark_addressable): Rename.
* calls.c (try_to_integrate, expand_call): Use langhook.
* expr.c (expand_expr): Use langhook.
* langhooks-def.h (LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): New hook.
* stmt.c (expand_asm_operands): Use langhook.
* tree.h (mark_addressable): Remove.
ada:
* decl.c (gnat_to_gnu_entity): Update.
* gigi.h (mark_addressable): Rename.
* misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
* trans.c (tree_transform): Update.
* utils.c (create_var_decl): Update.
* util2.c (build_binary_op, build_unary_op,
fill_vms_descriptor): Update.
(mark_addressable): Rename, update.
cp:
* call.c (build_addr_func): Update.
* class.c (resolve_address_of_overloaded_function): Update.
* cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
* cp-tree.h (cxx_mark_addressable): New.
* decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update.
* decl2.c (build_cleanup): Update.
* except.c (build_throw): Update.
* init.c (resolve_offset_ref): Update.
* pt.c (convert_nontype_argument): Update.
* semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update.
* typeck.c (decay_conversion, build_array_ref, build_unary_op,
unary_complex_lvalue): Update.
(mark_addressable): Rename.
f:
* com.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
(mark_addressable): Rename.
(ffecom_arrayref_, ffecom_1): Update.
java:
* java-tree.h (java_mark_addressable): New.
* lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
* typeck.c (mark_addressable): Rename, update.
objc:
* objc-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.

From-SVN: r51705

37 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/decl.c
gcc/ada/gigi.h
gcc/ada/misc.c
gcc/ada/trans.c
gcc/ada/utils.c
gcc/ada/utils2.c
gcc/c-decl.c
gcc/c-lang.c
gcc/c-tree.h
gcc/c-typeck.c
gcc/calls.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/cp-lang.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/except.c
gcc/cp/init.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/expr.c
gcc/f/ChangeLog
gcc/f/com.c
gcc/java/ChangeLog
gcc/java/java-tree.h
gcc/java/lang.c
gcc/java/typeck.c
gcc/langhooks-def.h
gcc/langhooks.h
gcc/objc/objc-lang.c
gcc/stmt.c
gcc/tree.h

index b9b882cea246cf8681bcff3e49b49f0efb3187d7..d06f8cf2e5ae65534e5880412aa2bedd5ed0eb29 100644 (file)
@@ -1,3 +1,20 @@
+2002-04-01  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * c-decl.c (grokdeclarator): Update.
+       * c-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+       * c-tree.h (c_mark_addressable): New.
+       * c-typeck.c (default_function_array_conversion, build_unary_op,
+       build_array_ref, convert_for_assignment): Update.
+       (mark_addressable): Rename.
+       * calls.c (try_to_integrate, expand_call): Use langhook.
+       * expr.c (expand_expr): Use langhook.
+       * langhooks-def.h (LANG_HOOKS_INITIALIZER): Update.
+       * langhooks.h (struct lang_hooks): New hook.
+       * stmt.c (expand_asm_operands): Use langhook.
+       * tree.h (mark_addressable): Remove.
+objc:
+       * objc-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+
 2002-04-01  Bob Wilson  <bob.wilson@acm.org>
 
         * config/xtensa/xtensa.c (xtensa_va_arg): Fix compiler warning
index 8e7367f6cb482e231e7588a4d9d305f124c2f171..545940f97f09dc39ac5a7a8832942397d2a8c287 100644 (file)
@@ -1,3 +1,14 @@
+2002-04-01  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * decl.c (gnat_to_gnu_entity): Update.
+       * gigi.h (mark_addressable): Rename.
+       * misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+       * trans.c (tree_transform): Update.
+       * utils.c (create_var_decl): Update.
+       * util2.c (build_binary_op, build_unary_op,
+       fill_vms_descriptor): Update.
+       (mark_addressable): Rename, update.
+
 2002-04-01  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * gigi.h (unsigned_type, signed_type, signed_or_unsigned_type):
index 32cd00e318c39dbaa552880ea76562ad9eaead80..adf1d35744bd9d9d3bfe3f0df1ac90bc76f43bf9 100644 (file)
@@ -1055,7 +1055,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
        if (Has_Nested_Block_With_Handler (Scope (gnat_entity))
            && Exception_Mechanism != GCC_ZCX)
          {
-           mark_addressable (gnu_decl);
+           gnat_mark_addressable (gnu_decl);
            flush_addressof (gnu_decl);
          }
 
index 32fcaef7c41e11fbfa1b0ede979a7a9b192f52a0..7342117620f522b92bd502a384fb0a23f17d9f10 100644 (file)
@@ -727,8 +727,8 @@ extern tree build_allocator PARAMS((tree, tree, tree, Entity_Id,
 extern tree fill_vms_descriptor PARAMS((tree, Entity_Id));
 
 /* Indicate that we need to make the address of EXPR_NODE and it therefore
-   should not be allocated in a register. Return 1 if successful.  */
-extern int mark_addressable    PARAMS((tree));
+   should not be allocated in a register.  Return true if successful.  */
+extern bool gnat_mark_addressable PARAMS((tree));
 
 /* These functions return the basic data type sizes and related parameters
    about the target machine.  */
index 866afc3a0237f1ccad2880075049a999f1bd59b3..520b02948ab0dc37cf05c71612662606b140d3b4 100644 (file)
@@ -114,6 +114,8 @@ static rtx gnat_expand_expr         PARAMS ((tree, rtx, enum machine_mode,
 #define LANG_HOOKS_GET_ALIAS_SET       gnat_get_alias_set
 #undef LANG_HOOKS_EXPAND_EXPR
 #define LANG_HOOKS_EXPAND_EXPR         gnat_expand_expr
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE    gnat_mark_addressable
 #undef LANG_HOOKS_PRINT_DECL
 #define LANG_HOOKS_PRINT_DECL          gnat_print_decl
 #undef LANG_HOOKS_PRINT_TYPE
index 19c7b01bbf79ab7ae19d1ddc79c0f156f3a45fa2..371f7f2be2b874955ea568cc82a3c88a4e4018aa 100644 (file)
@@ -421,7 +421,7 @@ tree_transform (gnat_node)
         right now.  */
       if (TREE_VALUE (gnu_except_ptr_stack) != 0)
        {
-         mark_addressable (gnu_result);
+         gnat_mark_addressable (gnu_result);
          flush_addressof (gnu_result);
        }
 
@@ -4764,9 +4764,10 @@ convert_with_check (gnat_type, gnu_expr, overflow_p, range_p, truncate_p)
   return convert (gnu_type, gnu_result);
 }
 \f
-/* Return 1 if GNU_EXPR can be directly addressed.  This is the case unless
-   it is an expression involving computation or if it involves a bitfield
-   reference.  This returns the same as mark_addressable in most cases.  */
+/* Return 1 if GNU_EXPR can be directly addressed.  This is the case
+   unless it is an expression involving computation or if it involves
+   a bitfield reference.  This returns the same as
+   gnat_mark_addressable in most cases.  */
 
 static int
 addressable_p (gnu_expr)
index 58b7af6445ae2ac23460b5d7920b2fabdf210134..556e0128a9cd886253b324d0299370c080407e5b 100644 (file)
@@ -1361,7 +1361,7 @@ create_var_decl (var_name, asm_name, type, var_init, const_flag, public_flag,
 
   /* If this is volatile, force it into memory.  */
   if (TREE_SIDE_EFFECTS (var_decl))
-    mark_addressable (var_decl);
+    gnat_mark_addressable (var_decl);
 
   if (TREE_CODE (var_decl) != CONST_DECL)
     rest_of_decl_compilation (var_decl, 0, global_bindings_p (), 0);
index 2872474bac82f590572c17301b7dd3a4168c92c3..0e8ada4041ae11623d6ea44af37618ed938032ee 100644 (file)
@@ -817,7 +817,7 @@ build_binary_op (op_code, result_type, left_operand, right_operand)
       if (! TREE_CONSTANT (right_operand)
          || ! TREE_CONSTANT (TYPE_MIN_VALUE (right_type))
          || op_code == ARRAY_RANGE_REF)
-       mark_addressable (left_operand);
+       gnat_mark_addressable (left_operand);
 
       modulus = 0;
       break;
@@ -1238,7 +1238,7 @@ build_unary_op (op_code, result_type, operand)
          if (type != error_mark_node)
            operation_type = build_pointer_type (type);
 
-         mark_addressable (operand);
+         gnat_mark_addressable (operand);
          result = fold (build1 (ADDR_EXPR, operation_type, operand));
        }
 
@@ -1991,7 +1991,7 @@ fill_vms_descriptor (expr, gnat_formal)
   tree const_list = 0;
 
   expr = maybe_unconstrained_array (expr);
-  mark_addressable (expr);
+  gnat_mark_addressable (expr);
 
   for (field = TYPE_FIELDS (record_type); field; field = TREE_CHAIN (field))
     {
@@ -2009,10 +2009,10 @@ fill_vms_descriptor (expr, gnat_formal)
 }
 
 /* Indicate that we need to make the address of EXPR_NODE and it therefore
-   should not be allocated in a register. Return 1 if successful.  */
+   should not be allocated in a register.  Returns true if successful.  */
 
-int
-mark_addressable (expr_node)
+bool
+gnat_mark_addressable (expr_node)
      tree expr_node;
 {
   while (1)
@@ -2030,24 +2030,24 @@ mark_addressable (expr_node)
 
       case CONSTRUCTOR:
        TREE_ADDRESSABLE (expr_node) = 1;
-       return 1;
+       return true;
 
       case VAR_DECL:
       case PARM_DECL:
       case RESULT_DECL:
        put_var_into_stack (expr_node);
        TREE_ADDRESSABLE (expr_node) = 1;
-       return 1;
+       return true;
 
       case FUNCTION_DECL:
        TREE_ADDRESSABLE (expr_node) = 1;
-       return 1;
+       return true;
 
       case CONST_DECL:
        return (DECL_CONST_CORRESPONDING_VAR (expr_node) != 0
-               && (mark_addressable
+               && (gnat_mark_addressable
                    (DECL_CONST_CORRESPONDING_VAR (expr_node))));
       default:
-       return 1;
+       return true;
     }
 }
index 773beda78279767a442d73065bdaacfc686acaf7..acb71e589c13c499d387229c579078a3f52e30ce 100644 (file)
@@ -5022,7 +5022,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
        Otherwise, the fact that those components are volatile
        will be ignored, and would even crash the compiler.  */
     if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (decl)))
-      mark_addressable (decl);
+      c_mark_addressable (decl);
 
     decl_attributes (&decl, returned_attrs, 0);
 
index 735017b1fa7e094e29b484f973a2b6a2996c2a51..278a252bffdea2f3675a1b5cb2b165766fa62ffd 100644 (file)
@@ -54,6 +54,8 @@ static void c_post_options PARAMS ((void));
 #define LANG_HOOKS_MARK_TREE c_mark_tree
 #undef LANG_HOOKS_EXPAND_EXPR
 #define LANG_HOOKS_EXPAND_EXPR c_expand_expr
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE c_common_parse_file
 #undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
index 12ae456adb8c2abaf51be5023b82e79127c092b6..503e04519125f831cd8b04f7568663a411ff8ffd 100644 (file)
@@ -248,6 +248,7 @@ extern tree require_complete_type           PARAMS ((tree));
 extern int comptypes                           PARAMS ((tree, tree));
 extern tree c_sizeof_nowarn                    PARAMS ((tree));
 extern tree c_size_in_bytes                     PARAMS ((tree));
+extern bool c_mark_addressable                 PARAMS ((tree));
 extern tree build_component_ref                 PARAMS ((tree, tree));
 extern tree build_indirect_ref                  PARAMS ((tree, const char *));
 extern tree build_array_ref                     PARAMS ((tree, tree));
index 2c7a89a83a91f978646efe444e0f1d4f900a886d..7bca9aad5fe58af5b121f0ace9ce917577a0705a 100644 (file)
@@ -932,7 +932,7 @@ default_function_array_conversion (exp)
             is not the target type of the type of the ADDR_EXPR itself.
             Question is, can this lossage be avoided?  */
          adr = build1 (ADDR_EXPR, ptrtype, exp);
-         if (mark_addressable (exp) == 0)
+         if (!c_mark_addressable (exp))
            return error_mark_node;
          TREE_CONSTANT (adr) = staticp (exp);
          TREE_SIDE_EFFECTS (adr) = 0;   /* Default would be, same as EXP.  */
@@ -1317,7 +1317,7 @@ build_array_ref (array, index)
          || (COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (array)))
              && TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array)))) != INTEGER_CST))
        {
-         if (mark_addressable (array) == 0)
+         if (!c_mark_addressable (array))
            return error_mark_node;
        }
       /* An array that is indexed by a constant value which is not within
@@ -1328,7 +1328,7 @@ build_array_ref (array, index)
          && TYPE_VALUES (TREE_TYPE (array))
          && ! int_fits_type_p (index, TYPE_VALUES (TREE_TYPE (array))))
        {
-         if (mark_addressable (array) == 0)
+         if (!c_mark_addressable (array))
            return error_mark_node;
        }
 
@@ -2991,7 +2991,7 @@ build_unary_op (code, xarg, flag)
       /* For &x[y], return x+y */
       if (TREE_CODE (arg) == ARRAY_REF)
        {
-         if (mark_addressable (TREE_OPERAND (arg, 0)) == 0)
+         if (!c_mark_addressable (TREE_OPERAND (arg, 0)))
            return error_mark_node;
          return build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0),
                                  TREE_OPERAND (arg, 1), 1);
@@ -3046,7 +3046,7 @@ build_unary_op (code, xarg, flag)
 
       argtype = build_pointer_type (argtype);
 
-      if (mark_addressable (arg) == 0)
+      if (!c_mark_addressable (arg))
        return error_mark_node;
 
       {
@@ -3265,13 +3265,14 @@ readonly_warning (arg, msgid)
 \f
 /* Mark EXP saying that we need to be able to take the
    address of it; it should not be allocated in a register.
-   Value is 1 if successful.  */
+   Returns true if successful.  */
 
-int
-mark_addressable (exp)
+bool
+c_mark_addressable (exp)
      tree exp;
 {
   tree x = exp;
+
   while (1)
     switch (TREE_CODE (x))
       {
@@ -3280,7 +3281,7 @@ mark_addressable (exp)
          {
            error ("cannot take address of bit-field `%s'",
                   IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (x, 1))));
-           return 0;
+           return false;
          }
 
        /* ... fall through ...  */
@@ -3295,7 +3296,7 @@ mark_addressable (exp)
       case COMPOUND_LITERAL_EXPR:
       case CONSTRUCTOR:
        TREE_ADDRESSABLE (x) = 1;
-       return 1;
+       return true;
 
       case VAR_DECL:
       case CONST_DECL:
@@ -3308,7 +3309,7 @@ mark_addressable (exp)
              {
                error ("global register variable `%s' used in nested function",
                       IDENTIFIER_POINTER (DECL_NAME (x)));
-               return 0;
+               return false;
              }
            pedwarn ("register variable `%s' used in nested function",
                     IDENTIFIER_POINTER (DECL_NAME (x)));
@@ -3319,7 +3320,7 @@ mark_addressable (exp)
              {
                error ("address of global register variable `%s' requested",
                       IDENTIFIER_POINTER (DECL_NAME (x)));
-               return 0;
+               return false;
              }
 
            /* If we are making this addressable due to its having
@@ -3330,7 +3331,7 @@ mark_addressable (exp)
            else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x)))
              {
                error ("cannot put object with volatile field into register");
-               return 0;
+               return false;
              }
 
            pedwarn ("address of register variable `%s' requested",
@@ -3347,7 +3348,7 @@ mark_addressable (exp)
 #endif
 
       default:
-       return 1;
+       return true;
     }
 }
 \f
@@ -4037,7 +4038,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
          error ("cannot pass rvalue to reference parameter");
          return error_mark_node;
        }
-      if (mark_addressable (rhs) == 0)
+      if (!c_mark_addressable (rhs))
        return error_mark_node;
       rhs = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (rhs)), rhs);
 
index cbeb92c20aa3964713d7ad4150f145f4b5f24d6b..197914a9e7a65a2415c428c2ee962a860511ec22 100644 (file)
@@ -1903,7 +1903,7 @@ try_to_integrate (fndecl, actparms, target, ignore, type, structure_value_addr)
       warning_with_decl (fndecl, "inlining failed in call to `%s'");
       warning ("called from here");
     }
-  mark_addressable (fndecl);
+  (*lang_hooks.mark_addressable) (fndecl);
   return (rtx) (size_t) - 1;
 }
 
@@ -2209,7 +2209,7 @@ expand_call (exp, target, ignore)
              warning_with_decl (fndecl, "can't inline call to `%s'");
              warning ("called from here");
            }
-         mark_addressable (fndecl);
+         (*lang_hooks.mark_addressable) (fndecl);
        }
 
       flags |= flags_from_decl_or_type (fndecl);
@@ -2255,7 +2255,7 @@ expand_call (exp, target, ignore)
            /* In case this is a static function, note that it has been
               used.  */
            if (! TREE_ADDRESSABLE (fndecl))
-             mark_addressable (fndecl);
+             (*lang_hooks.mark_addressable) (fndecl);
            is_integrable = 0;
          }
       }
index 6f5c203e6de3385fd2485f52c7a28f3d732f1932..8527f0a9204043ca1514b0c75a25aff02228919a 100644 (file)
@@ -1,3 +1,19 @@
+2002-04-01  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * call.c (build_addr_func): Update.
+       * class.c (resolve_address_of_overloaded_function): Update.
+       * cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+       * cp-tree.h (cxx_mark_addressable): New.
+       * decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update.
+       * decl2.c (build_cleanup): Update.
+       * except.c (build_throw): Update.
+       * init.c (resolve_offset_ref): Update.
+       * pt.c (convert_nontype_argument): Update.
+       * semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update.
+       * typeck.c (decay_conversion, build_array_ref, build_unary_op,
+       unary_complex_lvalue): Update.
+       (mark_addressable): Rename.
+
 2002-04-01  Roger Sayle  <roger@eyesopen.com>
 
        PR c++/5998:
index 8804a61f61e77561ffaf9764f975a5c31a639353..1a74f7483680e5609ec597d4113a6ea2f7baf832 100644 (file)
@@ -355,7 +355,7 @@ build_addr_func (function)
 
       type = build_pointer_type (type);
 
-      if (mark_addressable (function) == 0)
+      if (!cxx_mark_addressable (function))
        return error_mark_node;
 
       addr = build1 (ADDR_EXPR, type, function);
index 1bba932455cd52552547bd673b0ea2d4aae67744..8ce3fc7ab46f63f5b9ff12fa5ada97d2b0181c3f 100644 (file)
@@ -6061,7 +6061,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
       /* The target must be a REFERENCE_TYPE.  Above, build_unary_op
         will mark the function as addressed, but here we must do it
         explicitly.  */
-      mark_addressable (fn);
+      cxx_mark_addressable (fn);
 
       return fn;
     }
index b330fd1021ca43dccf1551e359aeed98abb14eee..f4d3cb0268257b394423c06d6a745a8b758803bd 100644 (file)
@@ -67,6 +67,8 @@ static bool ok_to_generate_alias_set_for_type PARAMS ((tree));
 #define LANG_HOOKS_MARK_TREE cxx_mark_tree
 #undef LANG_HOOKS_UNSAFE_FOR_REEVAL
 #define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE cxx_mark_addressable
 #undef LANG_HOOKS_PRINT_STATISTICS
 #define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
 #undef LANG_HOOKS_PRINT_XNODE
index b7aab09d3139da2d2ad1d8aef7b8ead7be34f45f..dbd955502422fbd257d520dc8e97496d5c4b3d4a 100644 (file)
@@ -3672,6 +3672,7 @@ extern tree pushdecl                              PARAMS ((tree));
 extern void cxx_init_decl_processing           PARAMS ((void));
 extern void cxx_mark_tree                      PARAMS ((tree));
 extern void cxx_insert_default_attributes      PARAMS ((tree));
+extern bool cxx_mark_addressable               PARAMS ((tree));
 extern int toplevel_bindings_p                 PARAMS ((void));
 extern int namespace_bindings_p                        PARAMS ((void));
 extern void keep_next_level                    PARAMS ((int));
index 5ac75fcf615c892b8605e506507364be7add624b..b2b501a7f0f06a3f3ec15f0b11a83f352e48e027 100644 (file)
@@ -8546,7 +8546,7 @@ register_dtor_fn (decl)
   end_cleanup_fn ();
 
   /* Call atexit with the cleanup function.  */
-  mark_addressable (cleanup);
+  cxx_mark_addressable (cleanup);
   cleanup = build_unary_op (ADDR_EXPR, cleanup, 0);
   if (flag_use_cxa_atexit)
     {
@@ -14531,7 +14531,7 @@ cxx_maybe_build_cleanup (decl)
        rval = decl;
       else
        {
-         mark_addressable (decl);
+         cxx_mark_addressable (decl);
          rval = build_unary_op (ADDR_EXPR, decl, 0);
        }
 
index 95dc8e023db2d5ed2aa1871dfc7557da69415649..2eece8aed05abf741fef4398f2e95e490aef4012 100644 (file)
@@ -2567,7 +2567,7 @@ build_cleanup (decl)
     temp = decl;
   else
     {
-      mark_addressable (decl);
+      cxx_mark_addressable (decl);
       temp = build1 (ADDR_EXPR, build_pointer_type (type), decl);
     }
   temp = build_delete (TREE_TYPE (temp), temp,
index 8cbbfa916cb4a464b6e8819c7bf573204858d420..b2d9fe007ab9565c119c997756102e41da2e3f02 100644 (file)
@@ -756,7 +756,7 @@ build_throw (exp)
                                     complete_dtor_identifier, 0);
          cleanup = TREE_VALUE (cleanup);
          mark_used (cleanup);
-         mark_addressable (cleanup);
+         cxx_mark_addressable (cleanup);
          /* Pretend it's a normal function.  */
          cleanup = build1 (ADDR_EXPR, cleanup_type, cleanup);
        }
index de3fd2c39c3b778a43540459e9524d6863bc42d8..10098e72cfad9eea1077abb73bd7cd800be035f3 100644 (file)
@@ -1796,7 +1796,7 @@ resolve_offset_ref (exp)
       || TREE_CODE (TREE_TYPE (member)) == FUNCTION_TYPE)
     {
       /* These were static members.  */
-      if (mark_addressable (member) == 0)
+      if (!cxx_mark_addressable (member))
        return error_mark_node;
       return member;
     }
index e1b6c375113757e80a776806f86e56a9b80b1ce3..d28298a56a3d6d2e9bc06f4debace8ae96300d8c 100644 (file)
@@ -3154,7 +3154,7 @@ convert_nontype_argument (type, expr)
              return error_mark_node;
          }
 
-       mark_addressable (expr);
+       cxx_mark_addressable (expr);
        return build1 (ADDR_EXPR, type, expr);
       }
       break;
index 29e49fa92c07f87eeed1874146e477b7f999591a..8666d7f02c4fbf80e62adca309f12edbff4c050b 100644 (file)
@@ -944,7 +944,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
             DECL_RTL for the OPERAND -- which we don't have at this
             point.  */
          if (!allows_reg && DECL_P (operand))
-           mark_addressable (operand);
+           cxx_mark_addressable (operand);
        }
     }
 
@@ -2204,7 +2204,7 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
     {
       /* Replace the first argument with the address of the third
         argument to the AGGR_INIT_EXPR.  */
-      mark_addressable (slot);
+      cxx_mark_addressable (slot);
       args = tree_cons (NULL_TREE, 
                        build1 (ADDR_EXPR, 
                                build_pointer_type (TREE_TYPE (slot)),
index a68f4a2110a2bfba6aff950ff0506fb19b7ca859..d379809b81ee6a5604d8cc0c33617bc8cf725361 100644 (file)
@@ -1726,7 +1726,7 @@ decay_conversion (exp)
             is not the target type of the type of the ADDR_EXPR itself.
             Question is, can this lossage be avoided?  */
          adr = build1 (ADDR_EXPR, ptrtype, exp);
-         if (mark_addressable (exp) == 0)
+         if (!cxx_mark_addressable (exp))
            return error_mark_node;
          TREE_CONSTANT (adr) = staticp (exp);
          TREE_SIDE_EFFECTS (adr) = 0;   /* Default would be, same as EXP.  */
@@ -2446,7 +2446,7 @@ build_array_ref (array, idx)
              && (TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array))))
                  != INTEGER_CST)))
        {
-         if (mark_addressable (array) == 0)
+         if (!cxx_mark_addressable (array))
            return error_mark_node;
        }
 
@@ -2458,7 +2458,7 @@ build_array_ref (array, idx)
          && TYPE_VALUES (TREE_TYPE (array))
          && ! int_fits_type_p (idx, TYPE_VALUES (TREE_TYPE (array))))
        {
-         if (mark_addressable (array) == 0)
+         if (!cxx_mark_addressable (array))
            return error_mark_node;
        }
 
@@ -4539,7 +4539,7 @@ build_unary_op (code, xarg, noconvert)
       /* For &x[y], return x+y */
       if (TREE_CODE (arg) == ARRAY_REF)
        {
-         if (mark_addressable (TREE_OPERAND (arg, 0)) == 0)
+         if (!cxx_mark_addressable (TREE_OPERAND (arg, 0)))
            return error_mark_node;
          return cp_build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0),
                                     TREE_OPERAND (arg, 1));
@@ -4627,7 +4627,7 @@ build_unary_op (code, xarg, noconvert)
       if (argtype != error_mark_node)
        argtype = build_pointer_type (argtype);
 
-      if (mark_addressable (arg) == 0)
+      if (!cxx_mark_addressable (arg))
        return error_mark_node;
 
       {
@@ -4811,18 +4811,18 @@ unary_complex_lvalue (code, arg)
 \f
 /* Mark EXP saying that we need to be able to take the
    address of it; it should not be allocated in a register.
-   Value is 1 if successful.
+   Value is true if successful.
 
    C++: we do not allow `current_class_ptr' to be addressable.  */
 
-int
-mark_addressable (exp)
+bool
+cxx_mark_addressable (exp)
      tree exp;
 {
   register tree x = exp;
 
   if (TREE_ADDRESSABLE (x) == 1)
-    return 1;
+    return true;
 
   while (1)
     switch (TREE_CODE (x))
@@ -4840,7 +4840,7 @@ mark_addressable (exp)
          {
             error ("cannot take the address of `this', which is an rvalue expression");
            TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */
-           return 1;
+           return true;
          }
       case VAR_DECL:
        /* Caller should not be trying to mark initialized
@@ -4857,24 +4857,24 @@ mark_addressable (exp)
          warning ("address requested for `%D', which is declared `register'",
                      x);
        TREE_ADDRESSABLE (x) = 1;
-       return 1;
+       return true;
 
       case FUNCTION_DECL:
        TREE_ADDRESSABLE (x) = 1;
        TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
-       return 1;
+       return true;
 
       case CONSTRUCTOR:
        TREE_ADDRESSABLE (x) = 1;
-       return 1;
+       return true;
 
       case TARGET_EXPR:
        TREE_ADDRESSABLE (x) = 1;
-       mark_addressable (TREE_OPERAND (x, 0));
-       return 1;
+       cxx_mark_addressable (TREE_OPERAND (x, 0));
+       return true;
 
       default:
-       return 1;
+       return true;
     }
 }
 \f
index cbbcff1a08b86b51c80b38d0ee041da243dc6a40..6f1a0d62eef2f323d039968e4cf48a3dd2640e5f 100644 (file)
@@ -6247,7 +6247,7 @@ expand_expr (exp, target, tmode, modifier)
          DECL_NONLOCAL (exp) = 1;
          if (DECL_NO_STATIC_CHAIN (current_function_decl))
            abort ();
-         mark_addressable (exp);
+         (*lang_hooks.mark_addressable) (exp);
          if (GET_CODE (DECL_RTL (exp)) != MEM)
            abort ();
          addr = XEXP (DECL_RTL (exp), 0);
index 2f0318caf5f4d1b9c6660ec8b4cece934cec1714..e0fbdcde40f54bf89b22b174c0200e69a06d8f9e 100644 (file)
@@ -1,3 +1,9 @@
+Mon Apr  1 21:39:36 2002  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * com.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+       (mark_addressable): Rename.
+       (ffecom_arrayref_, ffecom_1): Update.
+
 Mon Apr  1 09:59:53 2002  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * com.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
index fed208c5263f566401d90209fe7328295c288ee4..97d245aa4a04245d2fcfe334ce0d2b9c69149bb2 100644 (file)
@@ -266,6 +266,7 @@ static tree ffe_type_for_size PARAMS ((unsigned int, int));
 static tree ffe_unsigned_type PARAMS ((tree));
 static tree ffe_signed_type PARAMS ((tree));
 static tree ffe_signed_or_unsigned_type PARAMS ((int, tree));
+static bool ffe_mark_addressable PARAMS ((tree));
 static void ffecom_init_decl_processing PARAMS ((void));
 static tree ffecom_arglist_expr_ (const char *argstring, ffebld args);
 static tree ffecom_widest_expr_type_ (ffebld list);
@@ -860,7 +861,7 @@ ffecom_arrayref_ (tree item, ffebld expr, int want_ptr)
        return item;
 
       if (ffeinfo_where (ffebld_info (expr)) == FFEINFO_whereFLEETING
-         && ! mark_addressable (item))
+         && ! ffe_mark_addressable (item))
        return error_mark_node;
     }
 
@@ -9531,7 +9532,7 @@ ffecom_1 (enum tree_code code, tree type, tree node)
 
   if (code == ADDR_EXPR)
     {
-      if (!mark_addressable (node))
+      if (!ffe_mark_addressable (node))
        assert ("can't mark_addressable this node!" == NULL);
     }
 
@@ -14227,6 +14228,8 @@ static void ffe_mark_tree (tree);
 #define LANG_HOOKS_PARSE_FILE          ffe_parse_file
 #undef  LANG_HOOKS_MARK_TREE
 #define LANG_HOOKS_MARK_TREE           ffe_mark_tree
+#undef  LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE    ffe_mark_addressable
 #undef  LANG_HOOKS_PRINT_IDENTIFIER
 #define LANG_HOOKS_PRINT_IDENTIFIER    ffe_print_identifier
 #undef  LANG_HOOKS_DECL_PRINTABLE_NAME
@@ -14346,8 +14349,8 @@ ffe_init_options ()
   flag_complex_divide_method = 1;
 }
 
-int
-mark_addressable (exp)
+static bool
+ffe_mark_addressable (exp)
      tree exp;
 {
   register tree x = exp;
@@ -14362,7 +14365,7 @@ mark_addressable (exp)
 
       case CONSTRUCTOR:
        TREE_ADDRESSABLE (x) = 1;
-       return 1;
+       return true;
 
       case VAR_DECL:
       case CONST_DECL:
@@ -14374,7 +14377,7 @@ mark_addressable (exp)
            if (TREE_PUBLIC (x))
              {
                assert ("address of global register var requested" == NULL);
-               return 0;
+               return false;
              }
            assert ("address of register variable requested" == NULL);
          }
@@ -14383,7 +14386,7 @@ mark_addressable (exp)
            if (TREE_PUBLIC (x))
              {
                assert ("address of global register var requested" == NULL);
-               return 0;
+               return false;
              }
            assert ("address of register var requested" == NULL);
          }
@@ -14398,7 +14401,7 @@ mark_addressable (exp)
 #endif
 
       default:
-       return 1;
+       return true;
       }
 }
 
index 269bdc2c68aa85e92851ccec4e56666b08b26267..8b5ef4ebac782bfa4c87a9514b73f02b56b3f7a5 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-01  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * java-tree.h (java_mark_addressable): New.
+       * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+       * typeck.c (mark_addressable): Rename, update.
+
 2002-04-01  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * expr.c (build_java_binop): Update.
index 4a55281b2e8b9474694771d5284b9579d7fa12a9..ae26b61cda18e589d5686fdeb948f97626ef837b 100644 (file)
@@ -1039,6 +1039,7 @@ struct lang_type
 extern void java_set_yydebug PARAMS ((int));
 extern void java_parse_file PARAMS ((void));
 extern void java_mark_tree PARAMS ((tree));
+extern bool java_mark_addressable PARAMS ((tree));
 extern tree java_type_for_mode PARAMS ((enum machine_mode, int));
 extern tree java_type_for_size PARAMS ((unsigned int, int));
 extern tree java_unsigned_type PARAMS ((tree));
index 05b5cedf6243fdfe14ff02cd7a72596398e1a642..53e11beaed309b1ff809a18609118dd7e8088905 100644 (file)
@@ -229,6 +229,8 @@ static int dependency_tracking = 0;
 #define LANG_HOOKS_PARSE_FILE java_parse_file
 #undef LANG_HOOKS_MARK_TREE
 #define LANG_HOOKS_MARK_TREE java_mark_tree
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE java_mark_addressable
 #undef LANG_HOOKS_EXPAND_EXPR
 #define LANG_HOOKS_EXPAND_EXPR java_expand_expr
 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
index 5afa5a45879eb5b9833943f6509c43af29869f8a..108f3fbbe1dc0d07cf17c372729e5f8848ec87fb 100644 (file)
@@ -263,10 +263,10 @@ java_unsigned_type (type)
 
 /* Mark EXP saying that we need to be able to take the
    address of it; it should not be allocated in a register.
-   Value is 1 if successful.  */
+   Value is true if successful.  */
 
-int
-mark_addressable (exp)
+bool
+java_mark_addressable (exp)
      tree exp;
 {
   register tree x = exp;
@@ -288,12 +288,12 @@ mark_addressable (exp)
        break;
 
       case COND_EXPR:
-       return mark_addressable (TREE_OPERAND (x, 1))
-         & mark_addressable (TREE_OPERAND (x, 2));
+       return java_mark_addressable (TREE_OPERAND (x, 1))
+         && java_mark_addressable (TREE_OPERAND (x, 2));
 
       case CONSTRUCTOR:
        TREE_ADDRESSABLE (x) = 1;
-       return 1;
+       return true;
 
       case INDIRECT_REF:
        /* We sometimes add a cast *(TYPE*)&FOO to handle type and mode
@@ -309,7 +309,7 @@ mark_addressable (exp)
            x = TREE_OPERAND (x, 0);
            break;
          }
-       return 1;
+       return true;
 
       case VAR_DECL:
       case CONST_DECL:
@@ -323,7 +323,7 @@ mark_addressable (exp)
 #endif
        /* drops through */
       default:
-       return 1;
+       return true;
     }
 }
 
index 8e3ac96c0ea283d8af614fd8d46fd4b06346528a..c922e22a127668ba29f04456c1436c5ff46d1140 100644 (file)
@@ -203,6 +203,7 @@ int lhd_tree_dump_type_quals                        PARAMS ((tree));
   LANG_HOOKS_SAFE_FROM_P, \
   LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
   LANG_HOOKS_UNSAFE_FOR_REEVAL, \
+  LANG_HOOKS_MARK_ADDRESSABLE, \
   LANG_HOOKS_STATICP, \
   LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
   LANG_HOOKS_UNSAVE_EXPR_NOW, \
index c3e5a39a1f01d38b15801d3548463a28e18dc191..804e811d4b57596b857ad4be9cd646e64afb93e1 100644 (file)
@@ -218,6 +218,11 @@ struct lang_hooks
      through.  The default hook returns a negative number.  */
   int (*unsafe_for_reeval) PARAMS ((tree));
 
+  /* Mark EXP saying that we need to be able to take the address of
+     it; it should not be allocated in a register.  Return true if
+     successful.  */
+  bool (*mark_addressable) PARAMS ((tree));
+
   /* Hook called by staticp for language-specific tree codes.  */
   int (*staticp) PARAMS ((tree));
 
index 322a66e32506bbcc6bcc8e1c935e768d8c4fd408..991ecd90060c40a124bf2b1b16a1a4eb05950ac6 100644 (file)
@@ -50,6 +50,8 @@ static void objc_post_options                   PARAMS ((void));
 #define LANG_HOOKS_MARK_TREE c_mark_tree
 #undef LANG_HOOKS_EXPAND_EXPR
 #define LANG_HOOKS_EXPAND_EXPR c_expand_expr
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
 #undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
 #define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
 #undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
index 2db32e870606fff51b023a66c99e7dd3ff2e7019..3f2d29c0858300c7bc7d342a3853f042334ab376 100644 (file)
@@ -1678,7 +1678,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
              || (DECL_P (val)
                  && GET_CODE (DECL_RTL (val)) == REG
                  && GET_MODE (DECL_RTL (val)) != TYPE_MODE (type))))
-       mark_addressable (val);
+       (*lang_hooks.mark_addressable) (val);
 
       if (is_inout)
        ninout++;
@@ -1707,7 +1707,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
        return;
 
       if (! allows_reg && allows_mem)
-       mark_addressable (TREE_VALUE (tail));
+       (*lang_hooks.mark_addressable) (TREE_VALUE (tail));
     }
 
   /* Second pass evaluates arguments.  */
index 8abda682bdc3cedee0ce2aaffcc9b9b66854d05f..74eefe72ea7b775cc148bb6e214e0d62923b8c06 100644 (file)
@@ -2947,7 +2947,6 @@ extern int lang_attribute_common;
 
 /* In front end.  */
 
-extern int mark_addressable            PARAMS ((tree));
 extern void incomplete_type_error      PARAMS ((tree, tree));
 extern tree truthvalue_conversion      PARAMS ((tree));