develooper Front page | perl.perl5.porters | Postings from January 2014

Re: [perl #121077] [PATCH] Optimise 'my $x; my $y' into 'my ($x, $y)'

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
January 27, 2014 15:17
Subject:
Re: [perl #121077] [PATCH] Optimise 'my $x; my $y' into 'my ($x, $y)'
Message ID:
20140127151642.GW2319@iabyn.com
On Mon, Jan 27, 2014 at 09:16:19AM -0500, Matthew Horsfall (alh) wrote:
> Actually, Dave, your original padrange optimisation does a lot more
> work here to make sure warnings are reported correctly.
> 
> Should that be duplicated here?


I'm not sure what you're referring to. Do you mean the code that finds
the variable name to report uninitialised vars?

What I did there was to keep the old unoptimised ops handing around,
so that S_find_uninit_var() didn't have to be updated to understand
the padrange op. But in your case, you're modifying the op tree to be
exactly the same as that which would have been generated if someone had
typed 'my ($x,$y)' rather than 'my $x; my $y'. So all other code,
including S_find_uninit_var(), B::Concise, B::Deparse etc is already
geared up to handle that optree structure.

-- 
Never work with children, animals, or actors.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About