This is the mail archive of the
mailing list for the GCC project.
Re: [ubsan] Add libcall arguments
- From: Jason Merrill <jason at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 18 Jul 2013 15:47:28 -0400
- Subject: Re: [ubsan] Add libcall arguments
- References: <20130705140431 dot GB21800 at redhat dot com>
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.
+ 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
+/* 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++