diff options
-rw-r--r-- | lib/compiler/src/beam_disasm.erl | 12 | ||||
-rw-r--r-- | lib/compiler/test/beam_disasm_SUITE.erl | 4 | ||||
-rw-r--r-- | lib/hipe/main/hipe.app.src | 1 | ||||
-rw-r--r-- | lib/hipe/main/hipe.erl | 6 | ||||
-rw-r--r-- | system/doc/design_principles/spec_proc.xml | 2 | ||||
-rw-r--r-- | system/doc/reference_manual/modules.xml | 8 |
6 files changed, 19 insertions, 14 deletions
diff --git a/lib/compiler/src/beam_disasm.erl b/lib/compiler/src/beam_disasm.erl index 7103d2390f..62bdc74cc8 100644 --- a/lib/compiler/src/beam_disasm.erl +++ b/lib/compiler/src/beam_disasm.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2011. All Rights Reserved. +%% Copyright Ericsson AB 2000-2012. 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 @@ -182,10 +182,14 @@ process_chunks(F) -> Literals = beam_disasm_literals(LiteralBin), Code = beam_disasm_code(CodeBin, Atoms, mk_imports(ImportsList), StrBin, Lambdas, Literals, Module), - Attributes = optional_chunk(F, attributes), + Attributes = + case optional_chunk(F, attributes) of + none -> []; + Atts when is_list(Atts) -> Atts + end, CompInfo = case optional_chunk(F, "CInf") of - none -> none; + none -> []; CompInfoBin when is_binary(CompInfoBin) -> binary_to_term(CompInfoBin) end, @@ -198,7 +202,7 @@ process_chunks(F) -> end. %%----------------------------------------------------------------------- -%% Retrieve an optional chunk or none if the chunk doesn't exist. +%% Retrieve an optional chunk or return 'none' if the chunk doesn't exist. %%----------------------------------------------------------------------- optional_chunk(F, ChunkTag) -> diff --git a/lib/compiler/test/beam_disasm_SUITE.erl b/lib/compiler/test/beam_disasm_SUITE.erl index 44574ae64a..62afc80ca6 100644 --- a/lib/compiler/test/beam_disasm_SUITE.erl +++ b/lib/compiler/test/beam_disasm_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2011. All Rights Reserved. +%% Copyright Ericsson AB 2011-2012. 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 @@ -60,6 +60,6 @@ stripped(Config) when is_list(Config) -> ?line true = is_list(Attr), ?line true = is_list(CompileInfo), ?line {ok, {tmp, _}} = beam_lib:strip(BeamName), - ?line {beam_file, tmp, _, none, none, [_|_]} = + ?line {beam_file, tmp, _, [], [], [_|_]} = beam_disasm:file(BeamName), ok. diff --git a/lib/hipe/main/hipe.app.src b/lib/hipe/main/hipe.app.src index e5d6d1e540..c05aec4c4a 100644 --- a/lib/hipe/main/hipe.app.src +++ b/lib/hipe/main/hipe.app.src @@ -74,7 +74,6 @@ hipe_arm_specific, hipe_bb, hipe_beam_to_icode, - hipe_ceach, hipe_coalescing_regalloc, hipe_consttab, hipe_data_pp, diff --git a/lib/hipe/main/hipe.erl b/lib/hipe/main/hipe.erl index 309d847374..1be679a13f 100644 --- a/lib/hipe/main/hipe.erl +++ b/lib/hipe/main/hipe.erl @@ -574,12 +574,8 @@ file(File, Options) when is_atom(File) -> disasm(File) -> case beam_disasm:file(File) of #beam_file{labeled_exports = LabeledExports, - compile_info = CompInfo0, + compile_info = CompInfo, code = BeamCode} -> - CompInfo = case CompInfo0 of - none -> []; - _ -> CompInfo0 - end, CompOpts = proplists:get_value(options, CompInfo, []), HCompOpts = case lists:keyfind(hipe, 1, CompOpts) of {hipe, L} when is_list(L) -> L; diff --git a/system/doc/design_principles/spec_proc.xml b/system/doc/design_principles/spec_proc.xml index 1bc2d32461..c5472c96a6 100644 --- a/system/doc/design_principles/spec_proc.xml +++ b/system/doc/design_principles/spec_proc.xml @@ -108,7 +108,7 @@ ok <list type="bulleted"> <item>be started in a way that makes the process fit into a supervision tree,</item> - <item>support the <c>sys</c><seealso marker="#debug">debug facilities</seealso>, and</item> + <item>support the <c>sys</c> <seealso marker="#debug">debug facilities</seealso>, and</item> <item>take care of <seealso marker="#msg">system messages</seealso>.</item> </list> <p>System messages are messages with special meaning, used in diff --git a/system/doc/reference_manual/modules.xml b/system/doc/reference_manual/modules.xml index 0dbc0ab56b..377b2853ca 100644 --- a/system/doc/reference_manual/modules.xml +++ b/system/doc/reference_manual/modules.xml @@ -114,6 +114,12 @@ fact(0) -> % | <p>If this attribute is not specified, the version defaults to the MD5 checksum of the module.</p> </item> + <tag><c>-on_load(Function).</c></tag> + <item> + <p>Names a function that should be run automatically when a + module a loaded. See <seealso marker="code_loading#on_load"> + code loading</seealso> for more information.</p> + </item> </taglist> </section> @@ -180,7 +186,7 @@ fact(0) -> % | <p>Read more in <seealso marker="typespec">Types and Function specifications</seealso>. </p> <p> - The desciption is based on + The description is based on <url href="http://www.erlang.org/eeps/eep-0008.html">EEP8 - Types and function specifications</url> which will not be further updated. |