annotate gcc/ada/exp_code.ads @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
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 O D E --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 -- Copyright (C) 1996-2019, 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 -- Processing for handling code statements
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 with Types; use Types;
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 with System; use System;
kono
parents:
diff changeset
31 package Exp_Code is
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 procedure Expand_Asm_Call (N : Node_Id);
kono
parents:
diff changeset
34 -- Expands a call to Asm into an equivalent N_Code_Statement node
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 -- The following routines provide an abstract interface to analyze
kono
parents:
diff changeset
37 -- code statements, for use by Gigi processing for code statements.
kono
parents:
diff changeset
38 -- Note that the implementations of these routines must not attempt
kono
parents:
diff changeset
39 -- to expand tables that are frozen on entry to Gigi.
kono
parents:
diff changeset
40
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
41 -- WARNING: There is a matching C declaration of these subprograms in fe.h
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
42
111
kono
parents:
diff changeset
43 function Is_Asm_Volatile (N : Node_Id) return Boolean;
kono
parents:
diff changeset
44 -- Given an N_Code_Statement node N, return True if Volatile=True is
kono
parents:
diff changeset
45 -- specified, and False if Volatile=False is specified (or set by default).
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 function Asm_Template (N : Node_Id) return Node_Id;
kono
parents:
diff changeset
48 -- Given an N_Code_Statement node N, returns string literal node for
kono
parents:
diff changeset
49 -- template in call
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 procedure Clobber_Setup (N : Node_Id);
kono
parents:
diff changeset
52 -- Given an N_Code_Statement node N, setup to process the clobber list
kono
parents:
diff changeset
53 -- with subsequent calls to Clobber_Get_Next.
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 function Clobber_Get_Next return System.Address;
kono
parents:
diff changeset
56 -- Can only be called after a previous call to Clobber_Setup. The
kono
parents:
diff changeset
57 -- returned value is a pointer to a null terminated (C format) string
kono
parents:
diff changeset
58 -- for the next register argument. Null_Address is returned when there
kono
parents:
diff changeset
59 -- are no more arguments.
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 procedure Setup_Asm_Inputs (N : Node_Id);
kono
parents:
diff changeset
62 -- Given an N_Code_Statement node N, setup to read list of Asm_Input
kono
parents:
diff changeset
63 -- arguments. The protocol is to construct a loop as follows:
kono
parents:
diff changeset
64 --
kono
parents:
diff changeset
65 -- Setup_Asm_Inputs (N);
kono
parents:
diff changeset
66 -- while Present (Asm_Input_Value)
kono
parents:
diff changeset
67 -- body
kono
parents:
diff changeset
68 -- Next_Asm_Input;
kono
parents:
diff changeset
69 -- end loop;
kono
parents:
diff changeset
70 --
kono
parents:
diff changeset
71 -- where the loop body calls Asm_Input_Constraint or Asm_Input_Value to
kono
parents:
diff changeset
72 -- obtain the constraint string or input value expression from the current
kono
parents:
diff changeset
73 -- Asm_Input argument.
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 function Asm_Input_Constraint return Node_Id;
kono
parents:
diff changeset
76 -- Called within a loop initialized by Setup_Asm_Inputs and controlled
kono
parents:
diff changeset
77 -- by Next_Asm_Input as described above. Returns a string literal node
kono
parents:
diff changeset
78 -- for the constraint component of the current Asm_Input_Parameter, or
kono
parents:
diff changeset
79 -- Empty if there are no more Asm_Input parameters.
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 function Asm_Input_Value return Node_Id;
kono
parents:
diff changeset
82 -- Called within a loop initialized by Setup_Asm_Inputs and controlled
kono
parents:
diff changeset
83 -- by Next_Asm_Input as described above. Returns the expression node for
kono
parents:
diff changeset
84 -- the value component of the current Asm_Input parameter, or Empty if
kono
parents:
diff changeset
85 -- there are no more Asm_Input parameters, or Error if an error was
kono
parents:
diff changeset
86 -- previously detected in the input parameters (note that the backend
kono
parents:
diff changeset
87 -- need not worry about this case, since it won't be called if there
kono
parents:
diff changeset
88 -- were any such serious errors detected).
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 procedure Next_Asm_Input;
kono
parents:
diff changeset
91 -- Step to next Asm_Input parameter. It is an error to call this procedure
kono
parents:
diff changeset
92 -- if there are no more available parameters (which is impossible if the
kono
parents:
diff changeset
93 -- call appears in a loop as in the above example).
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 procedure Setup_Asm_Outputs (N : Node_Id);
kono
parents:
diff changeset
96 -- Given an N_Code_Statement node N, setup to read list of Asm_Output
kono
parents:
diff changeset
97 -- arguments. The protocol is to construct a loop as follows:
kono
parents:
diff changeset
98 --
kono
parents:
diff changeset
99 -- Setup_Asm_Outputs (N);
kono
parents:
diff changeset
100 -- while Present (Asm_Output_Variable)
kono
parents:
diff changeset
101 -- body
kono
parents:
diff changeset
102 -- Next_Asm_Output;
kono
parents:
diff changeset
103 -- end loop;
kono
parents:
diff changeset
104 --
kono
parents:
diff changeset
105 -- where the loop body calls Asm_Output_Constraint or Asm_Output_Variable
kono
parents:
diff changeset
106 -- to obtain the constraint string or output variable name from the current
kono
parents:
diff changeset
107 -- Asm_Output argument.
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 function Asm_Output_Constraint return Node_Id;
kono
parents:
diff changeset
110 -- Called within a loop initialized by Setup_Asm_Outputs and controlled
kono
parents:
diff changeset
111 -- by Next_Asm_Output as described above. Returns a string literal node
kono
parents:
diff changeset
112 -- for the constraint component of the current Asm_Output_Parameter, or
kono
parents:
diff changeset
113 -- Empty if there are no more Asm_Output parameters.
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 function Asm_Output_Variable return Node_Id;
kono
parents:
diff changeset
116 -- Called within a loop initialized by Setup_Asm_Outputs and controlled by
kono
parents:
diff changeset
117 -- Next_Asm_Output as described above. Returns the expression node for the
kono
parents:
diff changeset
118 -- output variable component of the current Asm_Output parameter, or Empty
kono
parents:
diff changeset
119 -- if there are no more Asm_Output parameters, or Error if an error was
kono
parents:
diff changeset
120 -- previously detected in the input parameters (note that the backend need
kono
parents:
diff changeset
121 -- not worry about this case, since it won't be called if there were any
kono
parents:
diff changeset
122 -- such serious errors detected).
kono
parents:
diff changeset
123
kono
parents:
diff changeset
124 procedure Next_Asm_Output;
kono
parents:
diff changeset
125 -- Step to next Asm_Output parameter. It is an error to call this procedure
kono
parents:
diff changeset
126 -- if there are no more available parameters (which is impossible if the
kono
parents:
diff changeset
127 -- call appears in a loop as in the above example).
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129 end Exp_Code;