]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add typedefs to snames.h-tmpl
authorTom Tromey <tromey@adacore.com>
Thu, 29 Jun 2023 14:52:59 +0000 (08:52 -0600)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 10 Jul 2023 12:41:40 +0000 (14:41 +0200)
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.

gcc/ada/snames.h-tmpl

index b15792a57246c2eb32c3cd7c2e54f723b304e768..95b3c776197759a42f96c6d67328a45fdfaea34b 100644 (file)
@@ -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. */