diff options
author | Roger Sayle <roger@eyesopen.com> | 2003-04-14 03:13:07 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2003-04-14 03:13:07 +0000 |
commit | 7f685e177ee99a15953f2ffa4292823c8a9b88da (patch) | |
tree | 3b5aae81043167976f8a6e9e31f1cc5aa74edcc3 /gcc | |
parent | 1331d16fd4b57c5927cec03b5a320bc59366a628 (diff) | |
download | gcc-7f685e177ee99a15953f2ffa4292823c8a9b88da.zip gcc-7f685e177ee99a15953f2ffa4292823c8a9b88da.tar.gz gcc-7f685e177ee99a15953f2ffa4292823c8a9b88da.tar.bz2 |
tree.h (DECL_BUILT_IN_NONANSI): Remove.
* tree.h (DECL_BUILT_IN_NONANSI): Remove.
* c-common.c (builtin_function_2): Don't set DECL_BUILT_IN_NONANSI.
* c-decl.c (duplicate_decls): Use invariant DECL_BUILT_IN_NONANSI
implies DECL_BUILT_IN to simplify logic.
* print-tree.c (print_node): Don't dump DECL_BUILT_IN_NONANSI.
From-SVN: r65561
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c-common.c | 17 | ||||
-rw-r--r-- | gcc/c-decl.c | 18 | ||||
-rw-r--r-- | gcc/print-tree.c | 4 | ||||
-rw-r--r-- | gcc/tree.h | 11 |
5 files changed, 18 insertions, 40 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f2dae1..98d6c34 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2003-04-13 Roger Sayle <roger@eyesopen.com> + * tree.h (DECL_BUILT_IN_NONANSI): Remove. + * c-common.c (builtin_function_2): Don't set DECL_BUILT_IN_NONANSI. + * c-decl.c (duplicate_decls): Use invariant DECL_BUILT_IN_NONANSI + implies DECL_BUILT_IN to simplify logic. + * print-tree.c (print_node): Don't dump DECL_BUILT_IN_NONANSI. + +2003-04-13 Roger Sayle <roger@eyesopen.com> + * builtin-types.def (BT_FN_STRING_CONST_STRING): New builtin type. (BT_FN_PTR_SIZE_SIZE): Likewise. * builtins.def (BUILT_IN_MALLOC, BUILT_IN_CALLOC, BUILT_IN_STRDUP): diff --git a/gcc/c-common.c b/gcc/c-common.c index a2cad23..5d51579 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3691,20 +3691,15 @@ builtin_function_2 (builtin_name, name, builtin_type, type, function_code, { tree bdecl = NULL_TREE; tree decl = NULL_TREE; + if (builtin_name != 0) - { - bdecl = builtin_function (builtin_name, builtin_type, function_code, - class, library_name_p ? name : NULL, - attrs); - } + bdecl = builtin_function (builtin_name, builtin_type, function_code, + class, library_name_p ? name : NULL, attrs); + 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, - attrs); - if (nonansi_p) - DECL_BUILT_IN_NONANSI (decl) = 1; - } + decl = builtin_function (name, type, function_code, class, NULL, attrs); + return (bdecl != 0 ? bdecl : decl); } diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 3fc1808..be6ff79 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -860,30 +860,16 @@ duplicate_decls (newdecl, olddecl, different_binding_level) if (TREE_CODE (olddecl) != TREE_CODE (newdecl)) { if (TREE_CODE (olddecl) == FUNCTION_DECL - && (DECL_BUILT_IN (olddecl) - || DECL_BUILT_IN_NONANSI (olddecl))) + && DECL_BUILT_IN (olddecl)) { /* If you declare a built-in or predefined function name as static, the old definition is overridden, but optionally warn this was a bad choice of name. */ if (!TREE_PUBLIC (newdecl)) { - if (!warn_shadow) - ; - else if (DECL_BUILT_IN (olddecl)) + if (warn_shadow) warning_with_decl (newdecl, "shadowing built-in function `%s'"); - else - warning_with_decl (newdecl, "shadowing library function `%s'"); } - /* Likewise, if the built-in is not ansi, then programs can - override it even globally without an error. */ - else if (! DECL_BUILT_IN (olddecl)) - warning_with_decl (newdecl, - "library function `%s' declared as non-function"); - - else if (DECL_BUILT_IN_NONANSI (olddecl)) - warning_with_decl (newdecl, - "built-in function `%s' declared as non-function"); else warning_with_decl (newdecl, "built-in function `%s' declared as non-function"); diff --git a/gcc/print-tree.c b/gcc/print-tree.c index cd18071..bb1230d 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -1,6 +1,6 @@ /* Prints out tree in human readable form - GNU C-compiler Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. + 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -336,8 +336,6 @@ print_node (file, prefix, node, indent) fputs (" inline", file); if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node)) fputs (" built-in", file); - if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN_NONANSI (node)) - fputs (" built-in-nonansi", file); if (TREE_CODE (node) == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (node)) fputs (" no-static-chain", file); @@ -236,8 +236,6 @@ struct tree_common GTY(()) TREE_UNSIGNED in INTEGER_TYPE, ENUMERAL_TYPE, FIELD_DECL - DECL_BUILT_IN_NONANSI in - FUNCTION_DECL SAVE_EXPR_NOPLACEHOLDER in SAVE_EXPR @@ -635,8 +633,7 @@ extern void tree_operand_check_failed PARAMS ((int, enum tree_code, #define TREE_CONSTANT(NODE) ((NODE)->common.constant_flag) /* In INTEGER_TYPE or ENUMERAL_TYPE nodes, means an unsigned type. - In FIELD_DECL nodes, means an unsigned bit field. - The same bit is used in functions as DECL_BUILT_IN_NONANSI. */ + In FIELD_DECL nodes, means an unsigned bit field. */ #define TREE_UNSIGNED(NODE) ((NODE)->common.unsigned_flag) #define TYPE_TRAP_SIGNED(NODE) \ @@ -1687,12 +1684,6 @@ struct tree_type GTY(()) /* List of FUNCTION_DECLs inlined into this function's body. */ #define DECL_INLINED_FNS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.inlined_fns) -/* Nonzero in a FUNCTION_DECL means this is a built-in function - that is not specified by ansi C and that users are supposed to be allowed - to redefine for any purpose whatever. */ -#define DECL_BUILT_IN_NONANSI(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->common.unsigned_flag) - /* Nonzero in a FUNCTION_DECL means this function should be treated as if it were a malloc, meaning it returns a pointer that is not an alias. */ |