annotate gcc/ada/exp_code.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 O D E --
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) 1996-2007, 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 -- 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
kono
parents:
diff changeset
41 function Is_Asm_Volatile (N : Node_Id) return Boolean;
kono
parents:
diff changeset
42 -- Given an N_Code_Statement node N, return True if Volatile=True is
kono
parents:
diff changeset
43 -- specified, and False if Volatile=False is specified (or set by default).
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 function Asm_Template (N : Node_Id) return Node_Id;
kono
parents:
diff changeset
46 -- Given an N_Code_Statement node N, returns string literal node for
kono
parents:
diff changeset
47 -- template in call
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 procedure Clobber_Setup (N : Node_Id);
kono
parents:
diff changeset
50 -- Given an N_Code_Statement node N, setup to process the clobber list
kono
parents:
diff changeset
51 -- with subsequent calls to Clobber_Get_Next.
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 function Clobber_Get_Next return System.Address;
kono
parents:
diff changeset
54 -- Can only be called after a previous call to Clobber_Setup. The
kono
parents:
diff changeset
55 -- returned value is a pointer to a null terminated (C format) string
kono
parents:
diff changeset
56 -- for the next register argument. Null_Address is returned when there
kono
parents:
diff changeset
57 -- are no more arguments.
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 procedure Setup_Asm_Inputs (N : Node_Id);
kono
parents:
diff changeset
60 -- Given an N_Code_Statement node N, setup to read list of Asm_Input
kono
parents:
diff changeset
61 -- arguments. The protocol is to construct a loop as follows:
kono
parents:
diff changeset
62 --
kono
parents:
diff changeset
63 -- Setup_Asm_Inputs (N);
kono
parents:
diff changeset
64 -- while Present (Asm_Input_Value)
kono
parents:
diff changeset
65 -- body
kono
parents:
diff changeset
66 -- Next_Asm_Input;
kono
parents:
diff changeset
67 -- end loop;
kono
parents:
diff changeset
68 --
kono
parents:
diff changeset
69 -- where the loop body calls Asm_Input_Constraint or Asm_Input_Value to
kono
parents:
diff changeset
70 -- obtain the constraint string or input value expression from the current
kono
parents:
diff changeset
71 -- Asm_Input argument.
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 function Asm_Input_Constraint return Node_Id;
kono
parents:
diff changeset
74 -- Called within a loop initialized by Setup_Asm_Inputs and controlled
kono
parents:
diff changeset
75 -- by Next_Asm_Input as described above. Returns a string literal node
kono
parents:
diff changeset
76 -- for the constraint component of the current Asm_Input_Parameter, or
kono
parents:
diff changeset
77 -- Empty if there are no more Asm_Input parameters.
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 function Asm_Input_Value return Node_Id;
kono
parents:
diff changeset
80 -- Called within a loop initialized by Setup_Asm_Inputs and controlled
kono
parents:
diff changeset
81 -- by Next_Asm_Input as described above. Returns the expression node for
kono
parents:
diff changeset
82 -- the value component of the current Asm_Input parameter, or Empty if
kono
parents:
diff changeset
83 -- there are no more Asm_Input parameters, or Error if an error was
kono
parents:
diff changeset
84 -- previously detected in the input parameters (note that the backend
kono
parents:
diff changeset
85 -- need not worry about this case, since it won't be called if there
kono
parents:
diff changeset
86 -- were any such serious errors detected).
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 procedure Next_Asm_Input;
kono
parents:
diff changeset
89 -- Step to next Asm_Input parameter. It is an error to call this procedure
kono
parents:
diff changeset
90 -- if there are no more available parameters (which is impossible if the
kono
parents:
diff changeset
91 -- call appears in a loop as in the above example).
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 procedure Setup_Asm_Outputs (N : Node_Id);
kono
parents:
diff changeset
94 -- Given an N_Code_Statement node N, setup to read list of Asm_Output
kono
parents:
diff changeset
95 -- arguments. The protocol is to construct a loop as follows:
kono
parents:
diff changeset
96 --
kono
parents:
diff changeset
97 -- Setup_Asm_Outputs (N);
kono
parents:
diff changeset
98 -- while Present (Asm_Output_Variable)
kono
parents:
diff changeset
99 -- body
kono
parents:
diff changeset
100 -- Next_Asm_Output;
kono
parents:
diff changeset
101 -- end loop;
kono
parents:
diff changeset
102 --
kono
parents:
diff changeset
103 -- where the loop body calls Asm_Output_Constraint or Asm_Output_Variable
kono
parents:
diff changeset
104 -- to obtain the constraint string or output variable name from the current
kono
parents:
diff changeset
105 -- Asm_Output argument.
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 function Asm_Output_Constraint return Node_Id;
kono
parents:
diff changeset
108 -- Called within a loop initialized by Setup_Asm_Outputs and controlled
kono
parents:
diff changeset
109 -- by Next_Asm_Output as described above. Returns a string literal node
kono
parents:
diff changeset
110 -- for the constraint component of the current Asm_Output_Parameter, or
kono
parents:
diff changeset
111 -- Empty if there are no more Asm_Output parameters.
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 function Asm_Output_Variable return Node_Id;
kono
parents:
diff changeset
114 -- Called within a loop initialized by Setup_Asm_Outputs and controlled by
kono
parents:
diff changeset
115 -- Next_Asm_Output as described above. Returns the expression node for the
kono
parents:
diff changeset
116 -- output variable component of the current Asm_Output parameter, or Empty
kono
parents:
diff changeset
117 -- if there are no more Asm_Output parameters, or Error if an error was
kono
parents:
diff changeset
118 -- previously detected in the input parameters (note that the backend need
kono
parents:
diff changeset
119 -- not worry about this case, since it won't be called if there were any
kono
parents:
diff changeset
120 -- such serious errors detected).
kono
parents:
diff changeset
121
kono
parents:
diff changeset
122 procedure Next_Asm_Output;
kono
parents:
diff changeset
123 -- Step to next Asm_Output parameter. It is an error to call this procedure
kono
parents:
diff changeset
124 -- if there are no more available parameters (which is impossible if the
kono
parents:
diff changeset
125 -- call appears in a loop as in the above example).
kono
parents:
diff changeset
126
kono
parents:
diff changeset
127 end Exp_Code;