class.c (resolve_address_of_overloaded_function): Mark the chosen function used.
authorJason Merrill <jason@yorick.cygnus.com>
Mon, 25 Jan 1999 20:43:21 +0000 (20:43 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 25 Jan 1999 20:43:21 +0000 (15:43 -0500)
* class.c (resolve_address_of_overloaded_function): Mark the
chosen function used.
* call.c (build_call): Make sure that a function coming in has
been marked used already.
* decl.c (expand_static_init): Call mark_used instead of
assemble_external.
* except.c (call_eh_info, do_pop_exception, expand_end_eh_spec,
alloc_eh_object, expand_throw): Likewise.
* init.c (build_builtin_delete_call): Likewise.
* rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1,
expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc,
expand_generic_desc): Likewise.

From-SVN: r24862

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/decl.c
gcc/cp/except.c
gcc/cp/init.c
gcc/cp/rtti.c

index 95e476714890de05f2616d8efe052e8664b253c6..a3798926d6f5ce1394c40b131bb9f5a4357b99a4 100644 (file)
@@ -1,3 +1,19 @@
+1999-01-25  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * class.c (resolve_address_of_overloaded_function): Mark the
+       chosen function used.
+
+       * call.c (build_call): Make sure that a function coming in has
+       been marked used already.
+       * decl.c (expand_static_init): Call mark_used instead of
+       assemble_external.
+       * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec, 
+       alloc_eh_object, expand_throw): Likewise.
+       * init.c (build_builtin_delete_call): Likewise.
+       * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1, 
+       expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc,
+       expand_generic_desc): Likewise.
+
 1999-01-25  Martin von Löwis  <loewis@informatik.hu-berlin.de>
 
        * tree.c (equal_functions): New function.
index 3891ea75b7e3175497a24e45cb903b0ce9669414..c478a5001402870ca35b0bfa2eb92287cc64627c 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions related to invoking methods and overloaded functions.
-   Copyright (C) 1987, 92-97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 92-97, 1998, 1999 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com) and
    modified by Brendan Kehoe (brendan@cygnus.com).
 
@@ -552,6 +552,9 @@ build_call (function, result_type, parms)
   if (decl && DECL_CONSTRUCTOR_P (decl))
     is_constructor = 1;
 
+  if (decl)
+    my_friendly_assert (TREE_USED (decl), 990125);
+
   /* Don't pass empty class objects by value.  This is useful
      for tags in STL, which are used to control overload resolution.
      We don't need to handle other cases of copying empty classes.  */
index 2e6022bc7028a1d88147f6795de338998ad1ae91..1430b9e6068622ff1af23f03682040921306e5de 100644 (file)
@@ -5229,6 +5229,8 @@ resolve_address_of_overloaded_function (target_type,
   /* Good, exactly one match.  Now, convert it to the correct type.  */
   fn = TREE_PURPOSE (matches);
 
+  mark_used (fn);
+
   if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type))
     return build_unary_op (ADDR_EXPR, fn, 0);
   else
index d62263211b90c90bcd67aa49e8242210f096da71..927eec61ccc0ad6bbaa3e01dbb4da734a664eca2 100644 (file)
@@ -8147,7 +8147,7 @@ expand_static_init (decl, init)
                                    build_function_type (void_type_node,
                                                         pfvlist),
                                    NOT_BUILT_IN, NULL_PTR);
-             assemble_external (atexit_fndecl);
+             mark_used (atexit_fndecl);
              Atexit = default_conversion (atexit_fndecl);
              pop_lang_context ();
              pop_obstacks ();
index 2216a7876339eed876556ad147e85ca45025bf6a..aa1ff92769c9671bf44d0281a822083b1030e1a1 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle exceptional things in C++.
-   Copyright (C) 1989, 92-97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1989, 92-97, 1998, 1999 Free Software Foundation, Inc.
    Contributed by Michael Tiemann <tiemann@cygnus.com>
    Rewritten by Mike Stump <mrs@cygnus.com>, based upon an
    initial re-implementation courtesy Tad Hunt.
@@ -318,9 +318,9 @@ call_eh_info ()
       DECL_ARTIFICIAL (fn) = 1;
       pushdecl_top_level (fn);
       make_function_rtl (fn);
-      assemble_external (fn);
       pop_obstacks ();
     }
+  mark_used (fn);
   return build_function_call (fn, NULL_TREE);
 }
 
@@ -531,10 +531,10 @@ do_pop_exception ()
       DECL_ARTIFICIAL (fn) = 1;
       pushdecl_top_level (fn);
       make_function_rtl (fn);
-      assemble_external (fn);
       pop_obstacks ();
     }
 
+  mark_used (fn);
   /* Arrange to do a dynamically scoped cleanup upon exit from this region.  */
   cleanup = lookup_name (get_identifier ("__exception_info"), 0);
   cleanup = build_function_call (fn, expr_tree_cons
@@ -797,10 +797,10 @@ expand_end_eh_spec (raises)
       TREE_THIS_VOLATILE (fn) = 1;
       pushdecl_top_level (fn);
       make_function_rtl (fn);
-      assemble_external (fn);
       pop_obstacks ();
     }
 
+  mark_used (fn);
   tmp = expr_tree_cons (NULL_TREE, build_int_2 (count, 0), expr_tree_cons
                        (NULL_TREE, decl, NULL_TREE));
   tmp = build_call (fn, TREE_TYPE (TREE_TYPE (fn)), tmp);
@@ -939,10 +939,10 @@ alloc_eh_object (type)
       DECL_ARTIFICIAL (fn) = 1;
       pushdecl_top_level (fn);
       make_function_rtl (fn);
-      assemble_external (fn);
       pop_obstacks ();
     }
 
+  mark_used (fn);
   exp = build_function_call (fn, expr_tree_cons
                             (NULL_TREE, size_in_bytes (type), NULL_TREE));
   exp = build1 (NOP_EXPR, build_pointer_type (type), exp);
@@ -1096,10 +1096,10 @@ expand_throw (exp)
          DECL_ARTIFICIAL (fn) = 1;
          pushdecl_top_level (fn);
          make_function_rtl (fn);
-         assemble_external (fn);
          pop_obstacks ();
        }
 
+      mark_used (fn);
       e = expr_tree_cons (NULL_TREE, exp, expr_tree_cons
                          (NULL_TREE, throw_type, expr_tree_cons
                           (NULL_TREE, cleanup, NULL_TREE)));
@@ -1127,10 +1127,10 @@ expand_throw (exp)
          DECL_ARTIFICIAL (fn) = 1;
          pushdecl_top_level (fn);
          make_function_rtl (fn);
-         assemble_external (fn);
          pop_obstacks ();
        }
 
+      mark_used (fn);
       exp = build_function_call (fn, NULL_TREE);
       expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
     }
index d6898ff13c7c0401172556cc0da05830f02ae361..44911ebab7949d3a38fd2f77746060994f349e77 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle initialization things in C++.
-   Copyright (C) 1987, 89, 92-97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 89, 92-98, 1999 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GNU CC.
@@ -1861,7 +1861,7 @@ static tree
 build_builtin_delete_call (addr)
      tree addr;
 {
-  assemble_external (global_delete_fndecl);
+  mark_used (global_delete_fndecl);
   return build_call (global_delete_fndecl, 
                     void_type_node, build_expr_list (NULL_TREE, addr));
 }
index fff923063bd08e456cb6d0e97a1f5587592cf45e..59b2c9354203a136e44e024e723a671cd94509a7 100644 (file)
@@ -1,5 +1,5 @@
 /* RunTime Type Identification
-   Copyright (C) 1995, 96-97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 96-97, 1998, 1999 Free Software Foundation, Inc.
    Mostly written by Jason Merrill (jason@cygnus.com).
 
 This file is part of GNU CC.
@@ -151,11 +151,10 @@ call_void_fn (name)
       DECL_ARTIFICIAL (d) = 1;
       pushdecl_top_level (d);
       make_function_rtl (d);
-      assemble_external (d);
-
       pop_obstacks ();
     }
 
+  mark_used (d);
   return build_call (d, void_type_node, NULL_TREE);
 }
 
@@ -377,7 +376,7 @@ get_tinfo_fn (type)
 
   pushdecl_top_level (d);
   make_function_rtl (d);
-  assemble_external (d);
+  mark_used (d);
   mark_inline_for_output (d);
   pop_obstacks ();
 
@@ -653,10 +652,10 @@ build_dynamic_cast_1 (type, expr)
              DECL_ARTIFICIAL (dcast_fn) = 1;
              pushdecl_top_level (dcast_fn);
              make_function_rtl (dcast_fn);
-             assemble_external (dcast_fn);
              pop_obstacks ();
            }
          
+         mark_used (dcast_fn);
           result = build_call
            (dcast_fn, TREE_TYPE (TREE_TYPE (dcast_fn)), elems);
 
@@ -751,10 +750,10 @@ expand_si_desc (tdecl, type)
       DECL_ARTIFICIAL (fn) = 1;
       pushdecl_top_level (fn);
       make_function_rtl (fn);
-      assemble_external (fn);
       pop_obstacks ();
     }
 
+  mark_used (fn);
   fn = build_call (fn, TREE_TYPE (TREE_TYPE (fn)), elems);
   expand_expr_stmt (fn);
 }
@@ -932,10 +931,10 @@ expand_class_desc (tdecl, type)
       DECL_ARTIFICIAL (fn) = 1;
       pushdecl_top_level (fn);
       make_function_rtl (fn);
-      assemble_external (fn);
       pop_obstacks ();
     }
 
+  mark_used (fn);
   fn = build_call (fn, TREE_TYPE (TREE_TYPE (fn)), elems);
   expand_expr_stmt (fn);
 }
@@ -979,10 +978,10 @@ expand_ptr_desc (tdecl, type)
       DECL_ARTIFICIAL (fn) = 1;
       pushdecl_top_level (fn);
       make_function_rtl (fn);
-      assemble_external (fn);
       pop_obstacks ();
     }
 
+  mark_used (fn);
   fn = build_call (fn, TREE_TYPE (TREE_TYPE (fn)), elems);
   expand_expr_stmt (fn);
 }
@@ -1027,10 +1026,10 @@ expand_attr_desc (tdecl, type)
       DECL_ARTIFICIAL (fn) = 1;
       pushdecl_top_level (fn);
       make_function_rtl (fn);
-      assemble_external (fn);
       pop_obstacks ();
     }
 
+  mark_used (fn);
   fn = build_call (fn, TREE_TYPE (TREE_TYPE (fn)), elems);
   expand_expr_stmt (fn);
 }
@@ -1067,10 +1066,10 @@ expand_generic_desc (tdecl, type, fnname)
       DECL_ARTIFICIAL (fn) = 1;
       pushdecl_top_level (fn);
       make_function_rtl (fn);
-      assemble_external (fn);
       pop_obstacks ();
     }
 
+  mark_used (fn);
   fn = build_call (fn, TREE_TYPE (TREE_TYPE (fn)), elems);
   expand_expr_stmt (fn);
 }