summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog23
-rw-r--r--gcc/builtins.c5
-rw-r--r--gcc/c-common.c165
-rw-r--r--gcc/c-common.h4
-rw-r--r--gcc/c-decl.c38
-rw-r--r--gcc/ch/ChangeLog7
-rw-r--r--gcc/ch/ch-tree.h1
-rw-r--r--gcc/ch/decl.c168
-rw-r--r--gcc/ch/except.c6
-rw-r--r--gcc/ch/inout.c116
-rw-r--r--gcc/ch/tasking.c32
-rw-r--r--gcc/ch/timing.c16
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/decl.c14
-rw-r--r--gcc/f/ChangeLog8
-rw-r--r--gcc/f/com.c38
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/decl.c59
-rw-r--r--gcc/objc/objc-act.c8
-rw-r--r--gcc/tree.h34
20 files changed, 420 insertions, 336 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ec5798fcc9d..587c9505339 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,26 @@
+Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
+
+ * builtins.c (expand_builtin): Use MD_EXPAND_BUILTIN if defined.
+ * c-common.h (builtin_function): Don't declare.
+
+ * c-decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
+ DECL_BUILT_IN.
+ (pushdecl): Likewise.
+ (finish_decl): Likewise.
+ (builtin_function): New arg CLASS. Arg FUNCTION_CODE now of type
+ int. All callers changed.
+ Set the builtin's DECL_BUILT_IN_CLASS.
+ * tree.h (enum built_in_class): New.
+ (enum built_in_function): Delete NOT_BUILT_IN.
+ (DECL_FUNCTION_CODE): The corresponding field in tree_decl is now
+ in a union.
+ (DECL_SET_FUNCTION_CODE): Likewise.
+ (DECL_BUILT_IN_CLASS): New macro.
+ (DECL_BUILT_IN): Use DECL_BUILT_IN_CLASS.
+ (struct tree_decl): Split builtin function code field into a
+ struct.
+ (builtin_function): Declare.
+
Fri Sep 24 01:45:05 1999 Mark Mitchell <mark@codesourcery.com>
* optabs.c (init_traps): Fix typo in last change.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index a5a197e017b..250177c9c45 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -2222,6 +2222,11 @@ expand_builtin (exp, target, subtarget, mode, ignore)
tree arglist = TREE_OPERAND (exp, 1);
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
+#ifdef MD_EXPAND_BUILTIN
+ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
+ return MD_EXPAND_BUILTIN (exp, target, subtarget, mode, ignore);
+#endif
+
/* When not optimizing, generate calls to library functions for a certain
set of builtins. */
if (! optimize && ! CALLED_AS_BUILT_IN (fndecl)
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 2fa89e6fc3f..afdea93853a 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -3581,70 +3581,74 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
endlink))));
builtin_function ("__builtin_constant_p", default_function_type,
- BUILT_IN_CONSTANT_P, NULL_PTR);
+ BUILT_IN_CONSTANT_P, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_return_address", ptr_ftype_unsigned,
- BUILT_IN_RETURN_ADDRESS, NULL_PTR);
+ BUILT_IN_RETURN_ADDRESS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_frame_address", ptr_ftype_unsigned,
- BUILT_IN_FRAME_ADDRESS, NULL_PTR);
+ BUILT_IN_FRAME_ADDRESS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_alloca", ptr_ftype_sizetype,
- BUILT_IN_ALLOCA, "alloca");
- builtin_function ("__builtin_ffs", int_ftype_int, BUILT_IN_FFS, NULL_PTR);
+ BUILT_IN_ALLOCA, BUILT_IN_NORMAL, "alloca");
+ builtin_function ("__builtin_ffs", int_ftype_int, BUILT_IN_FFS,
+ BUILT_IN_NORMAL, NULL_PTR);
/* Define alloca, ffs as builtins.
Declare _exit just to mark it as volatile. */
if (! no_builtins && ! no_nonansi_builtins)
{
temp = builtin_function ("alloca", ptr_ftype_sizetype,
- BUILT_IN_ALLOCA, NULL_PTR);
+ BUILT_IN_ALLOCA, BUILT_IN_NORMAL, NULL_PTR);
/* Suppress error if redefined as a non-function. */
DECL_BUILT_IN_NONANSI (temp) = 1;
- temp = builtin_function ("ffs", int_ftype_int, BUILT_IN_FFS, NULL_PTR);
+ temp = builtin_function ("ffs", int_ftype_int, BUILT_IN_FFS,
+ BUILT_IN_NORMAL, NULL_PTR);
/* Suppress error if redefined as a non-function. */
DECL_BUILT_IN_NONANSI (temp) = 1;
temp = builtin_function ("_exit", void_ftype_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
TREE_THIS_VOLATILE (temp) = 1;
TREE_SIDE_EFFECTS (temp) = 1;
/* Suppress error if redefined as a non-function. */
DECL_BUILT_IN_NONANSI (temp) = 1;
}
- builtin_function ("__builtin_abs", int_ftype_int, BUILT_IN_ABS, NULL_PTR);
+ builtin_function ("__builtin_abs", int_ftype_int, BUILT_IN_ABS,
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_fabsf", float_ftype_float, BUILT_IN_FABS,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_fabs", double_ftype_double, BUILT_IN_FABS,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_fabsl", ldouble_ftype_ldouble, BUILT_IN_FABS,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_labs", long_ftype_long, BUILT_IN_LABS,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_saveregs", ptr_ftype, BUILT_IN_SAVEREGS,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_classify_type", default_function_type,
- BUILT_IN_CLASSIFY_TYPE, NULL_PTR);
+ BUILT_IN_CLASSIFY_TYPE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_next_arg", ptr_ftype, BUILT_IN_NEXT_ARG,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_args_info", int_ftype_int, BUILT_IN_ARGS_INFO,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_setjmp",
build_function_type (integer_type_node,
tree_cons (NULL_TREE, ptr_type_node,
endlink)),
- BUILT_IN_SETJMP, NULL_PTR);
+ BUILT_IN_SETJMP, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_longjmp",
build_function_type (void_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE,
integer_type_node,
endlink))),
- BUILT_IN_LONGJMP, NULL_PTR);
- builtin_function ("__builtin_trap", void_ftype, BUILT_IN_TRAP, NULL_PTR);
+ BUILT_IN_LONGJMP, BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("__builtin_trap", void_ftype, BUILT_IN_TRAP,
+ BUILT_IN_NORMAL, NULL_PTR);
/* Untyped call and return. */
builtin_function ("__builtin_apply_args", ptr_ftype,
- BUILT_IN_APPLY_ARGS, NULL_PTR);
+ BUILT_IN_APPLY_ARGS, BUILT_IN_NORMAL, NULL_PTR);
temp = tree_cons (NULL_TREE,
build_pointer_type (build_function_type (void_type_node,
@@ -3656,9 +3660,9 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
endlink)));
builtin_function ("__builtin_apply",
build_function_type (ptr_type_node, temp),
- BUILT_IN_APPLY, NULL_PTR);
+ BUILT_IN_APPLY, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_return", void_ftype_ptr,
- BUILT_IN_RETURN, NULL_PTR);
+ BUILT_IN_RETURN, BUILT_IN_NORMAL, NULL_PTR);
/* Support for varargs.h and stdarg.h. */
builtin_function ("__builtin_varargs_start",
@@ -3666,21 +3670,21 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
tree_cons (NULL_TREE,
va_list_ptr_type_node,
endlink)),
- BUILT_IN_VARARGS_START, NULL_PTR);
+ BUILT_IN_VARARGS_START, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_stdarg_start",
build_function_type (void_type_node,
tree_cons (NULL_TREE,
va_list_ptr_type_node,
NULL_TREE)),
- BUILT_IN_STDARG_START, NULL_PTR);
+ BUILT_IN_STDARG_START, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_va_end",
build_function_type (void_type_node,
tree_cons (NULL_TREE,
va_list_arg_type_node,
endlink)),
- BUILT_IN_VA_END, NULL_PTR);
+ BUILT_IN_VA_END, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_va_copy",
build_function_type (void_type_node,
@@ -3689,72 +3693,87 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
tree_cons (NULL_TREE,
va_list_arg_type_node,
endlink))),
- BUILT_IN_VA_COPY, NULL_PTR);
+ BUILT_IN_VA_COPY, BUILT_IN_NORMAL, NULL_PTR);
/* Currently under experimentation. */
builtin_function ("__builtin_memcpy", memcpy_ftype, BUILT_IN_MEMCPY,
- "memcpy");
+ BUILT_IN_NORMAL, "memcpy");
builtin_function ("__builtin_memcmp", int_ftype_cptr_cptr_sizet,
- BUILT_IN_MEMCMP, "memcmp");
+ BUILT_IN_MEMCMP, BUILT_IN_NORMAL, "memcmp");
builtin_function ("__builtin_memset", memset_ftype, BUILT_IN_MEMSET,
- "memset");
+ BUILT_IN_NORMAL, "memset");
builtin_function ("__builtin_strcmp", int_ftype_string_string,
- BUILT_IN_STRCMP, "strcmp");
+ BUILT_IN_STRCMP, BUILT_IN_NORMAL, "strcmp");
builtin_function ("__builtin_strcpy", string_ftype_ptr_ptr,
- BUILT_IN_STRCPY, "strcpy");
+ BUILT_IN_STRCPY, BUILT_IN_NORMAL, "strcpy");
builtin_function ("__builtin_strlen", strlen_ftype,
- BUILT_IN_STRLEN, "strlen");
+ BUILT_IN_STRLEN, BUILT_IN_NORMAL, "strlen");
builtin_function ("__builtin_sqrtf", float_ftype_float,
- BUILT_IN_FSQRT, "sqrtf");
+ BUILT_IN_FSQRT, BUILT_IN_NORMAL, "sqrtf");
builtin_function ("__builtin_fsqrt", double_ftype_double,
- BUILT_IN_FSQRT, "sqrt");
+ BUILT_IN_FSQRT, BUILT_IN_NORMAL, "sqrt");
builtin_function ("__builtin_sqrtl", ldouble_ftype_ldouble,
- BUILT_IN_FSQRT, "sqrtl");
+ BUILT_IN_FSQRT, BUILT_IN_NORMAL, "sqrtl");
builtin_function ("__builtin_sinf", float_ftype_float,
- BUILT_IN_SIN, "sinf");
+ BUILT_IN_SIN, BUILT_IN_NORMAL, "sinf");
builtin_function ("__builtin_sin", double_ftype_double,
- BUILT_IN_SIN, "sin");
+ BUILT_IN_SIN, BUILT_IN_NORMAL, "sin");
builtin_function ("__builtin_sinl", ldouble_ftype_ldouble,
- BUILT_IN_SIN, "sinl");
+ BUILT_IN_SIN, BUILT_IN_NORMAL, "sinl");
builtin_function ("__builtin_cosf", float_ftype_float,
- BUILT_IN_COS, "cosf");
+ BUILT_IN_COS, BUILT_IN_NORMAL, "cosf");
builtin_function ("__builtin_cos", double_ftype_double,
- BUILT_IN_COS, "cos");
+ BUILT_IN_COS, BUILT_IN_NORMAL, "cos");
builtin_function ("__builtin_cosl", ldouble_ftype_ldouble,
- BUILT_IN_COS, "cosl");
+ BUILT_IN_COS, BUILT_IN_NORMAL, "cosl");
if (! no_builtins)
{
- builtin_function ("abs", int_ftype_int, BUILT_IN_ABS, NULL_PTR);
- builtin_function ("fabsf", float_ftype_float, BUILT_IN_FABS, NULL_PTR);
- builtin_function ("fabs", double_ftype_double, BUILT_IN_FABS, NULL_PTR);
+ builtin_function ("abs", int_ftype_int, BUILT_IN_ABS,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("fabsf", float_ftype_float, BUILT_IN_FABS,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("fabs", double_ftype_double, BUILT_IN_FABS,
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("fabsl", ldouble_ftype_ldouble, BUILT_IN_FABS,
- NULL_PTR);
- builtin_function ("labs", long_ftype_long, BUILT_IN_LABS, NULL_PTR);
- builtin_function ("memcpy", memcpy_ftype, BUILT_IN_MEMCPY, NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("labs", long_ftype_long, BUILT_IN_LABS,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("memcpy", memcpy_ftype, BUILT_IN_MEMCPY,
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("memcmp", int_ftype_cptr_cptr_sizet, BUILT_IN_MEMCMP,
- NULL_PTR);
- builtin_function ("memset", memset_ftype, BUILT_IN_MEMSET, NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("memset", memset_ftype, BUILT_IN_MEMSET,
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("strcmp", int_ftype_string_string, BUILT_IN_STRCMP,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("strcpy", string_ftype_ptr_ptr, BUILT_IN_STRCPY,
- NULL_PTR);
- builtin_function ("strlen", strlen_ftype, BUILT_IN_STRLEN, NULL_PTR);
- builtin_function ("sqrtf", float_ftype_float, BUILT_IN_FSQRT, NULL_PTR);
- builtin_function ("sqrt", double_ftype_double, BUILT_IN_FSQRT, NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("strlen", strlen_ftype, BUILT_IN_STRLEN,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("sqrtf", float_ftype_float, BUILT_IN_FSQRT,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("sqrt", double_ftype_double, BUILT_IN_FSQRT,
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("sqrtl", ldouble_ftype_ldouble, BUILT_IN_FSQRT,
- NULL_PTR);
- builtin_function ("sinf", float_ftype_float, BUILT_IN_SIN, NULL_PTR);
- builtin_function ("sin", double_ftype_double, BUILT_IN_SIN, NULL_PTR);
- builtin_function ("sinl", ldouble_ftype_ldouble, BUILT_IN_SIN, NULL_PTR);
- builtin_function ("cosf", float_ftype_float, BUILT_IN_COS, NULL_PTR);
- builtin_function ("cos", double_ftype_double, BUILT_IN_COS, NULL_PTR);
- builtin_function ("cosl", ldouble_ftype_ldouble, BUILT_IN_COS, NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("sinf", float_ftype_float, BUILT_IN_SIN,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("sin", double_ftype_double, BUILT_IN_SIN,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("sinl", ldouble_ftype_ldouble, BUILT_IN_SIN,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("cosf", float_ftype_float, BUILT_IN_COS,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("cos", double_ftype_double, BUILT_IN_COS,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("cosl", ldouble_ftype_ldouble, BUILT_IN_COS,
+ BUILT_IN_NORMAL, NULL_PTR);
/* Declare these functions volatile
to avoid spurious "control drops through" warnings. */
temp = builtin_function ("abort", cplus_mode ? void_ftype : void_ftype_any,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
TREE_THIS_VOLATILE (temp) = 1;
TREE_SIDE_EFFECTS (temp) = 1;
@@ -3765,7 +3784,7 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
#endif
temp = builtin_function ("exit",
cplus_mode ? void_ftype_int : void_ftype_any,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
TREE_THIS_VOLATILE (temp) = 1;
TREE_SIDE_EFFECTS (temp) = 1;
@@ -3779,20 +3798,22 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
#if 0
/* Support for these has not been written in either expand_builtin
or build_function_call. */
- builtin_function ("__builtin_div", default_ftype, BUILT_IN_DIV, NULL_PTR);
- builtin_function ("__builtin_ldiv", default_ftype, BUILT_IN_LDIV, NULL_PTR);
+ builtin_function ("__builtin_div", default_ftype, BUILT_IN_DIV,
+ BUILT_IN_NORMAL, NULL_PTR);
+ builtin_function ("__builtin_ldiv", default_ftype, BUILT_IN_LDIV,
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_ffloor", double_ftype_double, BUILT_IN_FFLOOR,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_fceil", double_ftype_double, BUILT_IN_FCEIL,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_fmod", double_ftype_double_double,
- BUILT_IN_FMOD, NULL_PTR);
+ BUILT_IN_FMOD, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_frem", double_ftype_double_double,
- BUILT_IN_FREM, NULL_PTR);
+ BUILT_IN_FREM, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_getexp", double_ftype_double, BUILT_IN_GETEXP,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_getman", double_ftype_double, BUILT_IN_GETMAN,
- NULL_PTR);
+ BUILT_IN_NORMAL, NULL_PTR);
#endif
/* ??? Perhaps there's a better place to do this. But it is related
diff --git a/gcc/c-common.h b/gcc/c-common.h
index d41677008b0..86abdbf3d03 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -113,10 +113,6 @@ extern tree truthvalue_conversion PROTO((tree));
extern tree type_for_mode PROTO((enum machine_mode, int));
extern tree type_for_size PROTO((unsigned, int));
-/* Declare a predefined function. Return the declaration. This function is
- provided by each language frontend. */
-extern tree builtin_function PROTO((const char *, tree, enum built_in_function, const char *));
-
/* Build tree nodes and builtin functions common to both C and C++ language
frontends. */
extern void c_common_nodes_and_builtins PROTO((int, int, int));
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index b2f32c6b936..289deeb5c20 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1939,14 +1939,14 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
if (! different_binding_level)
{
TREE_TYPE (olddecl) = TREE_TYPE (newdecl);
- DECL_BUILT_IN (olddecl) = 0;
+ DECL_BUILT_IN_CLASS (olddecl) = NOT_BUILT_IN;
}
}
else
{
/* If redeclaring a builtin function, and not a definition,
it stays built in. */
- DECL_BUILT_IN (newdecl) = 1;
+ DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl);
DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
}
}
@@ -2333,7 +2333,7 @@ pushdecl (x)
/* Inner extern decl is built-in if global one is. */
if (DECL_BUILT_IN (oldglobal))
{
- DECL_BUILT_IN (x) = DECL_BUILT_IN (oldglobal);
+ DECL_BUILT_IN_CLASS (x) = DECL_BUILT_IN_CLASS (oldglobal);
DECL_FUNCTION_CODE (x) = DECL_FUNCTION_CODE (oldglobal);
}
/* Keep the arg types from a file-scope fcn defn. */
@@ -3044,23 +3044,24 @@ init_decl_processing ()
builtin_function ("__builtin_aggregate_incoming_address",
build_function_type (ptr_type_node, NULL_TREE),
- BUILT_IN_AGGREGATE_INCOMING_ADDRESS, NULL_PTR);
+ BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
+ BUILT_IN_NORMAL, NULL_PTR);
/* Hooks for the DWARF 2 __throw routine. */
builtin_function ("__builtin_unwind_init",
build_function_type (void_type_node, endlink),
- BUILT_IN_UNWIND_INIT, NULL_PTR);
+ BUILT_IN_UNWIND_INIT, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_dwarf_cfa", ptr_ftype_void,
- BUILT_IN_DWARF_CFA, NULL_PTR);
+ BUILT_IN_DWARF_CFA, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_dwarf_fp_regnum",
build_function_type (unsigned_type_node, endlink),
- BUILT_IN_DWARF_FP_REGNUM, NULL_PTR);
+ BUILT_IN_DWARF_FP_REGNUM, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_dwarf_reg_size", int_ftype_int,
- BUILT_IN_DWARF_REG_SIZE, NULL_PTR);
+ BUILT_IN_DWARF_REG_SIZE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_frob_return_addr", ptr_ftype_ptr,
- BUILT_IN_FROB_RETURN_ADDR, NULL_PTR);
+ BUILT_IN_FROB_RETURN_ADDR, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_extract_return_addr", ptr_ftype_ptr,
- BUILT_IN_EXTRACT_RETURN_ADDR, NULL_PTR);
+ BUILT_IN_EXTRACT_RETURN_ADDR, BUILT_IN_NORMAL, NULL_PTR);
builtin_function
("__builtin_eh_return",
build_function_type (void_type_node,
@@ -3070,7 +3071,7 @@ init_decl_processing ()
tree_cons (NULL_TREE,
ptr_type_node,
endlink)))),
- BUILT_IN_EH_RETURN, NULL_PTR);
+ BUILT_IN_EH_RETURN, BUILT_IN_NORMAL, NULL_PTR);
pedantic_lvalues = pedantic;
@@ -3111,10 +3112,11 @@ init_decl_processing ()
the name to be called if we can't opencode the function. */
tree
-builtin_function (name, type, function_code, library_name)
+builtin_function (name, type, function_code, class, library_name)
const char *name;
tree type;
- enum built_in_function function_code;
+ int function_code;
+ enum built_in_class class;
const char *library_name;
{
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
@@ -3129,11 +3131,9 @@ builtin_function (name, type, function_code, library_name)
DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
make_decl_rtl (decl, NULL_PTR, 1);
pushdecl (decl);
- if (function_code != NOT_BUILT_IN)
- {
- DECL_BUILT_IN (decl) = 1;
- DECL_FUNCTION_CODE (decl) = function_code;
- }
+ DECL_BUILT_IN_CLASS (decl) = class;
+ DECL_FUNCTION_CODE (decl) = function_code;
+
/* Warn if a function in the namespace for users
is used without an occasion to consider it declared. */
if (name[0] != '_' || name[1] != '_')
@@ -3567,7 +3567,7 @@ finish_decl (decl, init, asmspec_tree)
name. */
if (TREE_CODE (decl) == FUNCTION_DECL && asmspec)
{
- DECL_BUILT_IN (decl) = 0;
+ DECL_BUILT_IN_CLASS (decl) = NOT_BUILT_IN;
DECL_RTL (decl) = 0;
DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
}
diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog
index 2b9345fdbd2..779e08f51db 100644
--- a/gcc/ch/ChangeLog
+++ b/gcc/ch/ChangeLog
@@ -1,3 +1,10 @@
+Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
+
+ * ch-tree.h (builtin_function): Don't declare.
+ * decl.c (builtin_function): New arg CLASS. Arg FUNCTION_CODE now of
+ type int. All callers changed.
+ Set the builtin's DECL_BUILT_IN_CLASS.
+
1999-09-20 Nick Clifton <nickc@cygnus.com>
* lang.c (lang_decode_option): Extend comment.
diff --git a/gcc/ch/ch-tree.h b/gcc/ch/ch-tree.h
index 7cc37874710..40e7b13b159 100644
--- a/gcc/ch/ch-tree.h
+++ b/gcc/ch/ch-tree.h
@@ -664,7 +664,6 @@ extern void nonvalue_begin_loop_scope PROTO((void));
extern void nonvalue_end_loop_scope PROTO((void));
extern tree build_enumerator PROTO((tree, tree));
-extern tree builtin_function PROTO((const char *, tree, enum built_in_function function_, const char *));
extern tree c_build_type_variant PROTO((tree, int, int));
extern int c_decode_option PROTO((int, char **));
extern void c_mark_varargs PROTO((void));
diff --git a/gcc/ch/decl.c b/gcc/ch/decl.c
index ec7086f7525..8b651796a16 100644
--- a/gcc/ch/decl.c
+++ b/gcc/ch/decl.c
@@ -3898,48 +3898,48 @@ init_decl_processing ()
/* These are compiler-internal function calls, not intended
to be directly called by user code */
builtin_function ("__allocate", ptr_ftype_luns_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("_allocate_global_memory", void_ftype_refptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("_allocate_memory", void_ftype_refptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__andpowerset", bool_ftype_ptr_ptr_ptr_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__bitsetpowerset", void_ftype_ptr_int_int_int_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__cardpowerset", long_ftype_ptr_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__cause_ex1", void_ftype_cptr_cptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__concatstring", ptr_ftype_ptr_ptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__continue", void_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__diffpowerset", void_ftype_ptr_ptr_ptr_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__eqpowerset", bool_ftype_ptr_ptr_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__ffsetclrpowerset", find_bit_ftype,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__flsetclrpowerset", find_bit_ftype,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__flsetpowerset", int_ftype_ptr_luns_long_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__ffsetpowerset", int_ftype_ptr_luns_long_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__inbitstring", bool_ftype_luns_ptr_luns_long_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__inpowerset", bool_ftype_luns_ptr_luns_long,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__lepowerset", bool_ftype_ptr_ptr_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__ltpowerset", bool_ftype_ptr_ptr_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
/* Currently under experimentation. */
builtin_function ("memmove", memcpy_ftype,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("memcmp", memcmp_ftype,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
/* this comes from c-decl.c (init_decl_processing) */
builtin_function ("__builtin_alloca",
@@ -3947,40 +3947,40 @@ init_decl_processing ()
tree_cons (NULL_TREE,
sizetype,
endlink)),
- BUILT_IN_ALLOCA, "alloca");
+ BUILT_IN_ALLOCA, BUILT_IN_NORMAL, "alloca");
builtin_function ("memset", ptr_ftype_ptr_int_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__notpowerset", bool_ftype_ptr_ptr_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__orpowerset", bool_ftype_ptr_ptr_ptr_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__psslice", void_ftype_ptr_int_ptr_int_int_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__pscpy", void_ftype_ptr_luns_luns_cptr_luns_luns_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("_return_memory", void_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__setbitpowerset", void_ftype_ptr_luns_long_long_bool_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__terminate", void_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__unhandled_ex", void_ftype_cptr_cptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__xorpowerset", bool_ftype_ptr_ptr_ptr_luns,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
/* declare floating point functions */
- builtin_function ("__sin", double_ftype_double, NOT_BUILT_IN, "sin");
- builtin_function ("__cos", double_ftype_double, NOT_BUILT_IN, "cos");
- builtin_function ("__tan", double_ftype_double, NOT_BUILT_IN, "tan");
- builtin_function ("__asin", double_ftype_double, NOT_BUILT_IN, "asin");
- builtin_function ("__acos", double_ftype_double, NOT_BUILT_IN, "acos");
- builtin_function ("__atan", double_ftype_double, NOT_BUILT_IN, "atan");
- builtin_function ("__exp", double_ftype_double, NOT_BUILT_IN, "exp");
- builtin_function ("__log", double_ftype_double, NOT_BUILT_IN, "log");
- builtin_function ("__log10", double_ftype_double, NOT_BUILT_IN, "log10");
- builtin_function ("__sqrt", double_ftype_double, NOT_BUILT_IN, "sqrt");
+ builtin_function ("__sin", double_ftype_double, 0, NOT_BUILT_IN, "sin");
+ builtin_function ("__cos", double_ftype_double, 0, NOT_BUILT_IN, "cos");
+ builtin_function ("__tan", double_ftype_double, 0, NOT_BUILT_IN, "tan");
+ builtin_function ("__asin", double_ftype_double, 0, NOT_BUILT_IN, "asin");
+ builtin_function ("__acos", double_ftype_double, 0, NOT_BUILT_IN, "acos");
+ builtin_function ("__atan", double_ftype_double, 0, NOT_BUILT_IN, "atan");
+ builtin_function ("__exp", double_ftype_double, 0, NOT_BUILT_IN, "exp");
+ builtin_function ("__log", double_ftype_double, 0, NOT_BUILT_IN, "log");
+ builtin_function ("__log10", double_ftype_double, 0, NOT_BUILT_IN, "log10");
+ builtin_function ("__sqrt", double_ftype_double, 0, NOT_BUILT_IN, "sqrt");
tasking_init ();
timing_init ();
@@ -3991,114 +3991,114 @@ init_decl_processing ()
the same names. Note the lack of a leading underscore. */
builtin_function ((ignore_case || ! special_UC) ? "abs" : "ABS",
chill_predefined_function_type,
- BUILT_IN_CH_ABS, NULL_PTR);
+ BUILT_IN_CH_ABS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "abstime" : "ABSTIME",
chill_predefined_function_type,
- BUILT_IN_ABSTIME, NULL_PTR);
+ BUILT_IN_ABSTIME, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "allocate" : "ALLOCATE",
chill_predefined_function_type,
- BUILT_IN_ALLOCATE, NULL_PTR);
+ BUILT_IN_ALLOCATE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "allocate_memory" : "ALLOCATE_MEMORY",
chill_predefined_function_type,
- BUILT_IN_ALLOCATE_MEMORY, NULL_PTR);
+ BUILT_IN_ALLOCATE_MEMORY, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "addr" : "ADDR",
chill_predefined_function_type,
- BUILT_IN_ADDR, NULL_PTR);
+ BUILT_IN_ADDR, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "allocate_global_memory" : "ALLOCATE_GLOBAL_MEMORY",
chill_predefined_function_type,
- BUILT_IN_ALLOCATE_GLOBAL_MEMORY, NULL_PTR);
+ BUILT_IN_ALLOCATE_GLOBAL_MEMORY, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "arccos" : "ARCCOS",
chill_predefined_function_type,
- BUILT_IN_ARCCOS, NULL_PTR);
+ BUILT_IN_ARCCOS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "arcsin" : "ARCSIN",
chill_predefined_function_type,
- BUILT_IN_ARCSIN, NULL_PTR);
+ BUILT_IN_ARCSIN, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "arctan" : "ARCTAN",
chill_predefined_function_type,
- BUILT_IN_ARCTAN, NULL_PTR);
+ BUILT_IN_ARCTAN, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "card" : "CARD",
chill_predefined_function_type,
- BUILT_IN_CARD, NULL_PTR);
+ BUILT_IN_CARD, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "cos" : "COS",
chill_predefined_function_type,
- BUILT_IN_CH_COS, NULL_PTR);
+ BUILT_IN_CH_COS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "days" : "DAYS",
chill_predefined_function_type,
- BUILT_IN_DAYS, NULL_PTR);
+ BUILT_IN_DAYS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "descr" : "DESCR",
chill_predefined_function_type,
- BUILT_IN_DESCR, NULL_PTR);
+ BUILT_IN_DESCR, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "getstack" : "GETSTACK",
chill_predefined_function_type,
- BUILT_IN_GETSTACK, NULL_PTR);
+ BUILT_IN_GETSTACK, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "exp" : "EXP",
chill_predefined_function_type,
- BUILT_IN_EXP, NULL_PTR);
+ BUILT_IN_EXP, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "hours" : "HOURS",
chill_predefined_function_type,
- BUILT_IN_HOURS, NULL_PTR);
+ BUILT_IN_HOURS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "inttime" : "INTTIME",
chill_predefined_function_type,
- BUILT_IN_INTTIME, NULL_PTR);
+ BUILT_IN_INTTIME, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "length" : "LENGTH",
chill_predefined_function_type,
- BUILT_IN_LENGTH, NULL_PTR);
+ BUILT_IN_LENGTH, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "log" : "LOG",
chill_predefined_function_type,
- BUILT_IN_LOG, NULL_PTR);
+ BUILT_IN_LOG, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "lower" : "LOWER",
chill_predefined_function_type,
- BUILT_IN_LOWER, NULL_PTR);
+ BUILT_IN_LOWER, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "ln" : "LN",
chill_predefined_function_type,
- BUILT_IN_LN, NULL_PTR);
+ BUILT_IN_LN, BUILT_IN_NORMAL, NULL_PTR);
/* Note: these are *not* the C integer MAX and MIN. They're
for powerset arguments. */
builtin_function ((ignore_case || ! special_UC) ? "max" : "MAX",
chill_predefined_function_type,
- BUILT_IN_MAX, NULL_PTR);
+ BUILT_IN_MAX, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "millisecs" : "MILLISECS",
chill_predefined_function_type,
- BUILT_IN_MILLISECS, NULL_PTR);
+ BUILT_IN_MILLISECS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "min" : "MIN",
chill_predefined_function_type,
- BUILT_IN_MIN, NULL_PTR);
+ BUILT_IN_MIN, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "minutes" : "MINUTES",
chill_predefined_function_type,
- BUILT_IN_MINUTES, NULL_PTR);
+ BUILT_IN_MINUTES, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "num" : "NUM",
chill_predefined_function_type,
- BUILT_IN_NUM, NULL_PTR);
+ BUILT_IN_NUM, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "pred" : "PRED",
chill_predefined_function_type,
- BUILT_IN_PRED, NULL_PTR);
+ BUILT_IN_PRED, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "return_memory" : "RETURN_MEMORY",
chill_predefined_function_type,
- BUILT_IN_RETURN_MEMORY, NULL_PTR);
+ BUILT_IN_RETURN_MEMORY, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "secs" : "SECS",
chill_predefined_function_type,
- BUILT_IN_SECS, NULL_PTR);
+ BUILT_IN_SECS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "sin" : "SIN",
chill_predefined_function_type,
- BUILT_IN_CH_SIN, NULL_PTR);
+ BUILT_IN_CH_SIN, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "size" : "SIZE",
chill_predefined_function_type,
- BUILT_IN_SIZE, NULL_PTR);
+ BUILT_IN_SIZE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "sqrt" : "SQRT",
chill_predefined_function_type,
- BUILT_IN_SQRT, NULL_PTR);
+ BUILT_IN_SQRT, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "succ" : "SUCC",
chill_predefined_function_type,
- BUILT_IN_SUCC, NULL_PTR);
+ BUILT_IN_SUCC, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "tan" : "TAN",
chill_predefined_function_type,
- BUILT_IN_TAN, NULL_PTR);
+ BUILT_IN_TAN, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "terminate" : "TERMINATE",
chill_predefined_function_type,
- BUILT_IN_TERMINATE, NULL_PTR);
+ BUILT_IN_TERMINATE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "upper" : "UPPER",
chill_predefined_function_type,
- BUILT_IN_UPPER, NULL_PTR);
+ BUILT_IN_UPPER, BUILT_IN_NORMAL, NULL_PTR);
build_chill_descr_type ();
build_chill_inttime_type ();
@@ -4119,10 +4119,11 @@ init_decl_processing ()
the name to be called if we can't opencode the function. */
tree
-builtin_function (name, type, function_code, library_name)
+builtin_function (name, type, function_code, class, library_name)
const char *name;
tree type;
- enum built_in_function function_code;
+ int function_code;
+ enum built_in_class class;
const char *library_name;
{
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
@@ -4137,11 +4138,8 @@ builtin_function (name, type, function_code, library_name)
DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
make_decl_rtl (decl, NULL_PTR, 1);
pushdecl (decl);
- if (function_code != NOT_BUILT_IN)
- {
- DECL_BUILT_IN (decl) = 1;
- DECL_SET_FUNCTION_CODE (decl, function_code);
- }
+ DECL_BUILT_IN_CLASS (decl) = class;
+ DECL_FUNCTION_CODE (decl) = function_code;
return decl;
}
diff --git a/gcc/ch/except.c b/gcc/ch/except.c
index 82ab16d35ab..7870a397b11 100644
--- a/gcc/ch/except.c
+++ b/gcc/ch/except.c
@@ -550,7 +550,7 @@ initialize_exceptions ()
setjmp_fndecl = builtin_function ("setjmp",
build_function_type (integer_type_node,
parmtypes),
- NOT_BUILT_IN,
+ 0, NOT_BUILT_IN,
SETJMP_LIBRARY_NAME);
BISJ = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (setjmp_fndecl)),
setjmp_fndecl);
@@ -601,9 +601,9 @@ initialize_exceptions ()
handler_link_pointer_type,
void_list_node));
link_handler_decl = builtin_function ("__ch_link_handler", link_ftype,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
unlink_handler_decl = builtin_function ("__ch_unlink_handler", link_ftype,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
exceptions_initialized = 1;
}
diff --git a/gcc/ch/inout.c b/gcc/ch/inout.c
index f4050fff645..6a8e9bc58c1 100644
--- a/gcc/ch/inout.c
+++ b/gcc/ch/inout.c
@@ -1111,88 +1111,88 @@ inout_init ()
builtin_function ((ignore_case || ! special_UC) ? "associate" : "ASSOCIATE",
chill_predefined_function_type,
- BUILT_IN_ASSOCIATE, NULL_PTR);
+ BUILT_IN_ASSOCIATE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "connect" : "CONNECT",
chill_predefined_function_type,
- BUILT_IN_CONNECT, NULL_PTR);
+ BUILT_IN_CONNECT, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "create" : "CREATE",
chill_predefined_function_type,
- BUILT_IN_CREATE, NULL_PTR);
+ BUILT_IN_CREATE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "delete" : "DELETE",
chill_predefined_function_type,
- BUILT_IN_CH_DELETE, NULL_PTR);
+ BUILT_IN_CH_DELETE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "disconnect" : "DISCONNECT",
chill_predefined_function_type,
- BUILT_IN_DISCONNECT, NULL_PTR);
+ BUILT_IN_DISCONNECT, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "dissociate" : "DISSOCIATE",
chill_predefined_function_type,
- BUILT_IN_DISSOCIATE, NULL_PTR);
+ BUILT_IN_DISSOCIATE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "eoln" : "EOLN",
chill_predefined_function_type,
- BUILT_IN_EOLN, NULL_PTR);
+ BUILT_IN_EOLN, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "existing" : "EXISTING",
chill_predefined_function_type,
- BUILT_IN_EXISTING, NULL_PTR);
+ BUILT_IN_EXISTING, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "getassociation" : "GETASSOCIATION",
chill_predefined_function_type,
- BUILT_IN_GETASSOCIATION, NULL_PTR);
+ BUILT_IN_GETASSOCIATION, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "gettextaccess" : "GETTEXTASSCESS",
chill_predefined_function_type,
- BUILT_IN_GETTEXTACCESS, NULL_PTR);
+ BUILT_IN_GETTEXTACCESS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "gettextindex" : "GETTEXTINDEX",
chill_predefined_function_type,
- BUILT_IN_GETTEXTINDEX, NULL_PTR);
+ BUILT_IN_GETTEXTINDEX, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "gettextrecord" : "GETTEXTRECORD",
chill_predefined_function_type,
- BUILT_IN_GETTEXTRECORD, NULL_PTR);
+ BUILT_IN_GETTEXTRECORD, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "getusage" : "GETUSAGE",
chill_predefined_function_type,
- BUILT_IN_GETUSAGE, NULL_PTR);
+ BUILT_IN_GETUSAGE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "indexable" : "INDEXABLE",
chill_predefined_function_type,
- BUILT_IN_INDEXABLE, NULL_PTR);
+ BUILT_IN_INDEXABLE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "isassociated" : "ISASSOCIATED",
chill_predefined_function_type,
- BUILT_IN_ISASSOCIATED, NULL_PTR);
+ BUILT_IN_ISASSOCIATED, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "modify" : "MODIFY",
chill_predefined_function_type,
- BUILT_IN_MODIFY, NULL_PTR);
+ BUILT_IN_MODIFY, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "outoffile" : "OUTOFFILE",
chill_predefined_function_type,
- BUILT_IN_OUTOFFILE, NULL_PTR);
+ BUILT_IN_OUTOFFILE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "readable" : "READABLE",
chill_predefined_function_type,
- BUILT_IN_READABLE, NULL_PTR);
+ BUILT_IN_READABLE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "readrecord" : "READRECORD",
chill_predefined_function_type,
- BUILT_IN_READRECORD, NULL_PTR);
+ BUILT_IN_READRECORD, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "readtext" : "READTEXT",
chill_predefined_function_type,
- BUILT_IN_READTEXT, NULL_PTR);
+ BUILT_IN_READTEXT, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "sequencible" : "SEQUENCIBLE",
chill_predefined_function_type,
- BUILT_IN_SEQUENCIBLE, NULL_PTR);
+ BUILT_IN_SEQUENCIBLE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "settextaccess" : "SETTEXTACCESS",
chill_predefined_function_type,
- BUILT_IN_SETTEXTACCESS, NULL_PTR);
+ BUILT_IN_SETTEXTACCESS, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "settextindex" : "SETTEXTINDEX",
chill_predefined_function_type,
- BUILT_IN_SETTEXTINDEX, NULL_PTR);
+ BUILT_IN_SETTEXTINDEX, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "settextrecord" : "SETTEXTRECORD",
chill_predefined_function_type,
- BUILT_IN_SETTEXTRECORD, NULL_PTR);
+ BUILT_IN_SETTEXTRECORD, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "variable" : "VARIABLE",
chill_predefined_function_type,
- BUILT_IN_VARIABLE, NULL_PTR);
+ BUILT_IN_VARIABLE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "writeable" : "WRITEABLE",
chill_predefined_function_type,
- BUILT_IN_WRITEABLE, NULL_PTR);
+ BUILT_IN_WRITEABLE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "writerecord" : "WRITERECORD",
chill_predefined_function_type,
- BUILT_IN_WRITERECORD, NULL_PTR);
+ BUILT_IN_WRITERECORD, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "writetext" : "WRITETEXT",
chill_predefined_function_type,
- BUILT_IN_WRITETEXT, NULL_PTR);
+ BUILT_IN_WRITETEXT, BUILT_IN_NORMAL, NULL_PTR);
/* build function prototypes */
bool_ftype_ptr_ptr_int =
@@ -1300,65 +1300,65 @@ inout_init ()
endlink)))))))));
builtin_function ("__associate", ptr_ftype_ptr_ptr_int_ptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__connect", void_ftype_ptr_ptr_int_int_int_long_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__create", void_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__delete", void_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__disconnect", void_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__dissociate", void_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__eoln", bool_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__existing", bool_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__getassociation", ptr_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__gettextaccess", ptr_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__gettextindex", luns_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__gettextrecord", ptr_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__getusage", int_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__indexable", bool_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__isassociated", bool_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__modify", void_ftype_ptr_ptr_int_ptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__outoffile", bool_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__readable", bool_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__readrecord", ptr_ftype_ptr_int_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__readtext_f", void_ftype_ptr_int_ptr_int_ptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__readtext_s", void_ftype_ptr_int_ptr_int_ptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__sequencible", bool_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__settextaccess", void_ftype_ptr_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__settextindex", void_ftype_ptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__settextrecord", void_ftype_ptr_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__variable", bool_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__writeable", bool_ftype_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__writerecord", void_ftype_ptr_int_ptr_luns_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__writetext_f", void_ftype_ptr_int_ptr_int_ptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__writetext_s", void_ftype_ptr_int_ptr_int_ptr_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
/* declare ASSOCIATION, ACCESS, and TEXT modes */
build_io_types ();
diff --git a/gcc/ch/tasking.c b/gcc/ch/tasking.c
index db8c90bf9eb..3b03dea0056 100644
--- a/gcc/ch/tasking.c
+++ b/gcc/ch/tasking.c
@@ -3310,7 +3310,7 @@ tasking_init ()
build_tree_list (NULL_TREE, void_type_node)));
builtin_function ("__whoami", ins_ftype_void,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
build_tasking_message_type ();
@@ -3325,22 +3325,22 @@ tasking_init ()
builtin_function ((ignore_case || ! special_UC) ? "copy_number" : "COPY_NUMBER",
chill_predefined_function_type,
- BUILT_IN_COPY_NUMBER, NULL_PTR);
+ BUILT_IN_COPY_NUMBER, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "gen_code" : "GEN_CODE",
chill_predefined_function_type,
- BUILT_IN_GEN_CODE, NULL_PTR);
+ BUILT_IN_GEN_CODE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "gen_inst" : "GEN_INST",
chill_predefined_function_type,
- BUILT_IN_GEN_INST, NULL_PTR);
+ BUILT_IN_GEN_INST, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "gen_ptype" : "GEN_PTYPE",
chill_predefined_function_type,
- BUILT_IN_GEN_PTYPE, NULL_PTR);
+ BUILT_IN_GEN_PTYPE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "proc_type" : "PROC_TYPE",
chill_predefined_function_type,
- BUILT_IN_PROC_TYPE, NULL_PTR);
+ BUILT_IN_PROC_TYPE, BUILT_IN_NORMAL, NULL_PTR);
builtin_function ((ignore_case || ! special_UC) ? "queue_length" : "QUEUE_LENGTH",
chill_predefined_function_type,
- BUILT_IN_QUEUE_LENGTH, NULL_PTR);
+ BUILT_IN_QUEUE_LENGTH, BUILT_IN_NORMAL, NULL_PTR);
int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int
= build_function_type (integer_type_node,
@@ -3409,23 +3409,23 @@ tasking_init ()
endlink)));
builtin_function ("__delay_event", int_ftype_ptr_int_ptr_int_ptr_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__queue_length", int_ftype_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__register_tasking", void_ftype_ptr,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__send_signal", void_ftype_ptr_ins_int_int_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__send_buffer", int_ftype_ptr_ptr_int_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__start_process", void_ftype_int_int_int_ptr_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__stop_process", void_ftype_void, NOT_BUILT_IN,
+ 0, NOT_BUILT_IN, NULL_PTR);
+ builtin_function ("__stop_process", void_ftype_void, 0, NOT_BUILT_IN,
NULL_PTR);
builtin_function ("__wait_buffer", int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__wait_signal_timed", int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
infinite_buffer_event_length_node = build_int_2 (-1, 0);
TREE_TYPE (infinite_buffer_event_length_node) = long_integer_type_node;
diff --git a/gcc/ch/timing.c b/gcc/ch/timing.c
index 552eddf9f91..35bef786b23 100644
--- a/gcc/ch/timing.c
+++ b/gcc/ch/timing.c
@@ -175,21 +175,21 @@ timing_init ()
endlink)))));
builtin_function ("_abstime", long_ftype_int_int_int_int_int_int_int_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__check_cycle", void_ftype_ptr_durt_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__convert_duration_rtstime", void_ftype_durt_ptr,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__define_timeout", ptr_ftype_durt_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("_inttime", void_ftype_abstime_ptr,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__remaintime", int_ftype_ptr_durt_ptr,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__rtstime", void_ftype_ptr,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__wait_until", int_ftype_abst_ptr_int,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
}
#if 0
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8caac2b2a30..ee850ce65b2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
+
+ * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
+ DECL_BUILT_IN.
+ (builtin_function): New arg CLASS. Arg CODE now of type int. All
+ callers changed.
+ Set the builtin's DECL_BUILT_IN_CLASS.
+
1999-09-24 Mark Mitchell <mark@codesourcery.com>
* decl.c (pushdecl): Don't make local declarations of extern
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d4d7be622ca..b3e676bd6e1 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3539,7 +3539,7 @@ duplicate_decls (newdecl, olddecl)
it stays built in. */
if (DECL_BUILT_IN (olddecl))
{
- DECL_BUILT_IN (newdecl) = 1;
+ DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl);
DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
/* If we're keeping the built-in definition, keep the rtl,
regardless of declaration matches. */
@@ -6467,19 +6467,17 @@ define_function (name, type, pfn, library_name)
See tree.h for its possible values. */
tree
-builtin_function (name, type, code, libname)
+builtin_function (name, type, code, class, libname)
const char *name;
tree type;
- enum built_in_function code;
+ int code;
+ enum built_in_class class;
const char *libname;
{
tree decl = define_function (name, type, (void (*) PROTO((tree)))pushdecl,
libname);
- if (code != NOT_BUILT_IN)
- {
- DECL_BUILT_IN (decl) = 1;
- DECL_FUNCTION_CODE (decl) = code;
- }
+ DECL_BUILT_IN_CLASS (decl) = class;
+ DECL_FUNCTION_CODE (decl) = code;
return decl;
}
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 3297377c05e..425f6a02cf2 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,11 @@
+Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
+
+ * com.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
+ DECL_BUILT_IN.
+ (builtin_function): No longer static. New arg CLASS. Arg
+ FUNCTION_CODE now of type int. All callers changed.
+ Set the builtin's DECL_BUILT_IN_CLASS.
+
Tue Sep 21 09:08:30 1999 Toon Moene <toon@moene.indiv.nluug.nl>
* g77spec.c (lang_specific_driver): Initialise return value.
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 316288e9257..189515424ec 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -466,9 +466,6 @@ static tree ffecom_convert_widen_ (tree type, tree expr);
#if FFECOM_targetCURRENT == FFECOM_targetGCC
static tree bison_rule_compstmt_ (void);
static void bison_rule_pushlevel_ (void);
-static tree builtin_function (const char *name, tree type,
- enum built_in_function function_code,
- const char *library_name);
static void delete_block (tree block);
static int duplicate_decls (tree newdecl, tree olddecl);
static void finish_decl (tree decl, tree init, bool is_top_level);
@@ -12176,23 +12173,23 @@ ffecom_init_0 ()
= build_function_type (void_type_node, NULL_TREE);
builtin_function ("__builtin_sqrtf", float_ftype_float,
- BUILT_IN_FSQRT, "sqrtf");
+ BUILT_IN_FSQRT, BUILT_IN_NORMAL, "sqrtf");
builtin_function ("__builtin_fsqrt", double_ftype_double,
- BUILT_IN_FSQRT, "sqrt");
+ BUILT_IN_FSQRT, BUILT_IN_NORMAL, "sqrt");
builtin_function ("__builtin_sqrtl", ldouble_ftype_ldouble,
- BUILT_IN_FSQRT, "sqrtl");
+ BUILT_IN_FSQRT, BUILT_IN_NORMAL, "sqrtl");
builtin_function ("__builtin_sinf", float_ftype_float,
- BUILT_IN_SIN, "sinf");
+ BUILT_IN_SIN, BUILT_IN_NORMAL, "sinf");
builtin_function ("__builtin_sin", double_ftype_double,
- BUILT_IN_SIN, "sin");
+ BUILT_IN_SIN, BUILT_IN_NORMAL, "sin");
builtin_function ("__builtin_sinl", ldouble_ftype_ldouble,
- BUILT_IN_SIN, "sinl");
+ BUILT_IN_SIN, BUILT_IN_NORMAL, "sinl");
builtin_function ("__builtin_cosf", float_ftype_float,
- BUILT_IN_COS, "cosf");
+ BUILT_IN_COS, BUILT_IN_NORMAL, "cosf");
builtin_function ("__builtin_cos", double_ftype_double,
- BUILT_IN_COS, "cos");
+ BUILT_IN_COS, BUILT_IN_NORMAL, "cos");
builtin_function ("__builtin_cosl", ldouble_ftype_ldouble,
- BUILT_IN_COS, "cosl");
+ BUILT_IN_COS, BUILT_IN_NORMAL, "cosl");
#if BUILT_FOR_270
pedantic_lvalues = FALSE;
@@ -13758,9 +13755,9 @@ bison_rule_compstmt_ ()
If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
the name to be called if we can't opencode the function. */
-static tree
-builtin_function (const char *name, tree type,
- enum built_in_function function_code,
+tree
+builtin_function (const char *name, tree type, int function_code,
+ enum built_in_class class,
const char *library_name)
{
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
@@ -13770,11 +13767,8 @@ builtin_function (const char *name, tree type,
DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
make_decl_rtl (decl, NULL_PTR, 1);
pushdecl (decl);
- if (function_code != NOT_BUILT_IN)
- {
- DECL_BUILT_IN (decl) = 1;
- DECL_FUNCTION_CODE (decl) = function_code;
- }
+ DECL_BUILT_IN_CLASS (decl) = class;
+ DECL_FUNCTION_CODE (decl) = function_code;
return decl;
}
@@ -14025,7 +14019,7 @@ duplicate_decls (tree newdecl, tree olddecl)
&& (!types_match || new_is_definition))
{
TREE_TYPE (olddecl) = TREE_TYPE (newdecl);
- DECL_BUILT_IN (olddecl) = 0;
+ DECL_BUILT_IN_CLASS (olddecl) = NOT_BUILT_IN;
}
/* If redeclaring a builtin function, and not a definition,
@@ -14035,7 +14029,7 @@ duplicate_decls (tree newdecl, tree olddecl)
{
if (DECL_BUILT_IN (olddecl))
{
- DECL_BUILT_IN (newdecl) = 1;
+ DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl);
DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
}
else
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index e1379bf4371..da15f8a028b 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
+
+ * decl.c (builtin_function): No longer static. New arg CLASS. Arg
+ FUNCTION_CODE now of type int. All callers changed.
+ Set the builtin's DECL_BUILT_IN_CLASS.
+
1999-09-23 Tom Tromey <tromey@cygnus.com>
* jvspec.c (lang_specific_driver): Don't read spec file if
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 443fa9dd19e..77332df51fd 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -37,8 +37,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "defaults.h"
static tree push_jvm_slot PROTO ((int, tree));
-static tree builtin_function PROTO ((const char *, tree,
- enum built_in_function, const char *));
static tree lookup_name_current_level PROTO ((tree));
static tree push_promoted_type PROTO ((const char *, tree));
static struct binding_level *make_binding_level PROTO ((void));
@@ -391,11 +389,12 @@ tree integer_negative_one_node;
If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
the name to be called if we can't opencode the function. */
-static tree
-builtin_function (name, type, function_code, library_name)
+tree
+builtin_function (name, type, function_code, class, library_name)
const char *name;
tree type;
- enum built_in_function function_code;
+ int function_code;
+ enum built_in_class class;
const char *library_name;
{
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
@@ -405,11 +404,8 @@ builtin_function (name, type, function_code, library_name)
DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
make_decl_rtl (decl, NULL_PTR, 1);
pushdecl (decl);
- if (function_code != NOT_BUILT_IN)
- {
- DECL_BUILT_IN (decl) = 1;
- DECL_FUNCTION_CODE (decl) = function_code;
- }
+ DECL_BUILT_IN_CLASS (decl) = class;
+ DECL_FUNCTION_CODE (decl) = function_code;
return decl;
}
@@ -702,27 +698,30 @@ 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),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
soft_initclass_node = builtin_function ("_Jv_InitClass",
build_function_type (void_type_node,
t),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN,
+ NULL_PTR);
t = tree_cons (NULL_TREE, ptr_type_node, endlink);
throw_node = builtin_function ("_Jv_Throw",
build_function_type (ptr_type_node, t),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
t = build_function_type (int_type_node, endlink);
soft_monitorenter_node
- = builtin_function ("_Jv_MonitorEnter", t, NOT_BUILT_IN, NULL_PTR);
+ = builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN,
+ NULL_PTR);
soft_monitorexit_node
- = builtin_function ("_Jv_MonitorExit", t, NOT_BUILT_IN, NULL_PTR);
+ = builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN,
+ NULL_PTR);
t = tree_cons (NULL_TREE, int_type_node,
tree_cons (NULL_TREE, int_type_node, endlink));
soft_newarray_node
= builtin_function ("_Jv_NewArray",
build_function_type(ptr_type_node, t),
- NOT_BUILT_IN, NULL_PTR );
+ 0, NOT_BUILT_IN, NULL_PTR);
t = tree_cons (NULL_TREE, int_type_node,
tree_cons (NULL_TREE, class_ptr_type,
@@ -730,20 +729,20 @@ init_decl_processing ()
soft_anewarray_node
= builtin_function ("_Jv_NewObjectArray",
build_function_type (ptr_type_node, t),
- NOT_BUILT_IN, NULL_PTR );
+ 0, NOT_BUILT_IN, NULL_PTR);
t = tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, int_type_node, endlink));
soft_multianewarray_node
= builtin_function ("_Jv_NewMultiArray",
build_function_type (ptr_type_node, t),
- NOT_BUILT_IN, NULL_PTR );
+ 0, NOT_BUILT_IN, NULL_PTR);
t = build_function_type (void_type_node,
tree_cons (NULL_TREE, int_type_node, endlink));
soft_badarrayindex_node
= builtin_function ("_Jv_ThrowBadArrayIndex", t,
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
TREE_THIS_VOLATILE (soft_badarrayindex_node) = 1;
TREE_SIDE_EFFECTS (soft_badarrayindex_node) = 1;
@@ -752,32 +751,32 @@ init_decl_processing ()
soft_checkcast_node
= builtin_function ("_Jv_CheckCast",
build_function_type (ptr_type_node, t),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
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 (promoted_boolean_type_node, t),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
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),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
t = tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, endlink)));
soft_lookupinterfacemethod_node
= builtin_function ("_Jv_LookupInterfaceMethod",
build_function_type (ptr_type_node, t),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
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, "fmod");
+ BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmod");
soft_exceptioninfo_call_node
= build (CALL_EXPR,
@@ -785,7 +784,7 @@ init_decl_processing ()
build_address_of
(builtin_function ("_Jv_exception_info",
build_function_type (ptr_type_node, endlink),
- NOT_BUILT_IN, NULL_PTR)),
+ 0, NOT_BUILT_IN, NULL_PTR)),
NULL_TREE, NULL_TREE);
TREE_SIDE_EFFECTS (soft_exceptioninfo_call_node) = 1;
#if 0
@@ -794,28 +793,28 @@ init_decl_processing ()
soft_fmodf_node
= builtin_function ("__builtin_fmodf",
build_function_type (float_type_node, t),
- BUILT_IN_FMOD, "fmodf");
+ BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmodf");
#endif
soft_idiv_node
= builtin_function ("_Jv_divI",
build_function_type (int_type_node, t),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
soft_irem_node
= builtin_function ("_Jv_remI",
build_function_type (int_type_node, t),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
soft_ldiv_node
= builtin_function ("_Jv_divJ",
build_function_type (long_type_node, t),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
soft_lrem_node
= builtin_function ("_Jv_remJ",
build_function_type (long_type_node, t),
- NOT_BUILT_IN, NULL_PTR);
+ 0, NOT_BUILT_IN, NULL_PTR);
init_class_processing ();
}
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 4d8c84020d8..5cb797b2de7 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -1226,7 +1226,7 @@ synth_module_prologue ()
pushdecl (umsg_decl);
}
else
- umsg_decl = builtin_function (TAG_MSGSEND, temp_type, NOT_BUILT_IN, 0);
+ umsg_decl = builtin_function (TAG_MSGSEND, temp_type, 0, NOT_BUILT_IN, 0);
/* id objc_msgSendSuper (struct objc_super *, SEL, ...); */
@@ -1237,7 +1237,7 @@ synth_module_prologue ()
NULL_TREE)));
umsg_super_decl = builtin_function (TAG_MSGSENDSUPER,
- temp_type, NOT_BUILT_IN, 0);
+ temp_type, 0, NOT_BUILT_IN, 0);
/* id objc_getClass (const char *); */
@@ -1248,12 +1248,12 @@ synth_module_prologue ()
NULL_TREE)));
objc_get_class_decl
- = builtin_function (TAG_GETCLASS, temp_type, NOT_BUILT_IN, 0);
+ = builtin_function (TAG_GETCLASS, temp_type, 0, NOT_BUILT_IN, 0);
/* id objc_getMetaClass (const char *); */
objc_get_meta_class_decl
- = builtin_function (TAG_GETMETACLASS, temp_type, NOT_BUILT_IN, 0);
+ = builtin_function (TAG_GETMETACLASS, temp_type, 0, NOT_BUILT_IN, 0);
/* static SEL _OBJC_SELECTOR_TABLE[]; */
diff --git a/gcc/tree.h b/gcc/tree.h
index e479f99a1bb..e61f829323e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -65,12 +65,20 @@ extern int tree_code_length[MAX_TREE_CODES];
extern const char *tree_code_name[MAX_TREE_CODES];
+/* Classify which part of the compiler has defined a given builtin
+ function. */
+enum built_in_class
+{
+ NOT_BUILT_IN = 0,
+ BUILT_IN_FRONTEND,
+ BUILT_IN_MD,
+ BUILT_IN_NORMAL
+};
/* Codes that identify the various built in functions
so that expand_call can identify them quickly. */
enum built_in_function
{
- NOT_BUILT_IN,
BUILT_IN_ALLOCA,
BUILT_IN_ABS,
BUILT_IN_FABS,
@@ -1126,8 +1134,8 @@ struct tree_type
#define DECL_FRAME_SIZE(NODE) (DECL_CHECK (NODE)->decl.frame_size.i)
/* For FUNCTION_DECL, if it is built-in,
this identifies which built-in operation it is. */
-#define DECL_FUNCTION_CODE(NODE) (DECL_CHECK (NODE)->decl.frame_size.f)
-#define DECL_SET_FUNCTION_CODE(NODE,VAL) (DECL_CHECK (NODE)->decl.frame_size.f = (VAL))
+#define DECL_FUNCTION_CODE(NODE) (DECL_CHECK (NODE)->decl.frame_size.f.code)
+#define DECL_SET_FUNCTION_CODE(NODE,VAL) (DECL_CHECK (NODE)->decl.frame_size.f.code = (VAL))
/* For a FIELD_DECL, holds the size of the member as an integer. */
#define DECL_FIELD_SIZE(NODE) (DECL_CHECK (NODE)->decl.saved_insns.i)
@@ -1241,8 +1249,12 @@ struct tree_type
/* In a LABEL_DECL, nonzero means label was defined inside a binding
contour that restored a stack level and which is now exited. */
#define DECL_TOO_LATE(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
+
/* In a FUNCTION_DECL, nonzero means a built in function. */
-#define DECL_BUILT_IN(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
+#define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN)
+/* For a builtin function, identify which part of the compiler defined it. */
+#define DECL_BUILT_IN_CLASS(NODE) (DECL_CHECK (NODE)->decl.frame_size.f.class)
+
/* In a VAR_DECL that's static,
nonzero if the space is in the text section. */
#define DECL_IN_TEXT_SECTION(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
@@ -1370,7 +1382,11 @@ struct tree_decl
union {
int i;
unsigned int u;
- enum built_in_function f;
+ struct
+ {
+ unsigned int code:24;
+ unsigned int class:8;
+ } f;
} frame_size;
union tree_node *name;
@@ -2009,7 +2025,13 @@ extern void (*incomplete_decl_finalize_hook) PROTO((tree));
extern char *init_parse PROTO((char *));
extern void finish_parse PROTO((void));
-extern const char * const language_string;
+extern const char * const language_string;
+
+/* Declare a predefined function. Return the declaration. This function is
+ provided by each language frontend. */
+extern tree builtin_function PROTO((const char *, tree, int,
+ enum built_in_class,
+ const char *));
/* In tree.c */
extern char *perm_calloc PROTO((int, long));