diff --git a/src/otpbp_beam_lib.erl b/src/otpbp_beam_lib.erl index f551ea3..7e702b7 100644 --- a/src/otpbp_beam_lib.erl +++ b/src/otpbp_beam_lib.erl @@ -55,7 +55,7 @@ strip_release(Root, AdditionalChunks) -> catch strip_rel(Root, AdditionalChunks) -define(NEED_error_1, true). -endif. --compile({inline, [strip_rel/2]}). +-compile({inline, strip_rel/2}). strip_rel(Root, AdditionalChunks) -> filelib:is_dir(Root) orelse error({not_a_directory, Root}), strip_fils(filelib:wildcard(filename:join([Root, "lib", "*", "ebin", "*.beam"])), AdditionalChunks). @@ -79,7 +79,7 @@ strip_file(File, AdditionalChunks) -> {ok, Stripped} = beam_lib:build_module(Chunks), strip_file(File, Mod, zlib:gzip(Stripped)). --compile({inline, [strip_file/3]}). +-compile({inline, strip_file/3}). strip_file(File, Mod, Stripped) when is_binary(File) -> {ok, {Mod, Stripped}}; strip_file(File, Mod, Stripped) -> FileName = filename:rootname(File, ".beam") ++ ".beam", @@ -92,7 +92,7 @@ strip_file(File, Mod, Stripped) -> Error -> file_error(FileName, Error) end. --compile({inline, [read_significant_chunks/2]}). +-compile({inline, read_significant_chunks/2}). read_significant_chunks(File, ChunkList) -> {ok, {Module, Chunks}} = beam_lib:chunks(File, ChunkList, [allow_missing_chunks]), {Module, lists:filter(fun({_, Data}) when is_binary(Data) -> true; @@ -100,7 +100,7 @@ read_significant_chunks(File, ChunkList) -> lists:member(Id, mandatory_chunks()) andalso error({missing_chunk, File, Id}) end, Chunks)}. --compile({inline, [mandatory_chunks/0]}). +-compile({inline, mandatory_chunks/0}). mandatory_chunks() -> ["Code", "ExpT", "ImpT", "StrT"]. file_error(FileName, {error, Reason}) -> error({file_error, FileName, Reason}). diff --git a/src/otpbp_c.erl b/src/otpbp_c.erl index 8f07ec2..ab226d2 100644 --- a/src/otpbp_c.erl +++ b/src/otpbp_c.erl @@ -84,7 +84,7 @@ c(Module, Options, Filter) when is_atom(Module) -> Error -> {error, Error} end. --compile({inline, [c/5]}). +-compile({inline, c/5}). c(SrcFile, Options, Filter, BeamFile, Info) -> io:fwrite("Recompiling ~ts\n", [SrcFile]), %% Note that it's possible that because of options such as 'to_asm', @@ -113,7 +113,7 @@ c(SrcFile, Options, Filter, BeamFile, Info) -> is_outdir_opt({outdir, _}) -> true; is_outdir_opt(_) -> false. --compile({inline, [find_beam/1]}). +-compile({inline, find_beam/1}). find_beam(Module) -> case code:which(Module) of [_|_] = Beam -> @@ -131,7 +131,7 @@ find_beam(Module) -> Error -> Error end. --compile({inline, [compile_info/2]}). +-compile({inline, compile_info/2}). compile_info(Module, Beam) -> case module_loaded(Module) of true -> @@ -149,7 +149,7 @@ compile_info(Module, Beam) -> end end. --compile({inline, [find_source/2]}). +-compile({inline, find_source/2}). find_source(BeamFile, Info) -> case lists:keyfind(source, 1, Info) of {_, SrcFile} -> @@ -176,7 +176,7 @@ compile_and_load(File, Opts0) when is_list(Opts0) -> end; compile_and_load(File, Opt) -> compile_and_load(File, [Opt]). --compile({inline, [ensure_from/2]}). +-compile({inline, ensure_from/2}). ensure_from(Suffix, Opts0) -> case lists:partition(fun(O) -> O =:= from_core orelse O =:= from_asm end, if diff --git a/src/otpbp_code.erl b/src/otpbp_code.erl index d75bf5f..6a4f5c3 100644 --- a/src/otpbp_code.erl +++ b/src/otpbp_code.erl @@ -246,7 +246,7 @@ where_is_file(T, File, D, Files) -> _false -> where_is_file(T, File) end. --compile({inline, [module_changed_on_disk/2]}). +-compile({inline, module_changed_on_disk/2}). module_changed_on_disk(Module, Path) -> Arch = erlang:system_info(hipe_architecture), case Arch =/= undefined andalso code:is_module_native(Module) of diff --git a/src/otpbp_erl_internal.erl b/src/otpbp_erl_internal.erl index b7e7645..3fb228a 100644 --- a/src/otpbp_erl_internal.erl +++ b/src/otpbp_erl_internal.erl @@ -8,14 +8,14 @@ -ifndef(HAVE_erl_internal__add_predefined_functions_1). add_predefined_functions(Forms) -> Forms ++ predefined_functions(Forms). --compile({inline, [predefined_functions/1]}). +-compile({inline, predefined_functions/1}). predefined_functions(Forms) -> Attrs = [{Name, Val} || {attribute, _, Name, Val} <- Forms], {module, Mod} = lists:keyfind(module, 1, Attrs), Mpf = lists:map(fun erl_parse:new_anno/1, module_predef_func_beh_info(Attrs) ++ module_predef_funcs_mod_info(Mod)), [{attribute, 0, export, [{F, A} || {function, _, F, A, _} <- Mpf]}|Mpf]. --compile({inline, [module_predef_func_beh_info/1]}). +-compile({inline, module_predef_func_beh_info/1}). module_predef_func_beh_info(Attrs) -> case [Callback || {callback, Callback} <- Attrs] of [] -> []; @@ -25,7 +25,7 @@ module_predef_func_beh_info(Attrs) -> {clause, 0, [{atom, 0, optional_callbacks}], [], [make_list(get_optional_callbacks(Attrs))]}]}] end. --compile({inline, [get_optional_callbacks/1]}). +-compile({inline, get_optional_callbacks/1}). get_optional_callbacks(Attrs) -> lists:foldr(fun({optional_callbacks, O}, A) -> case is_fa_list(O) of @@ -35,7 +35,7 @@ get_optional_callbacks(Attrs) -> (_, A) -> A end, [], Attrs). --compile({inline, [is_fa_list/1]}). +-compile({inline, is_fa_list/1}). is_fa_list(L) -> is_list(L) andalso lists:all(fun({FuncName, Arity}) -> is_atom(FuncName) andalso is_integer(Arity) andalso Arity >= 0; @@ -46,7 +46,7 @@ make_list(L) -> lists:foldr(fun({Name, Arity}, A) -> {cons, 0, {tuple, 0, [{atom, 0, Name}, {integer, 0, Arity}]}, A} end, {nil, 0}, L). --compile({inline, [module_predef_funcs_mod_info/1]}). +-compile({inline, module_predef_funcs_mod_info/1}). module_predef_funcs_mod_info(Mod) -> ModAtom = {atom, 0, Mod}, [{function, 0, module_info, 0, diff --git a/src/otpbp_gen_event.erl b/src/otpbp_gen_event.erl index 3fe7335..b45092e 100644 --- a/src/otpbp_gen_event.erl +++ b/src/otpbp_gen_event.erl @@ -55,7 +55,7 @@ start_monitor(Name, Options) -> Pid -> {error, {already_started, Pid}} end. --compile({inline, [where/1]}). +-compile({inline, where/1}). where({global, Name}) -> global:whereis_name(Name); where({via, Module, Name}) -> Module:whereis_name(Name); where({local, Name}) -> whereis(Name). diff --git a/src/otpbp_gen_server.erl b/src/otpbp_gen_server.erl index d218fea..ddae877 100644 --- a/src/otpbp_gen_server.erl +++ b/src/otpbp_gen_server.erl @@ -21,7 +21,7 @@ start_monitor(Name, Module, Args, Options) -> Pid -> {error, {already_started, Pid}} end. --compile({inline, [where/1]}). +-compile({inline, where/1}). where({global, Name}) -> global:whereis_name(Name); where({via, Module, Name}) -> Module:whereis_name(Name); where({local, Name}) -> whereis(Name). diff --git a/src/otpbp_httpd.erl b/src/otpbp_httpd.erl index 648e149..bf234ab 100644 --- a/src/otpbp_httpd.erl +++ b/src/otpbp_httpd.erl @@ -48,7 +48,7 @@ do_serve(#{help := true}) -> halt(0); do_serve(#{address := Address, port := Port, directory := Path}) -> do_serve(Address, Port, Path). --compile({inline, [do_serve/3]}). +-compile({inline, do_serve/3}). do_serve({_, _, _, _} = Address, Port, Path) -> do_serve(Address, Port, Path, inet); do_serve(Address, Port, Path) -> do_serve(Address, Port, Path, inet6). @@ -73,10 +73,10 @@ do_serve(Address, Port, Path, IpFamily) -> From ! done end. --compile({inline, [default_mime_types/0]}). +-compile({inline, default_mime_types/0}). default_mime_types() -> find_mime_types("/etc/mime.types"). --compile({inline, [find_mime_types/1]}). +-compile({inline, find_mime_types/1}). find_mime_types(Path) -> case filelib:is_file(Path) of true -> Path; diff --git a/src/otpbp_io_lib.erl b/src/otpbp_io_lib.erl index 8e9043d..490731a 100644 --- a/src/otpbp_io_lib.erl +++ b/src/otpbp_io_lib.erl @@ -68,7 +68,7 @@ limit_map([{K, V}|T], D, A) -> limit_map(T, D - 1, A#{K => V}). %% limit_map_assoc(K, V, D) -> %% {limit(K, D-1), limit(V, D-1)}. --compile({inline, [limit_tuple/2]}). +-compile({inline, limit_tuple/2}). limit_bitstring(B, _D) -> B. %% Keeps all printable binaries. @@ -118,7 +118,7 @@ test_limit_map(_Map, _D) -> ok. %% test_limit_map_assoc(K, V, D) -> %% test_limit(K, D-1), %% test_limit(V, D-1). --compile({inline, [test_limit_tuple/2]}). +-compile({inline, test_limit_tuple/2}). test_limit_bitstring(_, _) -> ok. -endif. @@ -136,7 +136,7 @@ write_atom_as_latin1(Atom) -> false -> Chars end. --compile({inline, [quote_atom/2]}). +-compile({inline, quote_atom/2}). quote_atom(_Atom, []) -> true; quote_atom(Atom, [C|Cs]) when is_integer(C) -> if @@ -147,7 +147,7 @@ quote_atom(Atom, [C|Cs]) when is_integer(C) -> name_chars([C|Cs]) when is_integer(C) -> name_char(C) andalso name_chars(Cs); name_chars([]) -> true. --compile({inline, [name_char/1]}). +-compile({inline, name_char/1}). name_char(C) -> C >= $0 andalso C =< $9 orelse C >= $a andalso C =< $z orelse diff --git a/src/otpbp_proc_lib.erl b/src/otpbp_proc_lib.erl index 694456f..e75686b 100644 --- a/src/otpbp_proc_lib.erl +++ b/src/otpbp_proc_lib.erl @@ -90,7 +90,7 @@ sync_start_monitor({Pid, Ref}, Timeout) -> {{error, timeout}, Ref} end. --compile({inline, [kill_flush/1]}). +-compile({inline, kill_flush/1}). kill_flush(Pid) -> unlink(Pid), exit(Pid, kill), diff --git a/src/otpbp_pt.erl b/src/otpbp_pt.erl index e5d15ed..fd6abe4 100644 --- a/src/otpbp_pt.erl +++ b/src/otpbp_pt.erl @@ -360,7 +360,7 @@ parse_transform(Forms, Options) -> _ -> Forms end. --compile({inline, [get_funs/3]}). +-compile({inline, get_funs/3}). get_funs(AF, Options, TL) -> lists:foldl(fun({M, Fs}, IA) -> lists:foldl(fun(FA, IAM) -> @@ -373,7 +373,7 @@ get_funs(AF, Options, TL) -> maps:without(get_no_auto_import(AF, Options), TL), proplists:get_value(imports, AF, [])). --compile({inline, [get_no_auto_import/2]}). +-compile({inline, get_no_auto_import/2}). get_no_auto_import(AF, Options) -> lists:usort(proplists:append_values(no_auto_import, proplists:append_values(compile, @@ -386,7 +386,7 @@ transform(Tree, P) -> _ -> {Tree, P} end. --compile({inline, [transform_function/2]}). +-compile({inline, transform_function/2}). transform_function(Tree, P) -> case erl_syntax_lib:mapfold(fun(E, F) -> case function_transform(E, P) of @@ -398,7 +398,7 @@ transform_function(Tree, P) -> _ -> Tree end. --compile({inline, [transform_attribute/2]}). +-compile({inline, transform_attribute/2}). transform_attribute(Tree, P) -> case erl_syntax_lib:analyze_attribute(Tree) of {file, {F, _}} -> {Tree, P#param{file = F}}; @@ -418,7 +418,7 @@ transform_behaviour({_, _, _, B} = Tree, #param{behaviours = Bs}) -> end; transform_behaviour(Tree, _) -> Tree. --compile({inline, [check_behaviour/1]}). +-compile({inline, check_behaviour/1}). check_behaviour(B) -> try B:module_info(exports) of Exports -> lists:member({behaviour_info, 1}, Exports) @@ -451,7 +451,7 @@ store_func(F, {_, _} = MF, D) -> D#{F => MF}; store_func({_, {F, _}} = MFA, M, D) -> store_func(MFA, {M, F}, D); store_func({F, _} = FA, M, D) -> store_func(FA, {M, F}, D). --compile({inline, [transform_list/0]}). +-compile({inline, transform_list/0}). transform_list() -> lists:foldl(fun({F, D}, Acc) -> add_func(F, D, Acc) end, #{}, ?TRANSFORM_FUNCTIONS). function_transform(Node, #param{} = P) -> @@ -463,7 +463,7 @@ function_transform(Node, #param{} = P) -> _ -> false end. --compile({inline, [conjunction_transform/1]}). +-compile({inline, conjunction_transform/1}). conjunction_transform(Node) -> case erl_syntax_lib:mapfold(fun(E, F) -> case type(E) =:= application andalso application_transform_guard(E) of @@ -475,14 +475,14 @@ conjunction_transform(Node) -> _ -> Node end. --compile({inline, [application_transform_guard/1]}). +-compile({inline, application_transform_guard/1}). application_transform_guard(Node) -> case erl_syntax_lib:analyze_application(Node) of {M, {N, _}} -> application_guard(Node, M, N); _ -> false end. --compile({inline, [application_guard/3]}). +-compile({inline, application_guard/3}). application_guard(Node, otpbp_erlang, ceil) -> application_guard_ceil_floor(Node, '+'); application_guard(Node, otpbp_erlang, floor) -> application_guard_ceil_floor(Node, '-'); application_guard(_, _, _) -> false. @@ -505,7 +505,7 @@ application_transform(Node, #param{funs = FL} = P) -> end end. --compile({inline, [application_transform/2]}). +-compile({inline, application_transform/2}). application_transform(Node, P, A, L) -> case L of #{A := {M, N}} -> @@ -519,7 +519,7 @@ application_transform(Node, P, A, L) -> #{} -> false end. --compile({inline, [apply_transform/3]}). +-compile({inline, apply_transform/3}). apply_transform(Node, #param{apply = AL} = P, A) -> lists:member(A, AL) andalso case erl_syntax:application_arguments(Node) of @@ -544,10 +544,10 @@ application(remote, O, As, M, N) -> application_(mqa(O), mqb(O), As, M, N). application_(O1, O2, As, M, N) -> application_(atom(O1, M), atom(O2, N), As). --compile({inline, [application_/3]}). +-compile({inline, application_/3}). application_(M, N, As) -> erl_syntax:application(cp(M, erl_syntax:module_qualifier(M, N)), As). --compile({inline, [implicit_fun_transform/2]}). +-compile({inline, implicit_fun_transform/2}). implicit_fun_transform(Node, #param{funs = L} = P) -> try erl_syntax_lib:analyze_implicit_fun(Node) of F -> case L of @@ -567,7 +567,7 @@ implicit_fun_transform(Node, #param{funs = L} = P) -> throw:syntax_error -> false end. --compile({inline, [try_expr_transform/1]}). +-compile({inline, try_expr_transform/1}). try_expr_transform(Node) -> case lists:mapfoldr(fun(H, A) -> case try_expr_handler_transform(H) of @@ -582,7 +582,7 @@ try_expr_transform(Node) -> Hs, erl_syntax:try_expr_after(Node))) end. --compile({inline, [try_expr_handler_transform/1]}). +-compile({inline, try_expr_handler_transform/1}). try_expr_handler_transform(Node) -> case type(Node) =:= clause andalso try_expr_clause_patterns_transform(erl_syntax:clause_patterns(Node)) of {P, {true, B}} -> @@ -590,7 +590,7 @@ try_expr_handler_transform(Node) -> _ -> false end. --compile({inline, [try_expr_clause_patterns_transform/1]}). +-compile({inline, try_expr_clause_patterns_transform/1}). try_expr_clause_patterns_transform(Ps) -> lists:mapfoldr(fun(P, {_, L} = A) -> case type(P) of @@ -659,29 +659,29 @@ match_expr_list(M, L) -> [cp(M, erl_syntax:match_expr(M, cp(M, application(local atom(P, A) when is_tuple(P), is_atom(A) -> cp(P, erl_syntax:atom(A)). --compile({inline, [otp_release/0]}). +-compile({inline, otp_release/0}). otp_release() -> list_to_integer(erlang:system_info(otp_release)). --compile({inline, [erts_version/0]}). +-compile({inline, erts_version/0}). erts_version() -> lists:map(fun list_to_integer/1, string:tokens(erlang:system_info(version), ".")). replace_message(_Node, #param{verbose = false}, _F, _NM, _NN) -> ok; replace_message(Node, #param{file = File}, F, NM, NN) -> replace_message_(erl_syntax:get_pos(Node), File, F, NM, NN). --compile({inline, [replace_message_/5]}). +-compile({inline, replace_message_/5}). replace_message_(P, F, {M, {N, A}}, NM, NN) -> replace_message_(P, F, lists:concat([M, ":", N]), NM, NN, A); replace_message_(P, F, {N, A}, NM, NN) -> replace_message_(P, F, N, NM, NN, A). replace_message_(P, F, N, NM, NN, A) -> io:fwrite("~ts:~p: replace ~ts/~B to ~s:~ts/~B~n", [F, P, N, A, NM, NN, A]). --compile({inline, [cp/2]}). +-compile({inline, cp/2}). cp(S, T) -> erl_syntax:copy_pos(S, T). --compile({inline, [type/1]}). +-compile({inline, type/1}). type(N) -> erl_syntax:type(N). --compile({inline, [mqa/1]}). +-compile({inline, mqa/1}). mqa(N) -> erl_syntax:module_qualifier_argument(N). --compile({inline, [mqb/1]}). +-compile({inline, mqb/1}). mqb(N) -> erl_syntax:module_qualifier_body(N). diff --git a/src/otpbp_pubkey_os_cacerts.erl b/src/otpbp_pubkey_os_cacerts.erl index 7c43f35..8744ad6 100644 --- a/src/otpbp_pubkey_os_cacerts.erl +++ b/src/otpbp_pubkey_os_cacerts.erl @@ -77,7 +77,7 @@ get() -> CaCerts -> CaCerts end. --compile({inline, [get1/0]}). +-compile({inline, get1/0}). -ifdef(HAVE_persistent_term__get_1). get1() -> persistent_term:get(pubkey_os_cacerts). -else. @@ -87,7 +87,7 @@ get1() -> Value. -endif. --compile({inline, [get2/0]}). +-compile({inline, get2/0}). -ifdef(HAVE_persistent_term__get_2). get2() -> persistent_term:get(pubkey_os_cacerts, undefined). -else. diff --git a/src/otpbp_rand.erl b/src/otpbp_rand.erl index 0dc2771..d3d910b 100644 --- a/src/otpbp_rand.erl +++ b/src/otpbp_rand.erl @@ -161,7 +161,7 @@ bytes_s(N, {#{max := Mask, next := Next} = AlgHandler, R}) when is_integer(N), 0 %% giving 56 bits i.e precisely 7 bytes per generated number bytes_r(N, AlgHandler, Next, R, 58, 2). --compile({inline, [bytes_r/6]}). +-compile({inline, bytes_r/6}). bytes_r(N, AlgHandler, Next, R, Bits, WeakLowBits) -> %% We use whole bytes from each generator word, %% GoodBytes: that number of bytes @@ -201,7 +201,7 @@ uniform_real_s({#{next := Next} = Alg, R0}) -> {V1, R1} = Next(R0), uniform_real_s(Alg, V1, R1, Next). --compile({inline, [uniform_real_s/5]}). +-compile({inline, uniform_real_s/5}). uniform_real_s(#{bits := Bits} = Alg, V1, R1, Next) -> case V1 bsr (Bits - 56) of M1 when ?BIT(55) =< M1 -> %% We have 56 bits - waste 3