]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.h: Modify builtin_function interface to take an extra argument ATTRS...
authorRoger Sayle <roger@eyesopen.com>
Mon, 1 Jul 2002 23:07:19 +0000 (23:07 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 1 Jul 2002 23:07:19 +0000 (23:07 +0000)
* tree.h:  Modify builtin_function interface to take an extra
argument ATTRS, which is a tree representing an attribute list.

* c-decl.c (builtin_function): Accept additional parameter.
* objc/objc-act.c (builtin_function): Likewise.
* f/com.c (builtin_function): Likewise.
* java/decl.c (builtin_function): Likewise.
* ada/utils.c (builtin_function): Likewise.
* cp/decl.c (builtin_function): Likewise.
(builtin_function_1): Likewise.

* c-common.c (c_common_nodes_and_builtins): Pass an additional
NULL_TREE argument to builtin_function.  (builtin_function_2):
Likewise.
* cp/call.c (build_java_interface_fn_ref): Likewise.
* objc/objc-act.c (synth_module_prologue): Likewise.
* java/decl.c (java_init_decl_processing): Likewise.
* f/com.c (ffe_com_init_0): Likewise.

* config/alpha/alpha.c (alpha_init_builtins): Pass an additional
NULL_TREE argument builtin_function.
* config/arm/arm.c (def_builtin): Likewise.
* config/c4x/c4x.c (c4x_init_builtins): Likewise.
* config/i386/i386.c (def_builtin): Likewise.
* config/ia64/ia64.c (def_builtin): Likewise.
* config/rs6000/rs6000.c (def_builtin): Likewise.

From-SVN: r55161

19 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/utils.c
gcc/c-common.c
gcc/c-decl.c
gcc/config/alpha/alpha.c
gcc/config/arm/arm.c
gcc/config/c4x/c4x.c
gcc/config/i386/i386.c
gcc/config/ia64/ia64.c
gcc/config/rs6000/rs6000.c
gcc/cp/call.c
gcc/cp/decl.c
gcc/f/ChangeLog
gcc/f/com.c
gcc/java/ChangeLog
gcc/java/decl.c
gcc/objc/objc-act.c
gcc/tree.h

index 0a4291b88510c558e091cf59931069401da49a46..811e9c90ca883cfe0916a0c88e12e2928f2a104c 100644 (file)
@@ -1,3 +1,32 @@
+2002-07-01  Roger Sayle  <roger@eyesopen.com>
+
+       * tree.h:  Modify builtin_function interface to take an extra
+       argument ATTRS, which is a tree representing an attribute list.
+
+       * c-decl.c (builtin_function): Accept additional parameter.
+       * objc/objc-act.c (builtin_function): Likewise.
+       * f/com.c (builtin_function): Likewise.
+       * java/decl.c (builtin_function): Likewise.
+       * ada/utils.c (builtin_function): Likewise.
+       * cp/decl.c (builtin_function): Likewise.
+       (builtin_function_1): Likewise.
+
+       * c-common.c (c_common_nodes_and_builtins): Pass an additional
+       NULL_TREE argument to builtin_function.  (builtin_function_2):
+       Likewise.
+       * cp/call.c (build_java_interface_fn_ref): Likewise.
+       * objc/objc-act.c (synth_module_prologue): Likewise.
+       * java/decl.c (java_init_decl_processing): Likewise.
+       * f/com.c (ffe_com_init_0): Likewise.
+
+       * config/alpha/alpha.c (alpha_init_builtins): Pass an additional
+       NULL_TREE argument to builtin_function.
+       * config/arm/arm.c (def_builtin): Likewise.
+       * config/c4x/c4x.c (c4x_init_builtins): Likewise.
+       * config/i386/i386.c (def_builtin): Likewise.
+       * config/ia64/ia64.c (def_builtin): Likewise.
+       * config/rs6000/rs6000.c (def_builtin): Likewise.
+
 2002-07-01  Zack Weinberg  <zack@codesourcery.com>
 
        * config/ip2k/t-ip2k: Remove LIBGCC1, CROSS_LIBGCC1, and LIBGCC1_TEST.
index 9c4c27741130e42ea7cc3775116d77d891a0ae32..368a9e1e17cd5e77d2280e63407f41203d443d45 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-01  Roger Sayle  <roger@eyesopen.com>
+
+       * ada/utils.c (builtin_function): Accept an additional parameter.
+
 2002-06-28  Andreas Jaeger  <aj@suse.de>
 
        PR ada/7144
index d820401f20f584be458a78cad83bbde2ae1b2695..33980a5f667e5ca6b5d0a1556b82dd48887c7a7d 100644 (file)
@@ -1871,15 +1871,17 @@ end_subprog_body ()
    See tree.h for its possible values.
 
    If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
-   the name to be called if we can't opencode the function.  */
+   the name to be called if we can't opencode the function.  If
+   ATTRS is nonzero, use that for the function attribute list.  */
 
 tree
-builtin_function (name, type, function_code, class, library_name)
+builtin_function (name, type, function_code, class, library_name, attrs)
      const char *name;
      tree type;
      int function_code;
      enum built_in_class class;
      const char *library_name;
+     tree attrs;
 {
   tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
 
@@ -1891,6 +1893,8 @@ builtin_function (name, type, function_code, class, library_name)
   pushdecl (decl);
   DECL_BUILT_IN_CLASS (decl) = class;
   DECL_FUNCTION_CODE (decl) = function_code;
+  if (attrs)
+      decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
   return decl;
 }
 
index c71f75270066cc78194a5e22bf13f2fc8915cfd6..4438abe2a092987d593572912779daf340237492 100644 (file)
@@ -3055,7 +3055,7 @@ c_common_nodes_and_builtins ()
                                 CLASS,                                 \
                                 (FALLBACK_P                            \
                                  ? (NAME + strlen ("__builtin_"))      \
-                                 : NULL));                             \
+                                 : NULL), NULL_TREE);                  \
       else                                                             \
        decl = builtin_function_2 (NAME,                                \
                                   NAME + strlen ("__builtin_"),        \
@@ -3185,7 +3185,8 @@ builtin_function_2 (builtin_name, name, builtin_type, type, function_code,
   if (builtin_name != 0)
     {
       bdecl = builtin_function (builtin_name, builtin_type, function_code,
-                               class, library_name_p ? name : NULL);
+                               class, library_name_p ? name : NULL,
+                               NULL_TREE);
       if (noreturn_p)
        {
          TREE_THIS_VOLATILE (bdecl) = 1;
@@ -3195,7 +3196,8 @@ builtin_function_2 (builtin_name, name, builtin_type, type, function_code,
   if (name != 0 && !flag_no_builtin && !builtin_function_disabled_p (name)
       && !(nonansi_p && flag_no_nonansi_builtin))
     {
-      decl = builtin_function (name, type, function_code, class, NULL);
+      decl = builtin_function (name, type, function_code, class, NULL,
+                              NULL_TREE);
       if (nonansi_p)
        DECL_BUILT_IN_NONANSI (decl) = 1;
       if (noreturn_p)
index 23134e385b7b86c82417b9d97364b6b5a0caf3e3..a32b7835ca1c0ab9280a6c98601c68d48d3e6c5f 100644 (file)
@@ -2961,15 +2961,17 @@ c_make_fname_decl (id, type_dep)
    See tree.h for its possible values.
 
    If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
-   the name to be called if we can't opencode the function.  */
+   the name to be called if we can't opencode the function.  If
+   ATTRS is nonzero, use that for the function's attribute list.  */
 
 tree
-builtin_function (name, type, function_code, class, library_name)
+builtin_function (name, type, function_code, class, library_name, attrs)
      const char *name;
      tree type;
      int function_code;
      enum built_in_class class;
      const char *library_name;
+     tree attrs;
 {
   tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
   DECL_EXTERNAL (decl) = 1;
@@ -2991,7 +2993,10 @@ builtin_function (name, type, function_code, class, library_name)
     C_DECL_ANTICIPATED (decl) = 1;
 
   /* Possibly apply some default attributes to this built-in function.  */
-  decl_attributes (&decl, NULL_TREE, 0);
+  if (attrs)
+    decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
+  else
+    decl_attributes (&decl, NULL_TREE, 0);
 
   return decl;
 }
index b109328d34aa28e07239073038129644c3400a34..9e240058e24cf2325b90d660b41f7c997f4935bd 100644 (file)
@@ -6496,7 +6496,8 @@ alpha_init_builtins ()
   p = zero_arg_builtins;
   for (i = 0; i < ARRAY_SIZE (zero_arg_builtins); ++i, ++p)
     if ((target_flags & p->target_mask) == p->target_mask)
-      builtin_function (p->name, ftype, p->code, BUILT_IN_MD, NULL);
+      builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
+                       NULL, NULL_TREE);
 
   ftype = build_function_type_list (long_integer_type_node,
                                    long_integer_type_node, NULL_TREE);
@@ -6504,7 +6505,8 @@ alpha_init_builtins ()
   p = one_arg_builtins;
   for (i = 0; i < ARRAY_SIZE (one_arg_builtins); ++i, ++p)
     if ((target_flags & p->target_mask) == p->target_mask)
-      builtin_function (p->name, ftype, p->code, BUILT_IN_MD, NULL);
+      builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
+                       NULL, NULL_TREE);
 
   ftype = build_function_type_list (long_integer_type_node,
                                    long_integer_type_node,
@@ -6513,15 +6515,18 @@ alpha_init_builtins ()
   p = two_arg_builtins;
   for (i = 0; i < ARRAY_SIZE (two_arg_builtins); ++i, ++p)
     if ((target_flags & p->target_mask) == p->target_mask)
-      builtin_function (p->name, ftype, p->code, BUILT_IN_MD, NULL);
+      builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
+                       NULL, NULL_TREE);
 
   ftype = build_function_type (ptr_type_node, void_list_node);
   builtin_function ("__builtin_thread_pointer", ftype,
-                   ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD, NULL);
+                   ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD,
+                   NULL, NULL_TREE);
 
   ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
   builtin_function ("__builtin_set_thread_pointer", ftype,
-                   ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, NULL);
+                   ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD,
+                   NULL, NULL_TREE);
 }
 
 /* Expand an expression EXP that calls a built-in function,
index 04212dbc2b2851d171efee34b42f0b1067cbc433..17d77507f60cd4c8a49eb4be06310616f719c05c 100644 (file)
@@ -9303,7 +9303,7 @@ arm_debugger_arg_offset (value, addr)
 }
 
 #define def_builtin(NAME, TYPE, CODE) \
-  builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL)
+  builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, NULL_TREE)
 
 void
 arm_init_builtins ()
index ad2ff6dff3ed2321da9298eb3433cb7b8dbb65ef..1e8814cb584a0ecff5e40513fd408e05bbefd096 100644 (file)
@@ -4923,12 +4923,12 @@ c4x_init_builtins ()
                    build_function_type 
                    (integer_type_node,
                     tree_cons (NULL_TREE, double_type_node, endlink)),
-                   C4X_BUILTIN_FIX, BUILT_IN_MD, NULL);
+                   C4X_BUILTIN_FIX, BUILT_IN_MD, NULL, NULL_TREE);
   builtin_function ("ansi_ftoi",
                    build_function_type 
                    (integer_type_node, 
                     tree_cons (NULL_TREE, double_type_node, endlink)),
-                   C4X_BUILTIN_FIX_ANSI, BUILT_IN_MD, NULL);
+                   C4X_BUILTIN_FIX_ANSI, BUILT_IN_MD, NULL, NULL_TREE);
   if (TARGET_C3X)
     builtin_function ("fast_imult",
                      build_function_type
@@ -4936,24 +4936,24 @@ c4x_init_builtins ()
                       tree_cons (NULL_TREE, integer_type_node,
                                  tree_cons (NULL_TREE,
                                             integer_type_node, endlink))),
-                     C4X_BUILTIN_MPYI, BUILT_IN_MD, NULL);
+                     C4X_BUILTIN_MPYI, BUILT_IN_MD, NULL, NULL_TREE);
   else
     {
       builtin_function ("toieee",
                        build_function_type 
                        (double_type_node,
                         tree_cons (NULL_TREE, double_type_node, endlink)),
-                       C4X_BUILTIN_TOIEEE, BUILT_IN_MD, NULL);
+                       C4X_BUILTIN_TOIEEE, BUILT_IN_MD, NULL, NULL_TREE);
       builtin_function ("frieee",
                        build_function_type
                        (double_type_node, 
                         tree_cons (NULL_TREE, double_type_node, endlink)),
-                       C4X_BUILTIN_FRIEEE, BUILT_IN_MD, NULL);
+                       C4X_BUILTIN_FRIEEE, BUILT_IN_MD, NULL, NULL_TREE);
       builtin_function ("fast_invf",
                        build_function_type 
                        (double_type_node, 
                         tree_cons (NULL_TREE, double_type_node, endlink)),
-                       C4X_BUILTIN_RCPF, BUILT_IN_MD, NULL);
+                       C4X_BUILTIN_RCPF, BUILT_IN_MD, NULL, NULL_TREE);
     }
 }
 
index 46081ba95dc49360704f1ec3f5e8082d5a17fad2..faf723c4921a2a18f7db2040d8db515f40255242 100644 (file)
@@ -11463,10 +11463,11 @@ x86_initialize_trampoline (tramp, fnaddr, cxt)
     }
 }
 \f
-#define def_builtin(MASK, NAME, TYPE, CODE)                            \
-do {                                                                   \
-  if ((MASK) & target_flags)                                           \
-    builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL);      \
+#define def_builtin(MASK, NAME, TYPE, CODE)                    \
+do {                                                           \
+  if ((MASK) & target_flags)                                   \
+    builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD,     \
+                     NULL, NULL_TREE);                         \
 } while (0)
 
 struct builtin_description
index 4f7380af976e8d954a94df44462a81259da97791..be83a4d26c82d235c662610404b62874c0cbb198 100644 (file)
@@ -7542,7 +7542,7 @@ ia64_init_builtins ()
     = build_function_type_list (void_type_node, pdi_type_node, NULL_TREE);
 
 #define def_builtin(name, type, code) \
-  builtin_function ((name), (type), (code), BUILT_IN_MD, NULL)
+  builtin_function ((name), (type), (code), BUILT_IN_MD, NULL, NULL_TREE)
 
   def_builtin ("__sync_val_compare_and_swap_si", si_ftype_psi_si_si,
               IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI);
index 20cb29942ed4d6d57f0cbdad886b99940754c693..6fcf8909f72c875f78b7ea9ca1c59dd3ea25d146 100644 (file)
@@ -3333,10 +3333,11 @@ rs6000_va_arg (valist, type)
 
 /* Builtins.  */
 
-#define def_builtin(MASK, NAME, TYPE, CODE)                            \
-do {                                                                   \
-  if ((MASK) & target_flags)                                           \
-    builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL);      \
+#define def_builtin(MASK, NAME, TYPE, CODE)                    \
+do {                                                           \
+  if ((MASK) & target_flags)                                   \
+    builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD,     \
+                     NULL, NULL_TREE);                         \
 } while (0)
 
 struct builtin_description
index e6f31510d7740b020c5de0de2b8d401d430bc5bb..141c7ac253795922e86de81c783dee8db953c73d 100644 (file)
@@ -4428,7 +4428,7 @@ build_java_interface_fn_ref (fn, instance)
       java_iface_lookup_fn 
        = builtin_function ("_Jv_LookupInterfaceMethodIdx",
                            build_function_type (ptr_type_node, t),
-                           0, NOT_BUILT_IN, NULL);
+                           0, NOT_BUILT_IN, NULL, NULL_TREE);
     }
 
   /* Look up the pointer to the runtime java.lang.Class object for `instance'. 
index e2263fc67073075e5d9ff83b907b4d4351a96929..5d4f78ea6c3ae1d9a44c03d601d654c636669064 100644 (file)
@@ -83,7 +83,8 @@ static void set_identifier_type_value_with_scope
        PARAMS ((tree, tree, struct cp_binding_level *));
 static void record_unknown_type PARAMS ((tree, const char *));
 static tree builtin_function_1 PARAMS ((const char *, tree, tree, int,
-                                      enum built_in_class, const char *));
+                                      enum built_in_class, const char *,
+                                     tree));
 static tree build_library_fn_1 PARAMS ((tree, enum tree_code, tree));
 static int member_function_or_else PARAMS ((tree, tree, enum overload_flags));
 static void bad_specifiers PARAMS ((tree, const char *, int, int, int, int,
@@ -6705,16 +6706,19 @@ cp_make_fname_decl (id, type_dep)
    See tree.h for possible values.
 
    If LIBNAME is nonzero, use that for DECL_ASSEMBLER_NAME,
-   the name to be called if we can't opencode the function.  */
+   the name to be called if we can't opencode the function.
+   If ATTRS is nonzero, use that for the function's attribute
+   list.  */
 
 static tree
-builtin_function_1 (name, type, context, code, class, libname)
+builtin_function_1 (name, type, context, code, class, libname, attrs)
      const char *name;
      tree type;
      tree context;
      int code;
      enum built_in_class class;
      const char *libname;
+     tree attrs;
 {
   tree decl = build_library_fn_1 (get_identifier (name), ERROR_MARK, type);
   DECL_BUILT_IN_CLASS (decl) = class;
@@ -6740,7 +6744,10 @@ builtin_function_1 (name, type, context, code, class, libname)
     DECL_ANTICIPATED (decl) = 1;
 
   /* Possibly apply some default attributes to this built-in function.  */
-  decl_attributes (&decl, NULL_TREE, 0);
+  if (attrs)
+    decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
+  else
+    decl_attributes (&decl, NULL_TREE, 0);
 
   return decl;
 }
@@ -6756,26 +6763,31 @@ builtin_function_1 (name, type, context, code, class, libname)
    See tree.h for possible values.
 
    If LIBNAME is nonzero, use that for DECL_ASSEMBLER_NAME,
-   the name to be called if we can't opencode the function.  */
+   the name to be called if we can't opencode the function.
+
+   If ATTRS is nonzero, use that for the function's attribute
+   list.  */
 
 tree
-builtin_function (name, type, code, class, libname)
+builtin_function (name, type, code, class, libname, attrs)
      const char *name;
      tree type;
      int code;
      enum built_in_class class;
      const char *libname;
+     tree attrs;
 {
   /* All builtins that don't begin with an '_' should additionally
      go in the 'std' namespace.  */
   if (name[0] != '_')
     {
       push_namespace (std_identifier);
-      builtin_function_1 (name, type, std_node, code, class, libname);
+      builtin_function_1 (name, type, std_node, code, class, libname, attrs);
       pop_namespace ();
     }
 
-  return builtin_function_1 (name, type, NULL_TREE, code, class, libname);
+  return builtin_function_1 (name, type, NULL_TREE, code,
+                            class, libname, attrs);
 }
 
 /* Generate a FUNCTION_DECL with the typical flags for a runtime library
index 4c8f42ca31276cdc7a9e21f9a89996fec8b61a1f..44fe4cc258e0261e8d510dfd352c6fcdc8d9af1a 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-01  Roger Sayle  <roger@eyesopen.com>
+
+       * f/com.c (builtin_function): Accept additional parameter.
+       (ffe_com_init_0): Pass an additional NULL_TREE argument to
+       builtin_function.
+
 2002-06-28  Toon Moene  <toon@moene.indiv.nluug.nl>
 
        * news.texi: Mention 2 Gbyte limit on 32-bit targets
index 2fb8caa150e4ea06f28d9a7fdde5c74e5f258c07..45c06c7cefb6fea9cd0e011734506422510da94c 100644 (file)
@@ -11667,23 +11667,23 @@ ffecom_init_0 ()
     = build_function_type (void_type_node, NULL_TREE);
 
   builtin_function ("__builtin_sqrtf", float_ftype_float,
-                   BUILT_IN_SQRTF, BUILT_IN_NORMAL, "sqrtf");
+                   BUILT_IN_SQRTF, BUILT_IN_NORMAL, "sqrtf", NULL_TREE);
   builtin_function ("__builtin_sqrt", double_ftype_double,
-                   BUILT_IN_SQRT, BUILT_IN_NORMAL, "sqrt");
+                   BUILT_IN_SQRT, BUILT_IN_NORMAL, "sqrt", NULL_TREE);
   builtin_function ("__builtin_sqrtl", ldouble_ftype_ldouble,
-                   BUILT_IN_SQRTL, BUILT_IN_NORMAL, "sqrtl");
+                   BUILT_IN_SQRTL, BUILT_IN_NORMAL, "sqrtl", NULL_TREE);
   builtin_function ("__builtin_sinf", float_ftype_float,
-                   BUILT_IN_SINF, BUILT_IN_NORMAL, "sinf");
+                   BUILT_IN_SINF, BUILT_IN_NORMAL, "sinf", NULL_TREE);
   builtin_function ("__builtin_sin", double_ftype_double,
-                   BUILT_IN_SIN, BUILT_IN_NORMAL, "sin");
+                   BUILT_IN_SIN, BUILT_IN_NORMAL, "sin", NULL_TREE);
   builtin_function ("__builtin_sinl", ldouble_ftype_ldouble,
-                   BUILT_IN_SINL, BUILT_IN_NORMAL, "sinl");
+                   BUILT_IN_SINL, BUILT_IN_NORMAL, "sinl", NULL_TREE);
   builtin_function ("__builtin_cosf", float_ftype_float,
-                   BUILT_IN_COSF, BUILT_IN_NORMAL, "cosf");
+                   BUILT_IN_COSF, BUILT_IN_NORMAL, "cosf", NULL_TREE);
   builtin_function ("__builtin_cos", double_ftype_double,
-                   BUILT_IN_COS, BUILT_IN_NORMAL, "cos");
+                   BUILT_IN_COS, BUILT_IN_NORMAL, "cos", NULL_TREE);
   builtin_function ("__builtin_cosl", ldouble_ftype_ldouble,
-                   BUILT_IN_COSL, BUILT_IN_NORMAL, "cosl");
+                   BUILT_IN_COSL, BUILT_IN_NORMAL, "cosl", NULL_TREE);
 
   pedantic_lvalues = FALSE;
 
@@ -13072,12 +13072,14 @@ bison_rule_compstmt_ ()
    See tree.h for its possible values.
 
    If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
-   the name to be called if we can't opencode the function.  */
+   the name to be called if we can't opencode the function.  If
+   ATTRS is nonzero, use that for the function's attribute list.  */
 
 tree
 builtin_function (const char *name, tree type, int function_code,
                  enum built_in_class class,
-                 const char *library_name)
+                 const char *library_name,
+                 tree attrs ATTRIBUTE_UNUSED)
 {
   tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
   DECL_EXTERNAL (decl) = 1;
index 3bcd3f6c3bf1cd24c43e9038c69968fe3dc91d4a..755d40fc579b39a58c0b01fc0d420047246ed3c2 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-01  Roger Sayle  <roger@eyesopen.com>
+
+       * java/decl.c (builtin_function): Accept additional parameter.
+       (java_init_decl_processing): Pass an additional NULL_TREE
+       argument to builtin_function.
+
 2002-06-29  T.J. Mather  <tjmather@maxmind.com>
 
        * gcj.texi: Fixed gcj invocation example so that it compiles.
index e289001b64629026dae25d65e418936779e38f61..bf5e5ff5192b51b21ae1696b8250441065827176 100644 (file)
@@ -358,15 +358,17 @@ push_promoted_type (name, actual_type)
    See tree.h for its possible values.
 
    If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
-   the name to be called if we can't opencode the function.  */
+   the name to be called if we can't opencode the function.  If
+   ATTRS is nonzero, use that for the function's attribute list.  */
 
 tree
-builtin_function (name, type, function_code, class, library_name)
+builtin_function (name, type, function_code, class, library_name, attrs)
      const char *name;
      tree type;
      int function_code;
      enum built_in_class class;
      const char *library_name;
+     tree attrs ATTRIBUTE_UNUSED;
 {
   tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
   DECL_EXTERNAL (decl) = 1;
@@ -750,39 +752,41 @@ java_init_decl_processing ()
                 tree_cons (NULL_TREE, int_type_node, endlink));
   alloc_object_node = builtin_function ("_Jv_AllocObject",
                                        build_function_type (ptr_type_node, t),
-                                       0, NOT_BUILT_IN, NULL);
+                                       0, NOT_BUILT_IN, NULL, NULL_TREE);
   DECL_IS_MALLOC (alloc_object_node) = 1;
   alloc_no_finalizer_node = 
     builtin_function ("_Jv_AllocObjectNoFinalizer",
                      build_function_type (ptr_type_node, t),
-                     0, NOT_BUILT_IN, NULL);
+                     0, NOT_BUILT_IN, NULL, NULL_TREE);
   DECL_IS_MALLOC (alloc_no_finalizer_node) = 1;
 
   t = tree_cons (NULL_TREE, ptr_type_node, endlink);
   soft_initclass_node = builtin_function ("_Jv_InitClass",
                                          build_function_type (void_type_node,
                                                               t),
-                                         0, NOT_BUILT_IN, NULL);
+                                         0, NOT_BUILT_IN, NULL, NULL_TREE);
 
   throw_node = builtin_function ("_Jv_Throw",
                                 build_function_type (ptr_type_node, t),
-                                0, NOT_BUILT_IN, NULL);
+                                0, NOT_BUILT_IN, NULL, NULL_TREE);
   /* Mark throw_nodes as `noreturn' functions with side effects.  */
   TREE_THIS_VOLATILE (throw_node) = 1;
   TREE_SIDE_EFFECTS (throw_node) = 1;
 
   t = build_function_type (int_type_node, endlink);
   soft_monitorenter_node 
-    = builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN, NULL);
+    = builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN,
+                       NULL, NULL_TREE);
   soft_monitorexit_node 
-    = builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN, NULL);
+    = builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN,
+                       NULL, NULL_TREE);
   
   t = tree_cons (NULL_TREE, int_type_node, 
                 tree_cons (NULL_TREE, int_type_node, endlink));
   soft_newarray_node
       = builtin_function ("_Jv_NewPrimArray",
                          build_function_type(ptr_type_node, t),
-                         0, NOT_BUILT_IN, NULL);
+                         0, NOT_BUILT_IN, NULL, NULL_TREE);
   DECL_IS_MALLOC (soft_newarray_node) = 1;
 
   t = tree_cons (NULL_TREE, int_type_node,
@@ -791,7 +795,7 @@ java_init_decl_processing ()
   soft_anewarray_node
       = builtin_function ("_Jv_NewObjectArray",
                          build_function_type (ptr_type_node, t),
-                         0, NOT_BUILT_IN, NULL);
+                         0, NOT_BUILT_IN, NULL, NULL_TREE);
   DECL_IS_MALLOC (soft_anewarray_node) = 1;
 
   t = tree_cons (NULL_TREE, ptr_type_node,
@@ -799,14 +803,14 @@ java_init_decl_processing ()
   soft_multianewarray_node
       = builtin_function ("_Jv_NewMultiArray",
                          build_function_type (ptr_type_node, t),
-                         0, NOT_BUILT_IN, NULL);
+                         0, NOT_BUILT_IN, NULL, NULL_TREE);
   DECL_IS_MALLOC (soft_multianewarray_node) = 1;
 
   t = build_function_type (void_type_node, 
                           tree_cons (NULL_TREE, int_type_node, endlink));
   soft_badarrayindex_node
       = builtin_function ("_Jv_ThrowBadArrayIndex", t, 
-                         0, NOT_BUILT_IN, NULL);
+                         0, NOT_BUILT_IN, NULL, NULL_TREE);
   /* Mark soft_badarrayindex_node as a `noreturn' function with side
      effects.  */
   TREE_THIS_VOLATILE (soft_badarrayindex_node) = 1;
@@ -815,7 +819,7 @@ java_init_decl_processing ()
   soft_nullpointer_node
     = builtin_function ("_Jv_ThrowNullPointerException",
                        build_function_type (void_type_node, endlink),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
   /* Mark soft_nullpointer_node as a `noreturn' function with side
      effects.  */
   TREE_THIS_VOLATILE (soft_nullpointer_node) = 1;
@@ -826,26 +830,26 @@ java_init_decl_processing ()
   soft_checkcast_node
     = builtin_function ("_Jv_CheckCast",
                        build_function_type (ptr_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
   t = tree_cons (NULL_TREE, object_ptr_type_node,
                 tree_cons (NULL_TREE, class_ptr_type, endlink));
   soft_instanceof_node
     = builtin_function ("_Jv_IsInstanceOf",
                        build_function_type (boolean_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
   t = tree_cons (NULL_TREE, object_ptr_type_node,
                 tree_cons (NULL_TREE, object_ptr_type_node, endlink));
   soft_checkarraystore_node
     = builtin_function ("_Jv_CheckArrayStore",
                        build_function_type (void_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
   t = tree_cons (NULL_TREE, ptr_type_node,
                 tree_cons (NULL_TREE, ptr_type_node,
                            tree_cons (NULL_TREE, int_type_node, endlink)));
   soft_lookupinterfacemethod_node 
     = builtin_function ("_Jv_LookupInterfaceMethodIdx",
                        build_function_type (ptr_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
 
   t = tree_cons (NULL_TREE, object_ptr_type_node,
                 tree_cons (NULL_TREE, ptr_type_node,
@@ -853,23 +857,23 @@ java_init_decl_processing ()
   soft_lookupjnimethod_node
     = builtin_function ("_Jv_LookupJNIMethod",
                        build_function_type (ptr_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
   t = tree_cons (NULL_TREE, ptr_type_node, endlink);
   soft_getjnienvnewframe_node
     = builtin_function ("_Jv_GetJNIEnvNewFrame",
                        build_function_type (ptr_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
   soft_jnipopsystemframe_node
     = builtin_function ("_Jv_JNI_PopSystemFrame",
                        build_function_type (ptr_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
 
   t = tree_cons (NULL_TREE, double_type_node,
                 tree_cons (NULL_TREE, double_type_node, endlink));
   soft_fmod_node
     = builtin_function ("__builtin_fmod",
                        build_function_type (double_type_node, t),
-                       BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmod");
+                       BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmod", NULL_TREE);
 
 #if 0
   t = tree_cons (NULL_TREE, float_type_node,
@@ -877,28 +881,28 @@ java_init_decl_processing ()
   soft_fmodf_node
     = builtin_function ("__builtin_fmodf",
                        build_function_type (float_type_node, t),
-                       BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmodf");
+                       BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmodf", NULL_TREE);
 #endif
     
   soft_idiv_node
     = builtin_function ("_Jv_divI",
                        build_function_type (int_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
 
   soft_irem_node
     = builtin_function ("_Jv_remI",
                        build_function_type (int_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
 
   soft_ldiv_node
     = builtin_function ("_Jv_divJ",
                        build_function_type (long_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
 
   soft_lrem_node
     = builtin_function ("_Jv_remJ",
                        build_function_type (long_type_node, t),
-                       0, NOT_BUILT_IN, NULL);
+                       0, NOT_BUILT_IN, NULL, NULL_TREE);
 
   /* Initialize variables for except.c.  */
   eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
index 73e30d71881c199beb74c52cbe12ce22b26dd638..3909e0ca16f89506b74aae6f009fb7a8db4354f6 100644 (file)
@@ -1093,7 +1093,8 @@ synth_module_prologue ()
       pushdecl (umsg_decl);
     }
   else
-    umsg_decl = builtin_function (TAG_MSGSEND, temp_type, 0, NOT_BUILT_IN, 0);
+    umsg_decl = builtin_function (TAG_MSGSEND, temp_type, 0, NOT_BUILT_IN,
+                                 NULL, NULL_TREE);
 
   /* id objc_msgSendSuper (struct objc_super *, SEL, ...); */
 
@@ -1104,7 +1105,8 @@ synth_module_prologue ()
                                                 NULL_TREE)));
 
   umsg_super_decl = builtin_function (TAG_MSGSENDSUPER,
-                                    temp_type, 0, NOT_BUILT_IN, 0);
+                                     temp_type, 0, NOT_BUILT_IN,
+                                     NULL, NULL_TREE);
 
   /* id objc_getClass (const char *); */
 
@@ -1115,12 +1117,14 @@ synth_module_prologue ()
                                              NULL_TREE)));
 
   objc_get_class_decl
-    = builtin_function (TAG_GETCLASS, temp_type, 0, NOT_BUILT_IN, 0);
+    = builtin_function (TAG_GETCLASS, temp_type, 0, NOT_BUILT_IN,
+                       NULL, NULL_TREE);
 
   /* id objc_getMetaClass (const char *); */
 
   objc_get_meta_class_decl
-    = builtin_function (TAG_GETMETACLASS, temp_type, 0, NOT_BUILT_IN, 0);
+    = builtin_function (TAG_GETMETACLASS, temp_type, 0, NOT_BUILT_IN,
+                       NULL, NULL_TREE);
 
   /* static SEL _OBJC_SELECTOR_TABLE[]; */
 
index 4fcbdd0a19aafa143cee024ec10141529f7e6d51..75c8e6036e7119ec2ac2453f42ede943fbf43502 100644 (file)
@@ -2724,9 +2724,9 @@ extern int all_types_permanent;
 
 /* Declare a predefined function.  Return the declaration.  This function is
    provided by each language frontend.  */
-extern tree builtin_function                   PARAMS ((const char *, tree, int,
-                                                      enum built_in_class,
-                                                      const char *));
+extern tree builtin_function           PARAMS ((const char *, tree, int,
+                                              enum built_in_class,
+                                              const char *, tree));
 \f
 /* In tree.c */
 extern char *perm_calloc                       PARAMS ((int, long));