PR target/16201
[official-gcc.git] / gcc / ada / sem_prag.ads
blobfe5cd93320a3bde1016f656ed52226b233a1a375
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S E M _ P R A G --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
21 -- --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 -- --
25 ------------------------------------------------------------------------------
27 -- Pragma handling is isolated in a separate package
28 -- (logically this processing belongs in chapter 4)
30 with Types; use Types;
31 package Sem_Prag is
33 procedure Analyze_Pragma (N : Node_Id);
34 -- Analyze procedure for pragma reference node N
36 function Delay_Config_Pragma_Analyze (N : Node_Id) return Boolean;
37 -- N is a pragma appearing in a configuration pragma file. Most
38 -- such pragmas are analyzed when the file is read, before parsing
39 -- and analyzing the main unit. However, the analysis of certain
40 -- pragmas results in adding information to the compiled main unit,
41 -- and this cannot be done till the main unit is processed. Such
42 -- pragmas return True from this function and in Frontend pragmas
43 -- where Delay_Config_Pragma_Analyze is True have their analysis
44 -- delayed until after the main program is parsed and analyzed.
46 function Is_Non_Significant_Pragma_Reference (N : Node_Id) return Boolean;
47 -- The node N is a node for an entity and the issue is whether the
48 -- occurrence is a reference for the purposes of giving warnings
49 -- about unreferenced variables. This function returns True if the
50 -- reference is not a reference from this point of view (e.g. the
51 -- occurrence in a pragma Pack) and False if it is a real reference
52 -- (e.g. the occcurrence in a pragma Export);
54 function Is_Pragma_String_Literal (Par : Node_Id) return Boolean;
55 -- Given an N_Pragma_Argument_Association node, Par, which has the form
56 -- of an operator symbol, determines whether or not it should be treated
57 -- as an string literal. This is called by Sem_Ch6.Analyze_Operator_Symbol.
58 -- If True is returned, the argument is converted to a string literal. If
59 -- False is returned, then the argument is treated as an entity reference
60 -- to the operator.
62 function Is_Config_Static_String (Arg : Node_Id) return Boolean;
63 -- This is called for a configuration pragma that requires either a
64 -- string literal or a concatenation of string literals. We cannot
65 -- use normal static string processing because it is too early in
66 -- the case of the pragma appearing in a configuration pragmas file.
67 -- If Arg is of an appropriate form, then this call obtains the string
68 -- (doing any necessary concatenations) and places it in Name_Buffer,
69 -- setting Name_Len to its length, and then returns True. If it is
70 -- not of the correct form, then an appropriate error message is
71 -- posted, and False is returned.
73 procedure Process_Compilation_Unit_Pragmas (N : Node_Id);
74 -- Called at the start of processing compilation unit N to deal with
75 -- any special issues regarding pragmas. In particular, we have to
76 -- deal with Suppress_All at this stage, since it appears after the
77 -- unit instead of before.
79 procedure Set_Encoded_Interface_Name (E : Entity_Id; S : Node_Id);
80 -- This routine is used to set an encoded interface name. The node
81 -- S is an N_String_Literal node for the external name to be set, and
82 -- E is an entity whose Interface_Name field is to be set. In the
83 -- normal case where S contains a name that is a valid C identifier,
84 -- then S is simply set as the value of the Interface_Name. Otherwise
85 -- it is encoded. See the body for details of the encoding. This
86 -- encoding is only done on VMS systems, since it seems pretty silly,
87 -- but is needed to pass some dubious tests in the test suite.
89 end Sem_Prag;