tree.def: Add NAMESPACE_DECL.

* tree.def: Add NAMESPACE_DECL.
	* dwarfout.c (type_ok_for_scope): Ignore NAMESPACE_DECLs for now.
	* dwarf2out.c (push_decl_scope): Likewise.
	(scope_die_for): Likewise.
	* tree.c (decl_function_context): Use TREE_CODE_CLASS to determine
	how to get next context level.
	* cp-tree.def: Remove NAMESPACE_DECL.
	* cp/Makefile.in: Add .SUFFIXES.

From-SVN: r19539
This commit is contained in:
Jason Merrill 1998-05-05 01:27:06 +00:00 committed by Jason Merrill
parent 2e14a41b63
commit 2addbe1dca
7 changed files with 26 additions and 8 deletions

View File

@ -1,3 +1,9 @@
Tue May 5 01:25:03 1998 Jason Merrill <jason@yorick.cygnus.com>
* Makefile.in: Add .SUFFIXES.
* cp-tree.def: Remove NAMESPACE_DECL.
Sun May 3 01:32:14 1998 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_over_call): Do evaluate arg even if it has empty

View File

@ -156,6 +156,10 @@ INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
.c.o:
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
# The only suffixes we want for implicit rules are .c and .o.
.SUFFIXES:
.SUFFIXES: .c .o
# This tells GNU make version 3 not to export all the variables
# defined in this file into the environment.
.NOEXPORT:

View File

@ -151,9 +151,6 @@ DEFTREECODE (TYPENAME_TYPE, "typename_type", 't', 0)
Other kinds of thunks may be defined later. */
DEFTREECODE (THUNK_DECL, "thunk_decl", 'd', 0)
/* A namespace declaration. */
DEFTREECODE (NAMESPACE_DECL, "namespace_decl", 'd', 0)
/* A using declaration. DECL_INITIAL contains the specified scope.
This is not an alias, but is later expanded into multiple aliases. */
DEFTREECODE (USING_DECL, "using_decl", 'd', 0)

View File

@ -7523,6 +7523,8 @@ push_decl_scope (scope)
/* The normal case. */
if (decl_scope_depth == 0
|| containing_scope == NULL_TREE
/* Ignore namespaces for the moment. */
|| TREE_CODE (containing_scope) == NAMESPACE_DECL
|| containing_scope == decl_scope_table[decl_scope_depth - 1].scope)
decl_scope_table[decl_scope_depth].previous = decl_scope_depth - 1;
else
@ -7541,7 +7543,7 @@ push_decl_scope (scope)
decl_scope_depth++;
}
/* Return the DIE for the scope the immediately contains this declaration. */
/* Return the DIE for the scope that immediately contains this declaration. */
static dw_die_ref
scope_die_for (t, context_die)
@ -7561,6 +7563,10 @@ scope_die_for (t, context_die)
else
containing_scope = DECL_CONTEXT (t);
/* Ignore namespaces for the moment. */
if (containing_scope && TREE_CODE (containing_scope) == NAMESPACE_DECL)
containing_scope = NULL_TREE;
/* Function-local tags and functions get stuck in limbo until they are
fixed up by decls_for_scope. */
if (context_die == NULL && containing_scope != NULL_TREE

View File

@ -4136,6 +4136,9 @@ type_ok_for_scope (type, scope)
return is_tagged_type (type)
? (TYPE_CONTEXT (type) == scope
/* Ignore namespaces for the moment. */
|| (scope == NULL_TREE
&& TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL)
|| (scope == NULL_TREE && is_tagged_type (TYPE_CONTEXT (type))
&& TREE_ASM_WRITTEN (TYPE_CONTEXT (type))))
: (scope == NULL_TREE || ! is_tagged_type (scope));

View File

@ -4654,11 +4654,9 @@ decl_function_context (decl)
while (context && TREE_CODE (context) != FUNCTION_DECL)
{
if (TREE_CODE (context) == RECORD_TYPE
|| TREE_CODE (context) == UNION_TYPE
|| TREE_CODE (context) == QUAL_UNION_TYPE)
if (TREE_CODE_CLASS (TREE_CODE (context)) == 't')
context = TYPE_CONTEXT (context);
else if (TREE_CODE (context) == TYPE_DECL)
else if (TREE_CODE_CLASS (TREE_CODE (context)) == 'd')
context = DECL_CONTEXT (context);
else if (TREE_CODE (context) == BLOCK)
context = BLOCK_SUPERCONTEXT (context);

View File

@ -331,6 +331,10 @@ DEFTREECODE (VAR_DECL, "var_decl", 'd', 0)
DEFTREECODE (PARM_DECL, "parm_decl", 'd', 0)
DEFTREECODE (RESULT_DECL, "result_decl", 'd', 0)
DEFTREECODE (FIELD_DECL, "field_decl", 'd', 0)
/* A namespace declaration. Namespaces appear in DECL_CONTEXT of other
_DECLs, providing a hierarchy of names. */
DEFTREECODE (NAMESPACE_DECL, "namespace_decl", 'd', 0)
/* References to storage. */