aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@gcc.gnu.org>2001-04-24 08:22:06 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2001-04-24 08:22:06 +0000
commit0ba8a114c724d36034e8996eefb7c94d4fe8aed0 (patch)
tree268353894884ce2459e1f3b08adc4825b8ed0dd6 /gcc/testsuite
parentdfbb4f347cf43b955f56ecbc9709b8836d395ee5 (diff)
downloadgcc-0ba8a114c724d36034e8996eefb7c94d4fe8aed0.zip
gcc-0ba8a114c724d36034e8996eefb7c94d4fe8aed0.tar.gz
gcc-0ba8a114c724d36034e8996eefb7c94d4fe8aed0.tar.bz2
Lazy __FUNCTION__ generation.
gcc: Lazy __FUNCTION__ generation. * c-common.h (RID_FUNCTION_NAME, RID_PRETTY_FUNCTION_NAME, RID_C99_FUNCTION_NAME): New _RIDs. (CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, CTI_FUNC_ID): Remove. (CTI_FUNCTION_NAME_DECL, CTI_PRETTY_FUNCTION_NAME_DECL, CTI_C99_FUNCTION_NAME_DECL, CTI_SAVED_FUNCTION_NAME_DECLS): New global tree slots. (function_id_node, pretty_function_id_node, func_id_node): Remove. (c99_function_name_decl_node, function_name_decl_node, pretty_function_name_decl_node, saved_function_name_decls): Declare. (struct language_function): Remove x_function_name_declared_p. (make_fname_decl): Remove a parameter. (declare_function_names): Remove prototype. (start_fname_decls, finish_fname_decls): Prototype. (fname_as_string): Likewise. (fname_string, fname_decl): Likewise. * c-common.c (make_fname_decl): Adjust. (struct fname_var_t): New struct. (fname_vars): New static array. (declare_function_name): Remove. (start_fname_decls, finish_fname_decls): New functions. (fname_as_string): New function from remnants of declare_function_name. (fname_string, fname_decl): New functions. * c-decl.c (c_function_name_declared_p): Remove. (init_decl_processing): Don't generate __FUNCTION__ et al ids, don't call declare_function_name. Call start_fname_decls. (c_make_fname_decl): Adjust parameters. Generate the name. Don't clobber the line number. Call finish_decl. (start_function): Call start_fname_decls. (finish_function): Call finish_fname_decls. Remove c_function_name_declared_p. (push_c_function_context): Don't push c_function_name_declared_p. (pop_c_function_context): Don't pop c_function_name_declared_p. (c_begin_compound_stmt): Don't check c_function_name_declared_p. * c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): New tokens. (program): Call finish_fname_decls for C. (primary): Add VAR_FUNC_NAME. (reswords): Add slots for __FUNCTION__ et al. (rid_to_yy): Add mappings for __FUNCTION__ et al. (yylexname): If it's a STRING_FUNC_NAME generate the function name now. Don't look for VAR_DECLs containing __FUNCTION__ et al. * c-semantics.c (prune_unused_decls): Remove. (finish_stmt_tree): Don't call prune_unused_decls. (genrtl_decl_stmt): Don't prune unused decls here. cp: Lazy __FUNCTION__ generation. * cp-tree.def (FUNCTION_NAME): Remove. * cp-tree.h (function_name_declared_p): Remove. (cp_fname_init): Prototype. * decl.c (init_decl_processing): Don't generate __FUNCTION__ et al ids, don't call declare_function_name. Call start_fname_decls. (cp_make_fname_decl): Adjust parameters. Generate the name. Don't clobber the line number. (cp_fname_init): New function. (start_function): Call start_fname_decls. (finish_function): Call finish_fname_decls. * lex.c (reswords): Add slots for __FUNCTION__ et al. (rid_to_yy): Add mappings for __FUNCTION__ et al. * optimize.c (maybe_clone_body): Remove function_name_declared_p. * parse.y (VAR_FUNC_NAME): New token. (primary): Add VAR_FUNC_NAME. * pt.c (tsubst_decl): Adjust a DECL_PRETTY_FUNCTION_P's generation. (tsubst, FUNCTION_NAME case): Remove. (tsubst_copy, FUNCTION_NAME case): Remove. (tsubst_expr, DECL_STMT case): Be careful with a DECL_PRETTY_FUNCTION_P. (instantiate_decl): Remove function_name_declared_p. * semantics.c (begin_compound_statement): Don't call declare_function_name here. (setup_vtbl_ptr). Don't save & restore function_name_declared_p. (finish_translation_unit): Call finish_fname_decls. (expand_body): Remove function_name_declared_p. * typeck2.c (digest_init): Allow any ERROR_MARK. testsuite: * gcc.dg/c99-func-2.c: Remove xfail. * gcc.dg/c99-func-3.c: Remove xfail. * gcc.dg/c99-func-4.c: Remove xfail. From-SVN: r41520
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/c99-func-2.c3
-rw-r--r--gcc/testsuite/gcc.dg/c99-func-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/c99-func-4.c2
4 files changed, 9 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ac18210..b93b675 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2001-04-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcc.dg/c99-func-2.c: Remove xfail.
+ * gcc.dg/c99-func-3.c: Remove xfail.
+ * gcc.dg/c99-func-4.c: Remove xfail.
+
2001-04-23 Zack Weinberg <zackw@stanford.edu>
* gcc.c-torture/execute/20010124-1.c: No longer expected to fail.
diff --git a/gcc/testsuite/gcc.dg/c99-func-2.c b/gcc/testsuite/gcc.dg/c99-func-2.c
index 11737d6..d6a6f24 100644
--- a/gcc/testsuite/gcc.dg/c99-func-2.c
+++ b/gcc/testsuite/gcc.dg/c99-func-2.c
@@ -6,6 +6,5 @@
void
foo (void)
{
- __func__ "foo"; /* { dg-bogus "warning" "warning in place of error" } */
- /* { dg-error "parse error" "__func__ not string constant" { xfail *-*-* } 9 } */
+ __func__ "foo"; /* { dg-error "parse error" "before string constant" } */
}
diff --git a/gcc/testsuite/gcc.dg/c99-func-3.c b/gcc/testsuite/gcc.dg/c99-func-3.c
index 5fa920a..f8a06a0 100644
--- a/gcc/testsuite/gcc.dg/c99-func-3.c
+++ b/gcc/testsuite/gcc.dg/c99-func-3.c
@@ -1,6 +1,6 @@
/* Test for C99 __func__: not merging with string literals. */
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
-/* { dg-do run { xfail *-*-* } } */
+/* { dg-do run } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/c99-func-4.c b/gcc/testsuite/gcc.dg/c99-func-4.c
index d138803..10ec195 100644
--- a/gcc/testsuite/gcc.dg/c99-func-4.c
+++ b/gcc/testsuite/gcc.dg/c99-func-4.c
@@ -6,5 +6,5 @@
void
foo (void)
{
- char *p = __func__; /* { dg-error "discards" "__func__ pointer to const" { xfail *-*-* } } */
+ char *p = __func__; /* { dg-error "discards" "__func__ pointer to const" } */
}