aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/v3_core.erl
AgeCommit message (Collapse)Author
2010-03-26Consistently rewrite an inlined function_clause exception to case_clauseBjörn Gustavsson
A function_clause exception is generated by jumping to a func_info/3 instruction at the beginning of the function. The x registers are assumed to contain the arguments for the function. That means that a func_info/3 instruction copied from another function (or even from the same function if not at the top level) will not work, so it must be replaced with an instruction that generates a case_clause exception. In Core Erlang, a func_info/3 instruction is represented as a the primop match_fail({function_clause,Arg1,...ArgN}). The current mechanism that is supposed to replace the primop match_fail(function_clause) with match_fail(case_clause) will fail to do that in the following circumstances: 1. If the inliner has inlined a function into itself. Fix that by having the inliner clear the function_name annotations on all match_fail primops in functions that are inlined. (To simplify doing that, the annotation is now on the primop node itself and not on the 'function_clause' atom inside it.) 2. If the inliner has rewritten the tuple node in the primop node to a literal (when inlining a function call with literal arguments), v3_kernel would not recognize the match_fail(function_clause) primop and would not rewrite it. Fix it by making v3_kernel smarter. Also simplify the "old" inliner (sys_core_inline) to only clear the function_name annotations instead of rewriting function_clause execptions to case_clause execptions itself.
2010-03-22compiler: Don't support the no_binaries optionBjörn Gustavsson
The no_binaries option terminates the compiler with an error if any bit syntax is used in the module being compiled. (It used to be implied by the removed r11 option.)
2010-02-10Merge branch 'ks/compiler' into ccase/r13b04_devErlang/OTP
* ks/compiler: compiler: keep line numbers for attributes compiler Makefile: alphabetize module names compile.erl: eliminate compiler warning
2010-02-10compiler: keep line numbers for attributesKostis Sagonas
In the future, we might want to generate warnings for attributes, referring to them with line numbers. sys_pre_expand used to replace line number for attributes with 0. Change sys_pre_expand to retain the real line number. v3_core used to throw away the line numbers. Change v3_core so that it retains the line numbers in annotations. While at it, do some tidying as suggested by tidier.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP