diff options
author | Björn Gustavsson <[email protected]> | 2019-03-04 09:47:47 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-03-04 09:47:47 +0100 |
commit | f6b6441ed3fa4f539281b7baa0847d4f060aee66 (patch) | |
tree | 783f46a6d1c16b33a3c9d8aa593d69ca82ff99cf /lib/compiler/src/v3_kernel.erl | |
parent | b826c2ab153032fba974293dbba33352e05e0304 (diff) | |
parent | 1b706c511e9508c910296b255bdeb279e0957ff5 (diff) | |
download | otp-f6b6441ed3fa4f539281b7baa0847d4f060aee66.tar.gz otp-f6b6441ed3fa4f539281b7baa0847d4f060aee66.tar.bz2 otp-f6b6441ed3fa4f539281b7baa0847d4f060aee66.zip |
Merge pull request #2168 from josevalim/jv-v3_kernel-binary-all
Move size=all binary clause pruning to v3_kernel
Diffstat (limited to 'lib/compiler/src/v3_kernel.erl')
-rw-r--r-- | lib/compiler/src/v3_kernel.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/compiler/src/v3_kernel.erl b/lib/compiler/src/v3_kernel.erl index 908d34e1b4..e2b8787224 100644 --- a/lib/compiler/src/v3_kernel.erl +++ b/lib/compiler/src/v3_kernel.erl @@ -2054,6 +2054,10 @@ get_match(#k_cons{}, St0) -> get_match(#k_binary{}, St0) -> {[V]=Mes,St1} = new_vars(1, St0), {#k_binary{segs=V},Mes,St1}; +get_match(#k_bin_seg{size=#k_atom{val=all},next={k_bin_end,[]}}=Seg, St0) -> + {[S,N0],St1} = new_vars(2, St0), + N = set_kanno(N0, [no_usage]), + {Seg#k_bin_seg{seg=S,next=N},[S],St1}; get_match(#k_bin_seg{}=Seg, St0) -> {[S,N0],St1} = new_vars(2, St0), N = set_kanno(N0, [no_usage]), @@ -2081,6 +2085,9 @@ new_clauses(Cs0, U, St) -> #k_cons{hd=H,tl=T} -> [H,T|As]; #k_tuple{es=Es} -> Es ++ As; #k_binary{segs=E} -> [E|As]; + #k_bin_seg{size=#k_atom{val=all}, + seg=S,next={k_bin_end,[]}} -> + [S|As]; #k_bin_seg{seg=S,next=N} -> [S,N|As]; #k_bin_int{next=N} -> |