aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/erl_bifs.erl
diff options
context:
space:
mode:
authorMichał Muskała <[email protected]>2018-02-17 09:33:17 +0100
committerMichał Muskała <[email protected]>2018-06-06 23:19:34 +0200
commit5ba1635518459f581811b30f386fdf1f21f54178 (patch)
treee10b62472cd5393860f566fcd8540d77af30e142 /lib/compiler/src/erl_bifs.erl
parent9ae2044073e6433030ce30756658b103ce67c3c1 (diff)
downloadotp-5ba1635518459f581811b30f386fdf1f21f54178.tar.gz
otp-5ba1635518459f581811b30f386fdf1f21f54178.tar.bz2
otp-5ba1635518459f581811b30f386fdf1f21f54178.zip
Fold is_function/1,2 during compilation
This can often appear in code after inlining some higher-order functions. * mark is_function/2 as pure * track function types in sys_core_fold * use those types to eval is_function/1,2 at compile-time when possible
Diffstat (limited to 'lib/compiler/src/erl_bifs.erl')
-rw-r--r--lib/compiler/src/erl_bifs.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compiler/src/erl_bifs.erl b/lib/compiler/src/erl_bifs.erl
index a7452aebc8..71ab0e872a 100644
--- a/lib/compiler/src/erl_bifs.erl
+++ b/lib/compiler/src/erl_bifs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2017. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2018. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -91,6 +91,7 @@ is_pure(erlang, is_bitstring, 1) -> true;
%% erlang:is_builtin/3 depends on the state (i.e. the version of the emulator).
is_pure(erlang, is_float, 1) -> true;
is_pure(erlang, is_function, 1) -> true;
+is_pure(erlang, is_function, 2) -> true;
is_pure(erlang, is_integer, 1) -> true;
is_pure(erlang, is_list, 1) -> true;
is_pure(erlang, is_map, 1) -> true;