https://gcc.gnu.org/g:9ca4d98d0349882510b1ae705087a00ee9dcb0f5

commit r15-4153-g9ca4d98d0349882510b1ae705087a00ee9dcb0f5
Author: Eric Botcazou <ebotca...@adacore.com>
Date:   Tue Sep 10 14:58:21 2024 +0200

    ada: Add Is_Rep_To_Pos predicate and export it for use in gigi
    
    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.

Diff:
---
 gcc/ada/exp_tss.adb | 12 ++++++++++++
 gcc/ada/exp_tss.ads |  5 +++++
 gcc/ada/fe.h        |  2 ++
 3 files changed, 19 insertions(+)

diff --git a/gcc/ada/exp_tss.adb b/gcc/ada/exp_tss.adb
index 098e001808ea..78eb27e15543 100644
--- a/gcc/ada/exp_tss.adb
+++ b/gcc/ada/exp_tss.adb
@@ -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 --
    ------------
diff --git a/gcc/ada/exp_tss.ads b/gcc/ada/exp_tss.ads
index e7f312047a09..aed6a68fabe1 100644
--- a/gcc/ada/exp_tss.ads
+++ b/gcc/ada/exp_tss.ads
@@ -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
 
diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h
index 9d3606ce0a7e..36f5e9bfe9ed 100644
--- a/gcc/ada/fe.h
+++ b/gcc/ada/fe.h
@@ -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: */

Reply via email to