1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
10 -- Copyright (C) 1996 Free Software Foundation, Inc. --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 ------------------------------------------------------------------------------
28 -- Processing for handling code statements
30 with Types
; use Types
;
32 with System
; use System
;
35 procedure Expand_Asm_Call
(N
: Node_Id
);
36 -- Expands a call to Asm or Asm_Volatile into an equivalent
37 -- N_Code_Statement node.
39 -- The following routines provide an abstract interface to analyze
40 -- code statements, for use by Gigi processing for code statements.
41 -- Note that the implementations of these routines must not attempt
42 -- to expand tables that are frozen on entry to Gigi.
44 function Is_Asm_Volatile
(N
: Node_Id
) return Boolean;
45 -- Given an N_Code_Statement node N, return True in the Asm_Volatile
46 -- case and False in the Asm case.
48 function Asm_Template
(N
: Node_Id
) return Node_Id
;
49 -- Given an N_Code_Statement node N, returns string literal node for
52 procedure Clobber_Setup
(N
: Node_Id
);
53 -- Given an N_Code_Statement node N, setup to process the clobber list
54 -- with subsequent calls to Clobber_Get_Next.
56 function Clobber_Get_Next
return System
.Address
;
57 -- Can only be called after a previous call to Clobber_Setup. The
58 -- returned value is a pointer to a null terminated (C format) string
59 -- for the next register argument. Null_Address is returned when there
60 -- are no more arguments.
62 procedure Setup_Asm_Inputs
(N
: Node_Id
);
63 -- Given an N_Code_Statement node N, setup to read list of Asm_Input
64 -- arguments. The protocol is to construct a loop as follows:
66 -- Setup_Asm_Inputs (N);
67 -- while Present (Asm_Input_Value)
72 -- where the loop body calls Asm_Input_Constraint or Asm_Input_Value to
73 -- obtain the constraint string or input value expression from the current
74 -- Asm_Input argument.
76 function Asm_Input_Constraint
return Node_Id
;
77 -- Called within a loop initialized by Setup_Asm_Inputs and controlled
78 -- by Next_Asm_Input as described above. Returns a string literal node
79 -- for the constraint component of the current Asm_Input_Parameter, or
80 -- Empty if there are no more Asm_Input parameters.
82 function Asm_Input_Value
return Node_Id
;
83 -- Called within a loop initialized by Setup_Asm_Inputs and controlled
84 -- by Next_Asm_Input as described above. Returns the expression node for
85 -- the value component of the current Asm_Input parameter, or Empty if
86 -- there are no more Asm_Input parameters.
88 procedure Next_Asm_Input
;
89 -- Step to next Asm_Input parameter. It is an error to call this procedure
90 -- if there are no more available parameters (which is impossible if the
91 -- call appears in a loop as in the above example).
93 procedure Setup_Asm_Outputs
(N
: Node_Id
);
94 -- Given an N_Code_Statement node N, setup to read list of Asm_Output
95 -- arguments. The protocol is to construct a loop as follows:
97 -- Setup_Asm_Outputs (N);
98 -- while Present (Asm_Output_Value)
103 -- where the loop body calls Asm_Output_Constraint or Asm_Output_Variable
104 -- to obtain the constraint string or output variable name from the current
105 -- Asm_Output argument.
107 function Asm_Output_Constraint
return Node_Id
;
108 -- Called within a loop initialized by Setup_Asm_Outputs and controlled
109 -- by Next_Asm_Output as described above. Returns a string literal node
110 -- for the constraint component of the current Asm_Output_Parameter, or
111 -- Empty if there are no more Asm_Output parameters.
113 function Asm_Output_Variable
return Node_Id
;
114 -- Called within a loop initialized by Setup_Asm_Outputs and controlled
115 -- by Next_Asm_Output as described above. Returns the expression node for
116 -- the output variable component of the current Asm_Output parameter, or
117 -- Empty if there are no more Asm_Output parameters.
119 procedure Next_Asm_Output
;
120 -- Step to next Asm_Output parameter. It is an error to call this procedure
121 -- if there are no more available parameters (which is impossible if the
122 -- call appears in a loop as in the above example).