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: [vta->trunk] VTA merge


+	  if (!id->debug_stmts)
+	    id->debug_stmts = VEC_alloc (gimple, heap, 1);
+	  VEC_safe_push (gimple, heap, id->debug_stmts, copy);

Note that VEC_safe_push will also handle the initial allocation of the VEC from NULL. It's quite handy.

Which means that

   if (MAY_HAVE_DEBUG_STMTS)
-    VARRAY_GENERIC_PTR_INIT (id.debug_stmts, 8, "debug_stmt");
+    id.debug_stmts = VEC_alloc (gimple, heap, 0);

probably only needs to be


id.debug_stmts = NULL;


r~



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