diff options
Diffstat (limited to 'lib/hipe/main/hipe.erl')
-rw-r--r-- | lib/hipe/main/hipe.erl | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/hipe/main/hipe.erl b/lib/hipe/main/hipe.erl index b2789978a4..434d5c3061 100644 --- a/lib/hipe/main/hipe.erl +++ b/lib/hipe/main/hipe.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2012. All Rights Reserved. +%% Copyright Ericsson AB 2001-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -242,8 +242,7 @@ %% %% @see load/2 --spec load(Mod) -> {'module', Mod} | {'error', term()} - when is_subtype(Mod, mod()). +-spec load(Mod) -> {'module', Mod} | {'error', term()} when Mod :: mod(). load(Mod) -> load(Mod, beam_file(Mod)). @@ -265,7 +264,7 @@ load(Mod) -> %% @see load/1 -spec load(Mod, string()) -> {'module', Mod} | {'error', term()} - when is_subtype(Mod, mod()). + when Mod :: mod(). load(Mod, BeamFileName) when is_list(BeamFileName) -> Architecture = erlang:system_info(hipe_architecture), @@ -522,7 +521,7 @@ compile(Name, Core, File, Opts) when is_atom(Name) -> %% @equiv file(File, []) -spec file(Mod) -> {'ok', Mod, compile_ret()} | {'error', term()} - when is_subtype(Mod, mod()). + when Mod :: mod(). file(File) -> file(File, []). @@ -542,7 +541,7 @@ file(File) -> -spec file(Mod, comp_options()) -> {'ok', Mod, compile_ret()} | {'error', term()} - when is_subtype(Mod, mod()). + when Mod :: mod(). file(File, Options) when is_atom(File) -> case beam_lib:info(File) of L when is_list(L) -> @@ -760,13 +759,15 @@ finalize_fun_concurrent(MfaIcodeList, Exports, Opts) -> case MfaIcodeList of [{{M,_,_},_}|_] -> CallGraph = hipe_icode_callgraph:construct_callgraph(MfaIcodeList), - Closures = [{MFA, true} || {MFA, Icode} <- MfaIcodeList, - hipe_icode:icode_is_closure(Icode)], - Exported = [{{M, F, A}, false} || {F, A} <- Exports], + Exported = [{M, F, A} || {F, A} <- Exports], + Closures = [MFA || {MFA, Icode} <- MfaIcodeList, + hipe_icode:icode_is_closure(Icode)], + %% In principle, a function could both be exported and used as a + %% closure so make sure to add it only once in Escaping below + Escaping = ordsets:from_list(Exported ++ Closures), NonEscaping = [MFA || {{_M, F, A} = MFA, Icode} <- MfaIcodeList, not lists:member({F, A}, Exports), not hipe_icode:icode_is_closure(Icode)], - Escaping = Closures ++ Exported, TypeServerFun = fun() -> hipe_icode_coordinator:coordinate(CallGraph, Escaping, @@ -1135,7 +1136,7 @@ option_text(debug) -> option_text(icode_range) -> "Performs integer range analysis on the Icode level"; option_text(icode_ssa_check) -> - "Checks whether Icode is on SSA form or not\n"; + "Checks whether Icode is on SSA form or not"; option_text(icode_ssa_copy_prop) -> "Performs copy propagation on Icode SSA"; option_text(icode_ssa_const_prop) -> @@ -1143,14 +1144,14 @@ option_text(icode_ssa_const_prop) -> option_text(icode_ssa_struct_reuse) -> "Factors out common tuple and list constructions on Icode SSA"; option_text(icode_type) -> - "Performs type analysis on the Icode level" ++ + "Performs type analysis on the Icode level\n" ++ "and then simplifies the code based on the results of this analysis"; option_text(load) -> "Automatically load the produced native code into memory"; option_text(peephole) -> "Enables peephole optimizations"; option_text(pmatch) -> - "Enables pattern matching compilation when compiling from Core; " ++ + "Enables pattern matching compilation when compiling from Core;\n" ++ "has no effect when compiling from BEAM bytecode"; option_text(pp_asm) -> "Displays assembly listing with addresses and bytecode\n" ++ @@ -1197,11 +1198,11 @@ option_text(timeout) -> " The limit must be a non-negative integer or the atom 'infinity'.\n" ++ " The current default limit is 15 minutes (900000 ms)."; option_text(use_indexing) -> - "Use indexing for multiple-choice branch selection."; + "Use indexing for multiple-choice branch selection"; option_text(use_callgraph) -> - "Compile the functions in a module according to a reversed topological " ++ - "sorted order to gain more information when using a persistent lookup " ++ - "table for storing intra-modular type information."; + "Compile the functions in a module according to a reversed topological\n" ++ + "sorted order to gain more information when using a persistent lookup\n" ++ + "table for storing intra-modular type information"; option_text(verbose) -> "Output information about what is being done"; option_text(Opt) when is_atom(Opt) -> |