]> gcc.gnu.org Git - gcc.git/commitdiff
class.c (layout_vtable_decl): Call build_array_of_n_type.
authorNathan Froyd <froydnj@codesourcery.com>
Sat, 30 Oct 2010 14:35:35 +0000 (14:35 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Sat, 30 Oct 2010 14:35:35 +0000 (14:35 +0000)
* class.c (layout_vtable_decl): Call build_array_of_n_type.
(build_vtt, build_ctor_vtabl_group): Likewise.

From-SVN: r166090

gcc/cp/ChangeLog
gcc/cp/class.c

index cc213f2f0edd13b76d4c5baf0349a1da4a575d7d..8df704f2bd33b7e5ac164ecfe4140d19e4245a5e 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-30  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * class.c (layout_vtable_decl): Call build_array_of_n_type.
+       (build_vtt, build_ctor_vtabl_group): Likewise.
+
 2010-10-30  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
@@ -8,7 +13,7 @@
        objc_maybe_build_component_ref instead of objc_build_setter_call.
        (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
        of objc_build_getter_call.
-       
+
 2010-10-27  Jason Merrill  <jason@redhat.com>
 
        * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
index a31aad3aba794c3a696e9dd19680ad0aba000049..50afc48cfd4df392de9bd187cfd0cc8646b92365 100644 (file)
@@ -1858,8 +1858,7 @@ layout_vtable_decl (tree binfo, int n)
   tree atype;
   tree vtable;
 
-  atype = build_cplus_array_type (vtable_entry_type,
-                                 build_index_type (size_int (n - 1)));
+  atype = build_array_of_n_type (vtable_entry_type, n);
   layout_type (atype);
 
   /* We may have to grow the vtable.  */
@@ -7295,8 +7294,8 @@ build_vtt (tree t)
     return;
 
   /* Figure out the type of the VTT.  */
-  type = build_index_type (size_int (VEC_length (constructor_elt, inits) - 1));
-  type = build_cplus_array_type (const_ptr_type_node, type);
+  type = build_array_of_n_type (const_ptr_type_node,
+                               VEC_length (constructor_elt, inits));
 
   /* Now, build the VTT object itself.  */
   vtt = build_vtable (t, mangle_vtt_for_type (t), type);
@@ -7551,8 +7550,8 @@ build_ctor_vtbl_group (tree binfo, tree t)
     }
 
   /* Figure out the type of the construction vtable.  */
-  type = build_index_type (size_int (VEC_length (constructor_elt, v) - 1));
-  type = build_cplus_array_type (vtable_entry_type, type);
+  type = build_array_of_n_type (vtable_entry_type,
+                               VEC_length (constructor_elt, v));
   layout_type (type);
   TREE_TYPE (vtbl) = type;
   DECL_SIZE (vtbl) = DECL_SIZE_UNIT (vtbl) = NULL_TREE;
This page took 0.378047 seconds and 5 git commands to generate.