aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_ssa_type.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-01-18 05:53:48 +0100
committerBjörn Gustavsson <[email protected]>2019-01-18 05:53:48 +0100
commit277331c4823e10a7bbc723a7116cb5e26596a408 (patch)
tree0b8e01e74c653fb2d755576594dabdca2e8ae804 /lib/compiler/src/beam_ssa_type.erl
parentceb43f022dcb1f461c53773392a40a4afbc291cf (diff)
downloadotp-277331c4823e10a7bbc723a7116cb5e26596a408.tar.gz
otp-277331c4823e10a7bbc723a7116cb5e26596a408.tar.bz2
otp-277331c4823e10a7bbc723a7116cb5e26596a408.zip
beam_ssa_type: Simplify is_singleton_type/1
Diffstat (limited to 'lib/compiler/src/beam_ssa_type.erl')
-rw-r--r--lib/compiler/src/beam_ssa_type.erl6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/compiler/src/beam_ssa_type.erl b/lib/compiler/src/beam_ssa_type.erl
index 4ea3781783..ede57875e2 100644
--- a/lib/compiler/src/beam_ssa_type.erl
+++ b/lib/compiler/src/beam_ssa_type.erl
@@ -1218,10 +1218,8 @@ t_tuple_size(#t_tuple{size=Size,exact=true}) ->
t_tuple_size(_) ->
none.
-is_singleton_type(#t_atom{elements=[_]}) -> true;
-is_singleton_type(#t_integer{elements={V,V}}) -> true;
-is_singleton_type(nil) -> true;
-is_singleton_type(_) -> false.
+is_singleton_type(Type) ->
+ get_literal_from_type(Type) =/= none.
%% join(Type1, Type2) -> Type
%% Return the "join" of Type1 and Type2. The join is a more general