diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-16 02:08:11 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-16 02:08:11 +0000 |
commit | 799f877ece467fd36113dc6306a33e25f88f3750 (patch) | |
tree | e9a699fec7c15696fe1e831cc04c62ec3c6645e1 | |
parent | b9d576f517471a92133a7192b1cda345b21898da (diff) | |
download | gcc-799f877ece467fd36113dc6306a33e25f88f3750.tar.gz |
* c-decl.c (lookup_name_two): Add.
* c-tree.h (lookup_name_two): Likewise.
* c-common.c (handle_cleanup_attribute): Use lookup_name_two instead.
* config/darwin-c.c (darwin_pragma_unused): Likewise.
cp:
* name-lookup.c (lookup_name_two): Add.
* name-lookup.h: Likewise.
testsuite:
* g++.old-deja/g++.mike/unused.C: Add.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107062 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/c-common.c | 2 | ||||
-rw-r--r-- | gcc/c-decl.c | 9 | ||||
-rw-r--r-- | gcc/c-tree.h | 1 | ||||
-rw-r--r-- | gcc/config/darwin-c.c | 2 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 8 | ||||
-rw-r--r-- | gcc/cp/name-lookup.h | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.mike/unused.C | 7 |
10 files changed, 44 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1ffb83f1d8c..16b1dfc60e2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-11-15 Mike Stump <mrs@apple.com> + + * c-decl.c (lookup_name_two): Add. + * c-tree.h (lookup_name_two): Likewise. + * c-common.c (handle_cleanup_attribute): Use lookup_name_two instead. + * config/darwin-c.c (darwin_pragma_unused): Likewise. + 2005-11-16 Alan Modra <amodra@bigpond.net.au> PR rtl-optimization/23392 diff --git a/gcc/c-common.c b/gcc/c-common.c index 45018411096..feb87ef523a 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -5464,7 +5464,7 @@ handle_cleanup_attribute (tree *node, tree name, tree args, *no_add_attrs = true; return NULL_TREE; } - cleanup_decl = lookup_name (cleanup_id); + cleanup_decl = lookup_name_two (cleanup_id, 0); if (!cleanup_decl || TREE_CODE (cleanup_decl) != FUNCTION_DECL) { error ("cleanup argument not a function"); diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 003b813fc7d..99e91c04406 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -2671,6 +2671,15 @@ lookup_name (tree name) return 0; } +/* Similar to `lookup_name' for the benefit of common code and the C++ + front end. */ + +tree +lookup_name_two (tree name, int ARG_UNUSED (prefer_type)) +{ + return lookup_name (name); +} + /* Similar to `lookup_name' but look only at the indicated scope. */ static tree diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 0894317e574..0399e893e3a 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -455,6 +455,7 @@ extern tree grokparm (const struct c_parm *); extern tree implicitly_declare (tree); extern void keep_next_level (void); extern tree lookup_name (tree); +extern tree lookup_name_two (tree, int); extern void pending_xref_error (void); extern void c_push_function_context (struct function *); extern void c_pop_function_context (struct function *); diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c index 738f07c81a7..893aaf7d7b8 100644 --- a/gcc/config/darwin-c.c +++ b/gcc/config/darwin-c.c @@ -141,7 +141,7 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED) tok = c_lex (&decl); if (tok == CPP_NAME && decl) { - tree local = lookup_name (decl); + tree local = lookup_name_two (decl, 0); if (local && (TREE_CODE (local) == PARM_DECL || TREE_CODE (local) == VAR_DECL)) TREE_USED (local) = 1; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c42ef5ca769..6d354d9d164 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2005-11-15 Mike Stump <mrs@apple.com> + + * name-lookup.c (lookup_name_two): Add. + * name-lookup.h: Likewise. + 2005-11-15 Mark Mitchell <mark@codesourcery.com> PR c++/24667 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 20ea311196f..ce27704f75f 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4000,6 +4000,14 @@ lookup_name (tree name, int prefer_type) 0, LOOKUP_COMPLAIN); } +/* Similar to `lookup_name' for the benefit of common code. */ + +tree +lookup_name_two (tree name, int prefer_type) +{ + return lookup_name (name, prefer_type); +} + /* Look up NAME for type used in elaborated name specifier in the scopes given by SCOPE. SCOPE can be either TS_CURRENT or TS_WITHIN_ENCLOSING_NON_CLASS. Although not implied by the diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index fa2a760bd94..a6466d3fb74 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -313,6 +313,7 @@ extern void pushlevel_class (void); extern void poplevel_class (void); extern tree pushdecl_with_scope (tree, cxx_scope *, bool); extern tree lookup_name (tree, int); +extern tree lookup_name_two (tree, int); extern tree lookup_name_real (tree, int, int, bool, int, int); extern tree lookup_type_scope (tree, tag_scope); extern tree namespace_binding (tree, tree); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 26d56c3cbda..8b43fc89685 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-11-11 Mike Stump <mrs@apple.com> + + * g++.old-deja/g++.mike/unused.C: Add. + 2005-11-15 Mark Mitchell <mark@codesourcery.com> PR c++/24667 diff --git a/gcc/testsuite/g++.old-deja/g++.mike/unused.C b/gcc/testsuite/g++.old-deja/g++.mike/unused.C new file mode 100644 index 00000000000..b441a77f55e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.mike/unused.C @@ -0,0 +1,7 @@ +// { dg-do compile { target *-*-darwin* } } +// { dg-options { -Wunused-parameter } } +// Radar 4125055 + +void foo(int x) { +#pragma unused ( x ) +} |