~statik/ubuntu/lucid/erlang/merge-erlang13b3

« back to all changes in this revision

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

  • Committer: Elliot Murphy
  • Date: 2009-12-22 02:56:21 UTC
  • mfrom: (3.3.5 sid)
  • Revision ID: elliot@elliotmurphy.com-20091222025621-qv3rja8gbpiabkbe
* Merge with Debian testing; remaining Ubuntu changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to. (LP #438365)
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
* Fixed dialyzer(1) manpage which was placed into section 3 and conflicted
  with dialyzer(3erl).
* New upstream release (it adds a new binary package erlang-erl-docgen).
* Refreshed patches, removed most of emacs.patch which is applied upstream.
* Linked run_test binary from erlang-common-test package to /usr/bin.
* Fixed VCS headers in debian/control.
* Moved from prebuilt manpages to generated from sources. This adds
  erlang-manpages binary package and xsltproc build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
add_func(Name, Args, Body, Fs, St) ->
160
160
    A = length(Args), 
161
161
    F = {function,0,Name,A,[{clause,0,Args,[],Body}]},
162
 
    {[F|Fs],St#expand{exports=add_element({Name,A}, St#expand.exports),
163
 
                      defined=add_element({Name,A}, St#expand.defined)}}.
 
162
    NA = {Name,A},
 
163
    {[F|Fs],St#expand{exports=add_element(NA, St#expand.exports),
 
164
                      defined=add_element(NA, St#expand.defined)}}.
164
165
 
165
 
%% -type define_function(Form, State) -> State.
 
166
%% define_function(Form, State) -> State.
166
167
%%  Add function to defined if form is a function.
167
168
 
168
169
define_functions(Forms, #expand{defined=Predef}=St) ->
206
207
forms([_|Fs], St) -> forms(Fs, St);
207
208
forms([], St) -> {[],St}.
208
209
 
209
 
%% -type attribute(Attribute, Value, State) ->
210
 
%%      State.
 
210
%% attribute(Attribute, Value, State) -> State'.
211
211
%%  Process an attribute, this just affects the state.
212
212
 
213
213
attribute(module, {Module, As}, St) ->
236
236
    {Cs,St} = clauses(Cs0, St0#expand{func=N,arity=A,fcount=0}),
237
237
    {{function,L,N,A,Cs},St}.
238
238
 
239
 
%% -type clauses([Clause], State) ->
 
239
%% clauses([Clause], State) ->
240
240
%%      {[TransformedClause],State}.
241
241
%%  Expand function clauses.
242
242
 
506
506
%% Process the body sequence directly to get the new and used variables.
507
507
%% "Implicit" funs {'fun', Line, {function, F, A}} are not changed.
508
508
 
509
 
fun_tq(Lf, {function,F,A}, St0) ->
 
509
fun_tq(Lf, {function,F,A}=Function, St0) ->
510
510
    {As,St1} = new_vars(A, Lf, St0),
511
511
    Cs = [{clause,Lf,As,[],[{call,Lf,{atom,Lf,F},As}]}],
512
512
    case erl_internal:bif(F, A) of
516
516
            Index = St0#expand.fun_index,
517
517
            Uniq = erlang:hash(Cs, (1 bsl 27)-1),
518
518
            {Fname,St2} = new_fun_name(St1),
519
 
            {{'fun',Lf,{function,F,A},{Index,Uniq,Fname}},
 
519
            {{'fun',Lf,Function,{Index,Uniq,Fname}},
520
520
             St2#expand{fun_index=Index+1}}
521
521
    end;
522
522
fun_tq(L, {function,M,F,A}, St) ->