[trunk][patch] Don't print warnings in mangle_decl

Mark Mitchell mark@codesourcery.com
Fri Apr 17 03:19:00 GMT 2009


Rafael Espindola wrote:

> 2009-04-16  Rafael Avila de Espindola  <espindola@google.com>
> 
> 	* cp-tree.h (lang_identifier): Add ABI_WARNING.
> 	(IDENTIFIER_EMIT_ABI_WARNING_P): New.
> 	* decl.c (cp_finish_decl): Print warning for ABI changes.
> 	* mangle.c (finish_mangling_internal): Don't print warning. Set
> 	ABI_WARNING if one is needed. Update all callers.
> 	* semantics.c (expand_or_defer_fn): Print warning for ABI changes.

Rafael, you're going to hate me.  I apologize.

The problem with this approach -- which is exactly what I suggested --
is that it's going to cause us to generate mangled names for every
variable, even ones where we don't need the mangled name.  And we worked
pretty hard a while back to try to make mangling lazy, because
allocating all the memory for mangled names made the compiler a lot slower.

So, what do we do?  I'd like this to be lazy.  But, that means that
we're going to generate mangled names somewhere late in the game, maybe
when generating GENERIC.  And that's not at a predictable place in the
front end, which is what you were looking for so that we could do nice
error generation.  I don't see how we can have both of laziness and
errors at the point of declaration.

Jason, what do you think?  What's the right tradeoff here?

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list