anchor.diff:  
   -record(expand, {module=[],                     %Module name
                    exports=[],                    %Exports
  -                 imports=[],                    %Imports
                    attributes=[],                 %Attributes
                    callbacks=[],                  %Callbacks
                    optional_callbacks=[] :: [fa()],  %Optional callbacks
  -                 defined,			%Defined functions (gb_set)
                    vcount=0,                      %Variable counter
                    func=[],                       %Current function
                    arity=[],                      %Arity for current function
  -                 fcount=0			%Local fun count
  +                 fcount=0,			%Local fun count
  +		 ctype				%Call type map
                   }).
   
   %% module(Forms, CompileOptions)
   %%      {ModuleName,Exports,TransformedForms,CompileOptions'}
  -%%  Expand the forms in one module. N.B.: the lists of predefined
  -%%  exports and imports are really ordsets!
  +%%  Expand the forms in one module.
  +%%
   %%  CompileOptions is augmented with options from -compile attributes.
   
   module(Fs0, Opts0) ->
  
positive.code: 
  %% import(Line, Imports, State) ->
  %%      State'
  %% imported(Name, Arity, State) ->
  %%      {yes,Module} | no
  %%  Handle import declarations and test for imported functions. No need to
  %%  check when building imports as code is correct.
  
  import({Mod,Fs}, St) ->
      true = is_atom(Mod),
      Mfs = ordsets:from_list(Fs),
      St#expand{imports=add_imports(Mod, Mfs, St#expand.imports)}.
  
  add_imports(Mod, [F|Fs], Is) ->
      add_imports(Mod, Fs, orddict:store(F, Mod, Is));
  add_imports(_, [], Is) -> Is.
  
  imported(F, A, St) ->
      case orddict:find({F,A}, St#expand.imports) of
          {ok,Mod} -> {yes,Mod};
          error -> no
      end.
  
  defined(F, A, St) ->
      gb_sets:is_element({F,A}, St#expand.defined).
  
negative.code:     %% Set pre-defined exported functions.
      PreExp = [{module_info,0},{module_info,1}],
  
      %% Build the set of defined functions and the initial call
      %% type map.
      Defined = defined_functions(Fs, PreExp),
      Ctype = maps:from_list([{K,local} || K <- Defined]),
  
      %% Build initial expand record.
      St0 = #expand{exports=PreExp,
  		  ctype=Ctype
                   },
  
      %% Expand the functions.
      {Tfs,St1} = forms(Fs, St0),
  
      %% Get the correct list of exported functions.
      Exports = case member(export_all, Opts) of
                    true -> Defined;
                    false -> St1#expand.exports
                end,
      St2 = St1#expand{exports=Exports,ctype=undefined},
  
      %% Generate all functions from stored info.
      {Ats,St3} = module_attrs(St2),
      {Mfs,St4} = module_predef_funcs(St3),
      {St4#expand.module, St4#expand.exports, Ats ++ Tfs ++ Mfs,
       Opts}.
  