public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] ada: Add typedefs to snames.h-tmpl
@ 2023-07-10 12:44 Marc Poulhiès
  0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-07-10 12:44 UTC (permalink / raw)
  To: gcc-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@adacore.com>

A future patch will change sname.h-tmpl to use enums rather than
preprocessor defines.  In order to do this, first introduce some
typedefs that can be used in gcc-interface.

gcc/ada/

	* snames.h-tmpl (Name_Id, Attribute_Id, Convention_Id)
	(Pragma_Id): New typedefs.
	(Get_Attribute_Id, Get_Pragma_Id): Use typedef.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/snames.h-tmpl | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/snames.h-tmpl b/gcc/ada/snames.h-tmpl
index b15792a5724..95b3c776197 100644
--- a/gcc/ada/snames.h-tmpl
+++ b/gcc/ada/snames.h-tmpl
@@ -28,6 +28,7 @@
 
 /* Name_Id values */
 
+typedef Int Name_Id;
 #define  Name_ !! TEMPLATE INSERTION POINT
 
 /* Define the function to return one of the numeric values below. Note
@@ -35,8 +36,9 @@
    than 256 entries is represented that way in Ada.  The operand is a Chars
    field value.  */
 
+typedef Byte Attribute_Id;
 #define Get_Attribute_Id snames__get_attribute_id
-extern unsigned char Get_Attribute_Id (int);
+extern Attribute_Id Get_Attribute_Id (int);
 
 /* Define the numeric values for attributes.  */
 
@@ -44,6 +46,7 @@ extern unsigned char Get_Attribute_Id (int);
 
 /* Define the numeric values for the conventions.  */
 
+typedef Byte Convention_Id;
 #define  Convention_ !! TEMPLATE INSERTION POINT
 
 /* Define the function to check if a Name_Id value is a valid pragma */
@@ -56,8 +59,9 @@ extern Boolean Is_Pragma_Name (Name_Id);
    than 256 entries is represented that way in Ada.  The operand is a Chars
    field value.  */
 
+typedef Byte Pragma_Id;
 #define Get_Pragma_Id snames__get_pragma_id
-extern unsigned char Get_Pragma_Id (int);
+extern Pragma_Id Get_Pragma_Id (int);
 
 /* Define the numeric values for the pragmas. */
 
-- 
2.40.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-10 12:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-10 12:44 [COMMITTED] ada: Add typedefs to snames.h-tmpl Marc Poulhiès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).