On 11/23/2016 12:32 PM, Martin Sebor wrote:

My worry here would be a hash collision.  Then we'd be using object
sizes from the wrong function.

Ah, right, that might explain the ICE I just noticed during Ada
bootstrap.  Is there some other way to uniquely identify a function?
A DECL_UID maybe?
DECL_UID would be your best bet. But ISTM that trying to avoid invocations by reusing data from prior passes is likely to be more fragile than recomputing on a per-pass basis -- as long as the number of times we need this stuff is small (as I suspect it is).



Isn't the goal here to be able to get format-length warnings when there
aren't explicit calls to _b_o_s in the IL?   Can't you initialize the
object-size framework at the start of your pass and tear it down when
your pass is complete?  You could do that by exporting the init/fini
routines and calling them directly, or by wrapping that in a class and
instantiating the class when you need it.

That would avoid having to worry about the GC system entirely since you
wouldn't have stuff living across passes.

Yes, that is the immediate goal of this patch.  Beyond it, though,
I would like to call this function from anywhere, including during
expansion (as is done in my patch for bug 53562 and related).
But why not detect the builtins during your pass and check there. ie, I don't see why we necessarily need to have checking and expansion intertwined together. Maybe I'm missing something. Is there something that makes it inherently easier or better to implement checking during builtin expansion?

Jeff

Reply via email to