~ubuntu-branches/ubuntu/lucid/erlang/lucid-proposed

« back to all changes in this revision

Viewing changes to lib/compiler/src/compile.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-06-11 12:18:07 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090611121807-ks7eb4xrt7dsysgx
Tags: 1:13.b.1-dfsg-1
* New upstream release.
* Removed unnecessary dependency of erlang-os-mon on erlang-observer and
  erlang-tools and added missing dependency of erlang-nox on erlang-os-mon
  (closes: #529512).
* Removed a patch to eunit application because the bug was fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
-export([compile/3,compile_beam/3,compile_asm/3,compile_core/3]).
33
33
 
34
34
 
35
 
-import(lists, [member/2,reverse/1,reverse/2,keysearch/3,last/1,
 
35
-import(lists, [member/2,reverse/1,reverse/2,keyfind/3,last/1,
36
36
                map/2,flatmap/2,foreach/2,foldr/3,any/2,filter/2]).
37
37
 
38
38
%%
929
929
    Abstr = erlang:term_to_binary({raw_abstract_v1,Code}, [compressed]),
930
930
    case member(encrypt_debug_info, Opts) of
931
931
        true ->
932
 
            case keysearch(debug_info_key, 1, Opts) of
933
 
                {value,{_,Key}} ->
 
932
            case keyfind(debug_info_key, 1, Opts) of
 
933
                {_,Key} ->
934
934
                    encrypt_abs_code(Abstr, Key);
935
935
                false ->
936
936
                    %% Note: #compile.module have not been set yet.
1026
1026
native_compile_1(St) ->
1027
1027
    Opts0 = St#compile.options,
1028
1028
    IgnoreErrors = member(ignore_native_errors, Opts0),
1029
 
    Opts = case keysearch(hipe, 1, Opts0) of
1030
 
               {value,{hipe,L}} when is_list(L) -> L;
1031
 
               {value,{hipe,X}} -> [X];
 
1029
    Opts = case keyfind(hipe, 1, Opts0) of
 
1030
               {hipe,L} when is_list(L) -> L;
 
1031
               {hipe,X} -> [X];
1032
1032
               _ -> []
1033
1033
           end,
1034
1034
    case catch hipe:compile(St#compile.module,
1191
1191
outfile(Base, Ext, Opts) when is_atom(Ext) ->
1192
1192
    outfile(Base, atom_to_list(Ext), Opts);
1193
1193
outfile(Base, Ext, Opts) ->
1194
 
    Obase = case keysearch(outdir, 1, Opts) of
1195
 
                {value, {outdir, Odir}} -> filename:join(Odir, Base);
 
1194
    Obase = case keyfind(outdir, 1, Opts) of
 
1195
                {outdir, Odir} -> filename:join(Odir, Base);
1196
1196
                _Other -> Base                  % Not found or bad format
1197
1197
            end,
1198
1198
    Obase++"."++Ext.