aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-09-10 14:58:21 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-10-08 10:37:13 +0200
commit9ca4d98d0349882510b1ae705087a00ee9dcb0f5 (patch)
treee6effd5efd106fccae2b963075fa3fb5d7f6ad4c
parent7a5f6f764dda359385fb97d8eebe61cab092a200 (diff)
downloadgcc-9ca4d98d0349882510b1ae705087a00ee9dcb0f5.zip
gcc-9ca4d98d0349882510b1ae705087a00ee9dcb0f5.tar.gz
gcc-9ca4d98d0349882510b1ae705087a00ee9dcb0f5.tar.bz2
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.
-rw-r--r--gcc/ada/exp_tss.adb12
-rw-r--r--gcc/ada/exp_tss.ads5
-rw-r--r--gcc/ada/fe.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ada/exp_tss.adb b/gcc/ada/exp_tss.adb
index 098e001..78eb27e 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 e7f3120..aed6a68 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 9d3606c..36f5e9b 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: */