From 85a363ce903a5fc373b75daaa5759793985c93c7 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 3 May 2001 11:02:26 +0000 Subject: [PATCH] * dump.c (cp_dump_tree, USING_STMT case): New case. * tree.c (cp_statement_code_p): Add USING_STMT. * decl2.c (do_using_directive): Add the using directive statement. * tree.c (walk_tree): Reformat an if block. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41783 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/decl2.c | 2 ++ gcc/cp/dump.c | 6 ++++++ gcc/cp/tree.c | 23 +++++++++++++---------- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cb625ed..e98d1ab 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2001-05-03 Nathan Sidwell + + * dump.c (cp_dump_tree, USING_STMT case): New case. + * tree.c (cp_statement_code_p): Add USING_STMT. + * decl2.c (do_using_directive): Add the using directive statement. + + * tree.c (walk_tree): Reformat an if block. + 2001-05-02 Mark Mitchell * decl.c (compute_array_index_type): Don't try to do anything with diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 9010092..768fd5f 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -5204,6 +5204,8 @@ do_using_directive (namespace) { if (namespace == fake_std_node) return; + if (building_stmt_tree ()) + add_stmt (build_stmt (USING_STMT, namespace)); /* using namespace A::B::C; */ if (TREE_CODE (namespace) == SCOPE_REF) diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index a4033c3..3f0a118 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -252,6 +252,12 @@ cp_dump_tree (di, t) dump_next_stmt (di, t); break; + case USING_STMT: + dump_stmt (di, t); + dump_child ("nmsp", USING_STMT_NAMESPACE (t)); + dump_next_stmt (di, t); + break; + default: break; } diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 73f67bb..5de2b5d 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1038,6 +1038,7 @@ cp_statement_code_p (code) case TRY_BLOCK: case HANDLER: case EH_SPEC_BLOCK: + case USING_STMT: return 1; default: @@ -1188,16 +1189,18 @@ walk_tree (tp, func, data, htab) if (!*tp) return NULL_TREE; - if (htab) { - void **slot; - /* Don't walk the same tree twice, if the user has requested that we - avoid doing so. */ - if (htab_find (htab, *tp)) - return NULL_TREE; - /* If we haven't already seen this node, add it to the table. */ - slot = htab_find_slot (htab, *tp, INSERT); - *slot = *tp; - } + if (htab) + { + void **slot; + + /* Don't walk the same tree twice, if the user has requested + that we avoid doing so. */ + if (htab_find (htab, *tp)) + return NULL_TREE; + /* If we haven't already seen this node, add it to the table. */ + slot = htab_find_slot (htab, *tp, INSERT); + *slot = *tp; + } /* Call the function. */ walk_subtrees = 1; -- 2.7.4