PATCH: Do not call uses_template_parms() unless necessary

Mark Mitchell mark@codesourcery.com
Tue Apr 15 17:59:00 GMT 2003


On Tue, 2003-04-15 at 10:48, Geoffrey Keating wrote:
> 
> On Tuesday, April 15, 2003, at 09:39  AM, Mark Mitchell wrote:
> 
> > On Mon, 2003-04-14 at 17:31, Ziemowit Laski wrote:
> >> This super-trivial patch has been pre-approved by Geoff; I will
> >> place it in 3.3 and mainline.
> >
> > Not without a test case you won't. :-)
> 
> It's a very small speed improvement (it also helps for objective-C++).

Oh, I thought it was a correctness thing.

If it's a speed improvement, it needs a comment.

And if we're going to start factoring NULL tests out of functions to
avoid function call overhead, the the right way to do that is:

  bool predicate_f (tree);

  #define predicate(T) ((T) ? predicate_f ((T)) : false)

or the equivalent version with an inline function.

We may as well take these wins everywhere, and keep the code tidy, then
spread this stuff out all over the place.

Otherwise, there's high likelihood I will rip that out the next time I
encounter it, as soon as I notice it's redundant with the body of the
function.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com



More information about the Gcc-patches mailing list