OSDN Git Service

* cp-tree.h (DECL_NEEDED_P): Tweak to correct usage before EOF.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Feb 2000 02:46:57 +0000 (02:46 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Feb 2000 02:46:57 +0000 (02:46 +0000)
(import_export_class): Remove declaration.
* decl2.c (import_export_class): Make it static.
* dump.c (dequeue_and_dump): Handle PREDECREMENT_EXPR,
PREINCREMENT_EXPR, POSTDECREMENT_EXPR, POSTINCREMENT_EXPR,
EXPR_WITH_FILE_LOCATION.
* lex.c (check_newline): Tweak filename/lineno setting.
* semantics.c (begin_while_stmt): Fix typo in comment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32208 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl2.c
gcc/cp/dump.c
gcc/cp/lex.c
gcc/cp/semantics.c
gcc/testsuite/g++.old-deja/g++.other/inline7.C [new file with mode: 0644]

index ed727a9..b90484f 100644 (file)
@@ -1,3 +1,14 @@
+2000-02-26  Mark Mitchell  <mark@codesourcery.com>
+
+       * cp-tree.h (DECL_NEEDED_P): Tweak to correct usage before EOF.
+       (import_export_class): Remove declaration.
+       * decl2.c (import_export_class): Make it static.
+       * dump.c (dequeue_and_dump): Handle PREDECREMENT_EXPR,
+       PREINCREMENT_EXPR, POSTDECREMENT_EXPR, POSTINCREMENT_EXPR,
+       EXPR_WITH_FILE_LOCATION.
+       * lex.c (check_newline): Tweak filename/lineno setting.
+       * semantics.c (begin_while_stmt): Fix typo in comment.
+       
 Sat Feb 26 19:50:23 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * lang-options.h (-fmessage-length=): Add missing option.
index 2342fd6..f320918 100644 (file)
@@ -2870,7 +2870,7 @@ extern int flag_new_for_scope;
 
 /* An integer indicating how many bytes should be subtracted from the
    vtable for the `this' pointer to find the vcall offset.  (The vptr
-   is always located at offset zero from the `this' pointer.)  If
+   is always located at offset zero from the `this' pointer.)  If
    zero, then there is no vcall offset.  */
 #define THUNK_VCALL_OFFSET(DECL) (DECL_FIELD_SIZE (DECL))
 
@@ -2878,9 +2878,11 @@ extern int flag_new_for_scope;
    definition.  This is true when the back-end tells us that
    the symbol has been referenced in the generated code.  If, however,
    we are not generating code, then it is also true when a symbol has
-   just been used somewhere, even if it's not really needed.  */
+   just been used somewhere, even if it's not really needed.  We need
+   anything that isn't comdat, but we don't know for sure whether or
+   not something is comdat until end-of-file.  */
 #define DECL_NEEDED_P(DECL)                                    \
-  (! DECL_COMDAT (DECL)                                                \
+  ((at_eof && !DECL_COMDAT (DECL))                             \
    || (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME ((DECL))))  \
    || (flag_syntax_only && TREE_USED ((DECL))))
 
@@ -3831,7 +3833,6 @@ extern void finish_builtin_type                   PARAMS ((tree, const char *,
 extern tree coerce_new_type                    PARAMS ((tree));
 extern tree coerce_delete_type                 PARAMS ((tree));
 extern void comdat_linkage                     PARAMS ((tree));
-extern void import_export_class                        PARAMS ((tree));
 extern void import_export_vtable               PARAMS ((tree, tree, int));
 extern void import_export_decl                 PARAMS ((tree));
 extern tree build_cleanup                      PARAMS ((tree));
index 7e5a883..2f9c574 100644 (file)
@@ -91,6 +91,7 @@ static int generate_ctor_and_dtor_functions_for_priority
                                   PARAMS ((splay_tree_node, void *));
 static tree prune_vars_needing_no_initialization PARAMS ((tree));
 static void write_out_vars PARAMS ((tree));
+static void import_export_class        PARAMS ((tree));
 
 extern int current_class_depth;
 
@@ -2440,13 +2441,20 @@ import_export_vtable (decl, type, final)
 /* Determine whether or not we want to specifically import or export CTYPE,
    using various heuristics.  */
 
-void
+static void
 import_export_class (ctype)
      tree ctype;
 {
   /* -1 for imported, 1 for exported.  */
   int import_export = 0;
 
+  /* It only makes sense to call this function at EOF.  The reason is
+     that this function looks at whether or not the first non-inline
+     non-abstract virtual member function has been defined in this
+     translation unit.  But, we can't possibly know that until we've
+     seen the entire translation unit.  */
+  my_friendly_assert (at_eof, 20000226);
+
   if (CLASSTYPE_INTERFACE_KNOWN (ctype))
     return;
 
index 7d7fed3..dc8f754 100644 (file)
@@ -804,6 +804,10 @@ dequeue_and_dump (di)
     case COMPONENT_REF:
     case COMPOUND_EXPR:
     case ARRAY_REF:
+    case PREDECREMENT_EXPR:
+    case PREINCREMENT_EXPR:
+    case POSTDECREMENT_EXPR:
+    case POSTINCREMENT_EXPR:
       /* These nodes are binary, but do not have code class `2'.  */
       dump_child ("op 0", TREE_OPERAND (t, 0));
       dump_child ("op 1", TREE_OPERAND (t, 1));
@@ -858,6 +862,10 @@ dequeue_and_dump (di)
       dump_child ("args", TREE_OPERAND (t, 1));
       dump_child ("decl", TREE_OPERAND (t, 2));
       break;
+      
+    case EXPR_WITH_FILE_LOCATION:
+      dump_child ("expr", EXPR_WFL_NODE (t));
+      break;
 
     default:
       /* There are no additional fields to print.  */
index d0a2db7..f522031 100644 (file)
@@ -2630,13 +2630,15 @@ linenum:
 
          pop_srcloc ();
          input_file_stack->name = new_file;
-         lineno = l;
          debug_end_source_file (input_file_stack->line);
        }
       else
        error ("#-lines for entering and leaving files don't match");
     }
 
+  input_filename = new_file;
+  lineno = l;
+
   extract_interface_info ();
 
   /* skip the rest of this line.  */
index b1e6239..52ab681 100644 (file)
@@ -281,7 +281,7 @@ begin_while_stmt ()
   return r;
 }
 
-/* Process the COND of an if-statement, which may be given by
+/* Process the COND of a while-statement, which may be given by
    WHILE_STMT.  */
 
 void 
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline7.C b/gcc/testsuite/g++.old-deja/g++.other/inline7.C
new file mode 100644 (file)
index 0000000..c3f5439
--- /dev/null
@@ -0,0 +1,16 @@
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+#include <list>
+
+list<int*> li;
+
+void f ()
+{
+  li.size ();
+}
+
+int main ()
+{
+  li.push_back (0);
+  f ();
+}