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]

C++ PATCH to create_pseudo_type_info


As previously discussed, this fixes problems on the PA (tested by John
Anglin).  Also tested by me on i686-pc-linux-gnu.

2001-12-04  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.

*** ./gcc/cp/rtti.c.~1~	Tue Dec  4 02:44:36 2001
--- ./gcc/cp/rtti.c	Mon Dec  3 19:35:54 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);
  
*************** create_pseudo_type_info VPARAMS((const c
*** 1185,1196 ****
    pseudo_type = make_aggr_type (RECORD_TYPE);
    finish_builtin_type (pseudo_type, pseudo_name, fields, ix, ptr_type_node);
    TYPE_HAS_CONSTRUCTOR (pseudo_type) = 1;
-   VA_CLOSE (ap);
  
    result = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE);
    TINFO_VTABLE_DECL (result) = vtable_decl;
    TINFO_PSEUDO_TYPE (result) = pseudo_type;
    
    return result;
  }
  
--- 1194,1205 ----
    pseudo_type = make_aggr_type (RECORD_TYPE);
    finish_builtin_type (pseudo_type, pseudo_name, fields, ix, ptr_type_node);
    TYPE_HAS_CONSTRUCTOR (pseudo_type) = 1;
  
    result = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE);
    TINFO_VTABLE_DECL (result) = vtable_decl;
    TINFO_PSEUDO_TYPE (result) = pseudo_type;
    
+   VA_CLOSE (ap);
    return result;
  }
  

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