On 07/05/2013 10:04 AM, Marek Polacek wrote:
+/* This type represents an entry in the hash table.  */

Please describe the hash table more up here.  What are you tracking?

+  hashval_t h = iterative_hash_object (data->type, 0);
+  h = iterative_hash_object (data->decl, h);

If you hash the decl as well as the type, the find_slot in ubsan_type_descriptor will almost never find an existing entry.

+uptr_type (void)
+{
+  return build_nonstandard_integer_type (POINTER_SIZE, 1);

Why not use uintptr_type_node?

I have yet to handle
freeing the hash table, but I think I'll need the GTY machinery for
this (ubsan is not a pass, so I can't just call it at the end of the
pas).  Or maybe just create a destructor and use append_to_statement_list.

That won't work; append_to_statement_list is for things that happen at runtime, but freeing the hash table is something that needs to happen in the compiler.

+/* This routine returns a magic number for TYPE.
+   ??? This is probably too ugly.  Tweak it.  */
+
+static unsigned short
+get_tinfo_for_type (tree type)

Why map from size to some magic number rather than use the size directly? Also, "tinfo" sounds to me like something to do with C++ type_info.

Jason

Reply via email to