annotate gcc/ada/par_sco.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- P A R _ S C O --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 2009-2018, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 -- This package contains the routines used to deal with generation and output
kono
parents:
diff changeset
27 -- of Source Coverage Obligations (SCO's) used for coverage analysis purposes.
kono
parents:
diff changeset
28 -- See package SCOs for full documentation of format of SCO information.
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 with Types; use Types;
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 package Par_SCO is
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 -----------------
kono
parents:
diff changeset
35 -- Subprograms --
kono
parents:
diff changeset
36 -----------------
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 procedure Initialize;
kono
parents:
diff changeset
39 -- Initialize internal tables for a new compilation
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 procedure SCO_Record_Raw (U : Unit_Number_Type);
kono
parents:
diff changeset
42 -- This procedure scans the tree for the unit identified by U, populating
kono
parents:
diff changeset
43 -- internal tables recording the SCO information. Note that this is done
kono
parents:
diff changeset
44 -- before any semantic analysis/expansion happens.
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 procedure Set_SCO_Condition (Cond : Node_Id; Val : Boolean);
kono
parents:
diff changeset
47 -- This procedure is called during semantic analysis to record a condition
kono
parents:
diff changeset
48 -- which has been identified as always True or always False, as indicated
kono
parents:
diff changeset
49 -- by Val. The condition is identified by the First_Sloc value in the
kono
parents:
diff changeset
50 -- original tree associated with Cond.
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 procedure Set_SCO_Logical_Operator (Op : Node_Id);
kono
parents:
diff changeset
53 -- Mark some putative logical operator as a short circuit one
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 procedure Set_SCO_Pragma_Enabled (Loc : Source_Ptr);
kono
parents:
diff changeset
56 -- This procedure is called from Sem_Prag when a pragma is enabled (i.e.
kono
parents:
diff changeset
57 -- when the Pragma_Enabled flag is set). Loc is the Sloc of the N_Pragma
kono
parents:
diff changeset
58 -- node. This is used to enable the corresponding statement SCO entry. Note
kono
parents:
diff changeset
59 -- that we use the Sloc as the key here, since in the generic case, the
kono
parents:
diff changeset
60 -- analysis is on a copy of the node, which is different from the node
kono
parents:
diff changeset
61 -- seen by Par_SCO in the parse tree (but the Sloc values are the same).
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 function SCO_Pragma_Disabled (Loc : Source_Ptr) return Boolean;
kono
parents:
diff changeset
64 -- True if Loc is the source location of a disabled pragma
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 procedure SCO_Record_Filtered;
kono
parents:
diff changeset
67 -- This procedure filters remaining putative AND/OR short-circuit operators
kono
parents:
diff changeset
68 -- from the internal SCO raw table after the semantic analysis and fills
kono
parents:
diff changeset
69 -- the filtered SCO table.
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 procedure SCO_Output;
kono
parents:
diff changeset
72 -- Outputs SCO lines for all units, with appropriate section headers, as
kono
parents:
diff changeset
73 -- recorded by previous calls to SCO_Record, possibly modified by calls to
kono
parents:
diff changeset
74 -- Set_SCO_Condition.
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 procedure dsco;
kono
parents:
diff changeset
77 -- Debug routine to dump internal SCO tables. This is a raw format dump
kono
parents:
diff changeset
78 -- showing exactly what the tables contain.
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 procedure pscos;
kono
parents:
diff changeset
81 -- Debugging procedure to output contents of SCO binary tables in the
kono
parents:
diff changeset
82 -- format in which they appear in an ALI file.
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 end Par_SCO;