This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unreviewed C++ patch for PA (HP assembler)


>>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:

> OK, they shouldn't be internal.  The vtables for the *_type_info classes
> have global linkage in libstdc++ because the compiler can see that they
> have a non-inline, non-pure virtual function which it can use to decide
> where the vtable should go.  But that should be the case everywhere these
> classes are used; what code are you compiling that results in these classes
> being internal?

OK, the problem was that we were looking up the vtable of a class we've
never seen, so the usual heuristics don't work.  Does this patch do the
trick for you?

2001-12-03  Jason Merrill  <jason@redhat.com>

	* rtti.c (create_pseudo_type_info): Set CLASSTYPE_INTERFACE_ONLY
	on the __*_type_info type if we haven't seen a definition.

*** rtti.c.~1~	Mon Nov 26 13:08:48 2001
--- rtti.c	Mon Dec  3 19:34:05 2001
*************** create_pseudo_type_info VPARAMS((const c
*** 1162,1167 ****
--- 1162,1176 ----
    
    /* Get the vtable decl. */
    real_type = xref_tag (class_type_node, get_identifier (real_name), 1);
+   if (! TYPE_SIZE (real_type))
+     {
+       /* We never saw a definition of this type, so we need to tell the
+ 	 compiler that this is an exported class, as indeed all of the
+ 	 __*_type_info classes are.  */
+       SET_CLASSTYPE_INTERFACE_KNOWN (real_type);
+       CLASSTYPE_INTERFACE_ONLY (real_type) = 1;
+     }
+ 
    vtable_decl = get_vtable_decl (real_type, /*complete=*/1);
    vtable_decl = build_unary_op (ADDR_EXPR, vtable_decl, 0);
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]