Permalink
Browse files

Analyze methods for "can never use return" also.

This means that we can generate simpler code for such methods, which
in turn makes many more methods possible to inline.
  • Loading branch information...
jnthn committed Jun 13, 2017
1 parent 4aa60ad commit b0a1b6c31c8ee93dec53ba117bd2d8b68bfcfd31
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/Perl6/Actions.nqp
View
@@ -3922,7 +3922,16 @@ class Perl6::Actions is HLL::Actions does STDActions {
if $past.ann('placeholder_sig') {
$/.PRECURSOR.panic('Placeholder variables cannot be used in a method');
}
$past[1] := wrap_return_handler($past[1]);
if is_clearly_returnless($past) {
$past[1] := QAST::Op.new(
:op('p6decontrv'),
QAST::WVal.new( :value($*DECLARAND) ),
$past[1]);
$past[1] := wrap_return_type_check($past[1], $*DECLARAND);
}
else {
$past[1] := wrap_return_handler($past[1]);
}
}
$past.blocktype('declaration_static');

0 comments on commit b0a1b6c

Please sign in to comment.