diff options
author | Erlang/OTP <[email protected]> | 2010-04-01 05:34:09 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-04-01 05:34:09 +0000 |
commit | 263643a357e7a11724c599045ca35ba9aef2438c (patch) | |
tree | 659f70100c5d868b827ff13ee924bf7d8ba9e590 /lib/compiler/src/v3_core.erl | |
parent | 943ad16fa4b6335b6e170cc94fc7df9041ff4e47 (diff) | |
parent | f958b8bdbc63c5cbc60502047a4fab548fe9fd89 (diff) | |
download | otp-263643a357e7a11724c599045ca35ba9aef2438c.tar.gz otp-263643a357e7a11724c599045ca35ba9aef2438c.tar.bz2 otp-263643a357e7a11724c599045ca35ba9aef2438c.zip |
Merge branch 'bg/compiler-inliner' into dev
* bg/compiler-inliner:
pmod_SUITE: Again test inlining parameterized modules
compiler tests: Cope with missing args in function_clause for native code
compiler tests: Compile a few more modules with 'inline'
Consistently rewrite an inlined function_clause exception to case_clause
compiler tests: Test the 'inline' option better
compiler: Suppress bs_context_to_binary/1 for a literal operand
compiler: Fix binary matching bug in the inliner
sys_core_inline: Don't generated multiple compiler_generated annos
OTP-8552 bg/compiler-inliner
Several problems in the inliner have been fixed.
Diffstat (limited to 'lib/compiler/src/v3_core.erl')
-rw-r--r-- | lib/compiler/src/v3_core.erl | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl index 8b04969b05..4ac2196d79 100644 --- a/lib/compiler/src/v3_core.erl +++ b/lib/compiler/src/v3_core.erl @@ -1542,17 +1542,21 @@ new_vars_1(N, Anno, St0, Vs) when N > 0 -> new_vars_1(0, _, St, Vs) -> {Vs,St}. function_clause(Ps, Name) -> - fail_clause(Ps, c_tuple([#c_literal{anno=[{name,Name}], - val=function_clause}|Ps])). -function_clause(Ps, Anno, Name) -> - fail_clause(Ps, ann_c_tuple(Anno, - [#c_literal{anno=[{name,Name}], - val=function_clause}|Ps])). - -fail_clause(Pats, A) -> + function_clause(Ps, [], Name). + +function_clause(Ps, LineAnno, Name) -> + FcAnno = [{function_name,Name}], + fail_clause(Ps, FcAnno, + ann_c_tuple(LineAnno, [#c_literal{val=function_clause}|Ps])). + +fail_clause(Pats, Arg) -> + fail_clause(Pats, [], Arg). + +fail_clause(Pats, Anno, Arg) -> #iclause{anno=#a{anno=[compiler_generated]}, pats=Pats,guard=[], - body=[#iprimop{anno=#a{},name=#c_literal{val=match_fail},args=[A]}]}. + body=[#iprimop{anno=#a{anno=Anno},name=#c_literal{val=match_fail}, + args=[Arg]}]}. ubody(B, St) -> uexpr(B, [], St). |