diff options
author | Gerard Goossen <gerard@ggoossen.net> | 2011-06-15 11:32:53 +0200 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-07-28 14:50:19 -0700 |
commit | d164302a58430157957e90a71e7a08de7eabbc94 (patch) | |
tree | ef2c4e6757d48ab0322715c9515be6118dcd39e0 /pp_ctl.c | |
parent | 9feb131675d04c74cc7462275ae5b70055f1c4ba (diff) | |
download | perl-d164302a58430157957e90a71e7a08de7eabbc94.tar.gz |
Add finalize_optree function which can take over all the compile time checking/finalization now being done by the peephole optimizer.
This function takes the optree after it is finished building. It
takes over some of the checking and final conversions which are currently being
done by the peephole optimizer.
Add the moment this is an unnecessary extra step after the peephole optimizer, but with
a separate code generation step, the current peephole optimizer can't exists and
this function will take over all its essential compile time functions.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -3522,11 +3522,14 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) if (yystatus || PL_parser->error_count || !PL_eval_root) { SV **newsp; /* Used by POPBLOCK. */ - PERL_CONTEXT *cx = NULL; + PERL_CONTEXT *cx; I32 optype; /* Used by POPEVAL. */ - SV *namesv = NULL; + SV *namesv; const char *msg; + parse_error: + cx = NULL; + namesv = NULL; PERL_UNUSED_VAR(newsp); PERL_UNUSED_VAR(optype); @@ -3595,6 +3598,11 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) else scalar(PL_eval_root); + finalize_optree(PL_eval_root); + + if (PL_parser->error_count) /* finalize_optree might have generated new error */ + goto parse_error; + DEBUG_x(dump_eval()); /* Register with debugger: */ |