~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/dialyzer/src/dialyzer_callgraph.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - 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.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%% -*- erlang-indent-level: 2 -*-
2
2
%%-----------------------------------------------------------------------
3
3
%% %CopyrightBegin%
4
 
%% 
5
 
%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
6
 
%% 
 
4
%%
 
5
%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
 
6
%%
7
7
%% The contents of this file are subject to the Erlang Public License,
8
8
%% Version 1.1, (the "License"); you may not use this file except in
9
9
%% compliance with the License. You should have received a copy of the
10
10
%% Erlang Public License along with this software. If not, it can be
11
11
%% retrieved online at http://www.erlang.org/.
12
 
%% 
 
12
%%
13
13
%% Software distributed under the License is distributed on an "AS IS"
14
14
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15
15
%% the License for the specific language governing rights and limitations
16
16
%% under the License.
17
 
%% 
 
17
%%
18
18
%% %CopyrightEnd%
19
19
%%
20
20
 
27
27
%%%-------------------------------------------------------------------
28
28
-module(dialyzer_callgraph).
29
29
 
30
 
-export([all_nodes/1,
 
30
-export([add_edges/2,
 
31
         all_nodes/1,
31
32
         delete/1,
32
33
         finalize/1,
33
34
         is_escaping/2,
54
55
 
55
56
-export([cleanup/1, get_digraph/1, get_named_tables/1, get_public_tables/1,
56
57
         get_race_code/1, get_race_detection/1, race_code_new/1,
57
 
         put_race_code/2, put_race_detection/2, put_named_tables/2,
58
 
         put_public_tables/2]).
 
58
         put_digraph/2, put_race_code/2, put_race_detection/2,
 
59
         put_named_tables/2, put_public_tables/2, put_behaviour_api_calls/2,
 
60
         get_behaviour_api_calls/1]).
 
61
 
 
62
-export_type([callgraph/0]).
59
63
 
60
64
-include("dialyzer.hrl").
61
65
 
97
101
                    race_code      = dict:new()    :: dict(),
98
102
                    public_tables  = []            :: [label()],
99
103
                    named_tables   = []            :: [string()],
100
 
                    race_detection = false         :: boolean()}).
 
104
                    race_detection = false         :: boolean(),
 
105
                    beh_api_calls  = []            :: [{mfa(), mfa()}]}).
101
106
 
102
107
%% Exported Types
103
108
 
608
613
 
609
614
-spec cleanup(callgraph()) -> callgraph().
610
615
 
611
 
cleanup(#callgraph{name_map = NameMap,
612
 
                   rev_name_map = RevNameMap,
613
 
                   public_tables = PublicTables,
614
 
                   named_tables = NamedTables,
615
 
                   race_code = RaceCode}) ->
616
 
  #callgraph{name_map = NameMap,
617
 
             rev_name_map = RevNameMap,
618
 
             public_tables = PublicTables,
619
 
             named_tables = NamedTables,
 
616
cleanup(#callgraph{digraph = Digraph,                                          
 
617
                   name_map = NameMap,                                         
 
618
                   rev_name_map = RevNameMap,                                  
 
619
                   public_tables = PublicTables,                               
 
620
                   named_tables = NamedTables,                                 
 
621
                   race_code = RaceCode}) ->                                   
 
622
  #callgraph{digraph = Digraph,
 
623
             name_map = NameMap,                                          
 
624
             rev_name_map = RevNameMap,                                   
 
625
             public_tables = PublicTables,                                
 
626
             named_tables = NamedTables,                                  
620
627
             race_code = RaceCode}.
621
628
 
622
629
-spec get_digraph(callgraph()) -> digraph().
649
656
race_code_new(Callgraph) ->
650
657
  Callgraph#callgraph{race_code = dict:new()}.
651
658
 
 
659
-spec put_digraph(digraph(), callgraph()) -> callgraph().
 
660
 
 
661
put_digraph(Digraph, Callgraph) ->
 
662
  Callgraph#callgraph{digraph = Digraph}.
 
663
 
652
664
-spec put_race_code(dict(), callgraph()) -> callgraph().
653
665
 
654
666
put_race_code(RaceCode, Callgraph) ->
695
707
  Command = io_lib:format("dot -Tps ~s -o ~s ~s", [Args, File, Dot_File]),
696
708
  _ = os:cmd(Command),
697
709
  ok.
 
710
 
 
711
%-------------------------------------------------------------------------------
 
712
 
 
713
-spec put_behaviour_api_calls([{mfa(), mfa()}], callgraph()) -> callgraph().
 
714
 
 
715
put_behaviour_api_calls(Calls, Callgraph) ->
 
716
  Callgraph#callgraph{beh_api_calls = Calls}.
 
717
 
 
718
-spec get_behaviour_api_calls(callgraph()) -> [{mfa(), mfa()}].
 
719
 
 
720
get_behaviour_api_calls(Callgraph) ->
 
721
  Callgraph#callgraph.beh_api_calls.