* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19539
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
.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:
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)
/* 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
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)
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
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));
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);
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)
\f
/* References to storage. */