Commit 5158d7ee by Nathan Sidwell Committed by Nathan Sidwell

dump.c (cp_dump_tree, [...]): New case.

	* 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.

From-SVN: r41783
parent 05de394b
2001-05-03 Nathan Sidwell <nathan@codesourcery.com>
* 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 <mark@codesourcery.com> 2001-05-02 Mark Mitchell <mark@codesourcery.com>
* decl.c (compute_array_index_type): Don't try to do anything with * decl.c (compute_array_index_type): Don't try to do anything with
......
...@@ -5204,6 +5204,8 @@ do_using_directive (namespace) ...@@ -5204,6 +5204,8 @@ do_using_directive (namespace)
{ {
if (namespace == fake_std_node) if (namespace == fake_std_node)
return; return;
if (building_stmt_tree ())
add_stmt (build_stmt (USING_STMT, namespace));
/* using namespace A::B::C; */ /* using namespace A::B::C; */
if (TREE_CODE (namespace) == SCOPE_REF) if (TREE_CODE (namespace) == SCOPE_REF)
......
...@@ -252,6 +252,12 @@ cp_dump_tree (di, t) ...@@ -252,6 +252,12 @@ cp_dump_tree (di, t)
dump_next_stmt (di, t); dump_next_stmt (di, t);
break; break;
case USING_STMT:
dump_stmt (di, t);
dump_child ("nmsp", USING_STMT_NAMESPACE (t));
dump_next_stmt (di, t);
break;
default: default:
break; break;
} }
......
...@@ -1038,6 +1038,7 @@ cp_statement_code_p (code) ...@@ -1038,6 +1038,7 @@ cp_statement_code_p (code)
case TRY_BLOCK: case TRY_BLOCK:
case HANDLER: case HANDLER:
case EH_SPEC_BLOCK: case EH_SPEC_BLOCK:
case USING_STMT:
return 1; return 1;
default: default:
...@@ -1188,16 +1189,18 @@ walk_tree (tp, func, data, htab) ...@@ -1188,16 +1189,18 @@ walk_tree (tp, func, data, htab)
if (!*tp) if (!*tp)
return NULL_TREE; return NULL_TREE;
if (htab) { if (htab)
void **slot; {
/* Don't walk the same tree twice, if the user has requested that we void **slot;
avoid doing so. */
if (htab_find (htab, *tp)) /* Don't walk the same tree twice, if the user has requested
return NULL_TREE; that we avoid doing so. */
/* If we haven't already seen this node, add it to the table. */ if (htab_find (htab, *tp))
slot = htab_find_slot (htab, *tp, INSERT); return NULL_TREE;
*slot = *tp; /* 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. */ /* Call the function. */
walk_subtrees = 1; walk_subtrees = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment