aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZandra Hird <[email protected]>2015-05-29 14:49:20 +0200
committerZandra Hird <[email protected]>2015-05-29 14:49:20 +0200
commit23501295ea5289897a75cb52a23685f8e6fcf18c (patch)
tree0a205290c9f7ea90e689bd1fd11dd679eefb7b50
parentcefae2f3a1934e9a6eb05c8b2b83ffc9ecc2bce9 (diff)
parent20c628e7c4c06b58fbf9d923e6aafe65fa6f7d20 (diff)
downloadotp-23501295ea5289897a75cb52a23685f8e6fcf18c.tar.gz
otp-23501295ea5289897a75cb52a23685f8e6fcf18c.tar.bz2
otp-23501295ea5289897a75cb52a23685f8e6fcf18c.zip
Merge branch 'kostis/cerl_pmatch'
* kostis/cerl_pmatch: Allow use of complete interface of cerl_pmatch module OTP-12794
-rw-r--r--lib/hipe/cerl/cerl_pmatch.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/hipe/cerl/cerl_pmatch.erl b/lib/hipe/cerl/cerl_pmatch.erl
index 3bc93e80dd..4f04b0a7ed 100644
--- a/lib/hipe/cerl/cerl_pmatch.erl
+++ b/lib/hipe/cerl/cerl_pmatch.erl
@@ -31,7 +31,7 @@
-module(cerl_pmatch).
--define(NO_UNUSED, true).
+%%-define(NO_UNUSED, true).
-export([clauses/2]).
-ifndef(NO_UNUSED).
@@ -59,6 +59,8 @@
%% @see transform/2
-ifndef(NO_UNUSED).
+-spec core_transform(cerl:c_module(), [_]) -> cerl:c_module().
+
core_transform(M, Opts) ->
cerl:to_records(transform(cerl:from_records(M), Opts)).
-endif. % NO_UNUSED
@@ -76,6 +78,8 @@ core_transform(M, Opts) ->
%% @see core_transform/2
-ifndef(NO_UNUSED).
+-spec transform(cerl:cerl(), [_]) -> cerl:cerl().
+
transform(M, _Opts) ->
expr(M, env__empty()).
-endif. % NO_UNUSED
@@ -109,7 +113,7 @@ transform(M, _Opts) ->
%% @see expr/2
%% @see transform/2
--spec clauses([cerl:cerl()], rec_env:environment()) ->
+-spec clauses([cerl:cerl(),...], rec_env:environment()) ->
{cerl:cerl(), [cerl:cerl()]}.
clauses(Cs, Env) ->
@@ -406,6 +410,8 @@ make_let(Vs, A, B) ->
%% @see rec_env
-ifndef(NO_UNUSED).
+-spec expr(cerl:cerl(), rec_env:environment()) -> cerl:cerl().
+
expr(E, Env) ->
case cerl:type(E) of
literal ->