OSDN Git Service

* tree.def: Add NAMESPACE_DECL.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 May 1998 01:27:06 +0000 (01:27 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 May 1998 01:27:06 +0000 (01:27 +0000)
* 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

gcc/cp/ChangeLog
gcc/cp/Makefile.in
gcc/cp/cp-tree.def
gcc/dwarf2out.c
gcc/dwarfout.c
gcc/tree.c
gcc/tree.def

index a1bf5c9..772c621 100644 (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 
index b4a56cc..84d7a0c 100644 (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:
index 0a42d74..25c64bf 100644 (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)
index 71f2ec0..e8ba8e3 100644 (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
index 8e1f206..edcf822 100644 (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));
index 20805d5..ff608db 100644 (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);
index 292a7ea..5e18393 100644 (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)
 \f
 /* References to storage.  */