annotate gcc/ada/exp_ch4.ads @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
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 -- E X P _ C H 4 --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
kono
parents:
diff changeset
9 -- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
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 -- Expand routines for chapter 4 constructs
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 with Types; use Types;
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 package Exp_Ch4 is
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 procedure Expand_N_Allocator (N : Node_Id);
kono
parents:
diff changeset
33 procedure Expand_N_And_Then (N : Node_Id);
kono
parents:
diff changeset
34 procedure Expand_N_Case_Expression (N : Node_Id);
kono
parents:
diff changeset
35 procedure Expand_N_Explicit_Dereference (N : Node_Id);
kono
parents:
diff changeset
36 procedure Expand_N_Expression_With_Actions (N : Node_Id);
kono
parents:
diff changeset
37 procedure Expand_N_If_Expression (N : Node_Id);
kono
parents:
diff changeset
38 procedure Expand_N_In (N : Node_Id);
kono
parents:
diff changeset
39 procedure Expand_N_Indexed_Component (N : Node_Id);
kono
parents:
diff changeset
40 procedure Expand_N_Not_In (N : Node_Id);
kono
parents:
diff changeset
41 procedure Expand_N_Null (N : Node_Id);
kono
parents:
diff changeset
42 procedure Expand_N_Op_Abs (N : Node_Id);
kono
parents:
diff changeset
43 procedure Expand_N_Op_Add (N : Node_Id);
kono
parents:
diff changeset
44 procedure Expand_N_Op_And (N : Node_Id);
kono
parents:
diff changeset
45 procedure Expand_N_Op_Concat (N : Node_Id);
kono
parents:
diff changeset
46 procedure Expand_N_Op_Divide (N : Node_Id);
kono
parents:
diff changeset
47 procedure Expand_N_Op_Expon (N : Node_Id);
kono
parents:
diff changeset
48 procedure Expand_N_Op_Eq (N : Node_Id);
kono
parents:
diff changeset
49 procedure Expand_N_Op_Ge (N : Node_Id);
kono
parents:
diff changeset
50 procedure Expand_N_Op_Gt (N : Node_Id);
kono
parents:
diff changeset
51 procedure Expand_N_Op_Le (N : Node_Id);
kono
parents:
diff changeset
52 procedure Expand_N_Op_Lt (N : Node_Id);
kono
parents:
diff changeset
53 procedure Expand_N_Op_Minus (N : Node_Id);
kono
parents:
diff changeset
54 procedure Expand_N_Op_Mod (N : Node_Id);
kono
parents:
diff changeset
55 procedure Expand_N_Op_Multiply (N : Node_Id);
kono
parents:
diff changeset
56 procedure Expand_N_Op_Ne (N : Node_Id);
kono
parents:
diff changeset
57 procedure Expand_N_Op_Not (N : Node_Id);
kono
parents:
diff changeset
58 procedure Expand_N_Op_Or (N : Node_Id);
kono
parents:
diff changeset
59 procedure Expand_N_Op_Plus (N : Node_Id);
kono
parents:
diff changeset
60 procedure Expand_N_Op_Rem (N : Node_Id);
kono
parents:
diff changeset
61 procedure Expand_N_Op_Rotate_Left (N : Node_Id);
kono
parents:
diff changeset
62 procedure Expand_N_Op_Rotate_Right (N : Node_Id);
kono
parents:
diff changeset
63 procedure Expand_N_Op_Shift_Left (N : Node_Id);
kono
parents:
diff changeset
64 procedure Expand_N_Op_Shift_Right (N : Node_Id);
kono
parents:
diff changeset
65 procedure Expand_N_Op_Shift_Right_Arithmetic (N : Node_Id);
kono
parents:
diff changeset
66 procedure Expand_N_Op_Subtract (N : Node_Id);
kono
parents:
diff changeset
67 procedure Expand_N_Op_Xor (N : Node_Id);
kono
parents:
diff changeset
68 procedure Expand_N_Or_Else (N : Node_Id);
kono
parents:
diff changeset
69 procedure Expand_N_Qualified_Expression (N : Node_Id);
kono
parents:
diff changeset
70 procedure Expand_N_Quantified_Expression (N : Node_Id);
kono
parents:
diff changeset
71 procedure Expand_N_Selected_Component (N : Node_Id);
kono
parents:
diff changeset
72 procedure Expand_N_Slice (N : Node_Id);
kono
parents:
diff changeset
73 procedure Expand_N_Type_Conversion (N : Node_Id);
kono
parents:
diff changeset
74 procedure Expand_N_Unchecked_Expression (N : Node_Id);
kono
parents:
diff changeset
75 procedure Expand_N_Unchecked_Type_Conversion (N : Node_Id);
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 function Expand_Record_Equality
kono
parents:
diff changeset
78 (Nod : Node_Id;
kono
parents:
diff changeset
79 Typ : Entity_Id;
kono
parents:
diff changeset
80 Lhs : Node_Id;
kono
parents:
diff changeset
81 Rhs : Node_Id;
kono
parents:
diff changeset
82 Bodies : List_Id)
kono
parents:
diff changeset
83 return Node_Id;
kono
parents:
diff changeset
84 -- Expand a record equality into an expression that compares the fields
kono
parents:
diff changeset
85 -- individually to yield the required Boolean result. Loc is the
kono
parents:
diff changeset
86 -- location for the generated nodes. Typ is the type of the record, and
kono
parents:
diff changeset
87 -- Lhs, Rhs are the record expressions to be compared, these
kono
parents:
diff changeset
88 -- expressions need not to be analyzed but have to be side-effect free.
kono
parents:
diff changeset
89 -- Bodies is a list on which to attach bodies of local functions that
kono
parents:
diff changeset
90 -- are created in the process. This is the responsibility of the caller
kono
parents:
diff changeset
91 -- to insert those bodies at the right place. Nod provides the Sloc
kono
parents:
diff changeset
92 -- value for generated code.
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 procedure Expand_Set_Membership (N : Node_Id);
kono
parents:
diff changeset
95 -- For each choice of a set membership, we create a simple equality or
kono
parents:
diff changeset
96 -- membership test. The whole membership is rewritten connecting these
kono
parents:
diff changeset
97 -- with OR ELSE.
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 function Integer_Promotion_Possible (N : Node_Id) return Boolean;
kono
parents:
diff changeset
100 -- Returns true if the node is a type conversion whose operand is an
kono
parents:
diff changeset
101 -- arithmetic operation on signed integers, and the base type of the
kono
parents:
diff changeset
102 -- signed integer type is smaller than Standard.Integer. In such case we
kono
parents:
diff changeset
103 -- have special circuitry in Expand_N_Type_Conversion to promote both of
kono
parents:
diff changeset
104 -- the operands to type Integer.
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 end Exp_Ch4;