]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add Is_Rep_To_Pos predicate and export it for use in gigi
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 10 Sep 2024 12:58:21 +0000 (14:58 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 8 Oct 2024 08:37:13 +0000 (10:37 +0200)
This is modeled on the existing Is_Init_Proc predicate.

gcc/ada/ChangeLog:
* exp_tss.ads (Is_Rep_To_Pos): New function declaration.
* exp_tss.adb (Is_Rep_To_Pos): New function body.
* fe.h (Is_Rep_To_Pos): New macro and extern declaration.

gcc/ada/exp_tss.adb
gcc/ada/exp_tss.ads
gcc/ada/fe.h

index 098e001808ea704d5782c2d7cc547b1f2aeb42b0..78eb27e155435df2235b9b600be17492b7fe0481 100644 (file)
@@ -355,6 +355,18 @@ package body Exp_Tss is
       return C1 = TSS_Init_Proc (1) and then C2 = TSS_Init_Proc (2);
    end Is_Init_Proc;
 
+   -------------------
+   -- Is_Rep_To_Pos --
+   -------------------
+
+   function Is_Rep_To_Pos (E : Entity_Id) return Boolean is
+      C1 : Character;
+      C2 : Character;
+   begin
+      Get_Last_Two_Chars (Chars (E), C1, C2);
+      return C1 = TSS_Rep_To_Pos (1) and then C2 = TSS_Rep_To_Pos (2);
+   end Is_Rep_To_Pos;
+
    ------------
    -- Is_TSS --
    ------------
index e7f312047a09b9f72057ddce17c221091a64ba0a..aed6a68fabe1326990e0a56a71de3aa7917d0730 100644 (file)
@@ -154,6 +154,11 @@ package Exp_Tss is
 
    --  WARNING: There is a matching C declaration of this subprogram in fe.h
 
+   function Is_Rep_To_Pos (E : Entity_Id) return Boolean;
+   --  Version for Rep to Pos conversions, same as Is_TSS (E, TSS_Rep_To_Pos);
+
+   --  WARNING: There is a matching C declaration of this subprogram in fe.h
+
    function Is_TSS (E : Entity_Id; Nam : TSS_Name_Type) return Boolean;
    --  Determines if given entity (E) is the name of a TSS identified by Nam
 
index 9d3606ce0a7eca345e9cc03848a70afb9a59c00e..36f5e9bfe9eddaf45a4e9b0144f6024a8b47c8c9 100644 (file)
@@ -179,8 +179,10 @@ extern void Get_Variant_Encoding   (Entity_Id);
 /* exp_tss: */
 
 #define Is_Init_Proc   exp_tss__is_init_proc
+#define Is_Rep_To_Pos  exp_tss__is_rep_to_pos
 
 extern Boolean Is_Init_Proc            (Entity_Id);
+extern Boolean Is_Rep_To_Pos           (Entity_Id);
 
 /* exp_util: */