[gcc r16-1217] ada: Restore Original_Access_Type field in E_Access_Subprogram_Type entities
Marc Poulhies
dkm@gcc.gnu.org
Fri Jun 6 08:40:46 GMT 2025
https://gcc.gnu.org/g:573b0389e6fe46a328964c4cc705dfff63dcb611
commit r16-1217-g573b0389e6fe46a328964c4cc705dfff63dcb611
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Mon Feb 17 10:29:48 2025 +0100
ada: Restore Original_Access_Type field in E_Access_Subprogram_Type entities
It is used by CodePeer to recognize the special access pattern.
gcc/ada/ChangeLog:
* einfo.ads (Original_Access_Type): Restore.
* gen_il-fields.ads (Opt_Field_Enum): Restore Original_Access_Type.
* gen_il-gen-gen_entities.adb: Adjust accordingly.
* exp_ch9.adb (Expand_Access_Protected_Subprogram_Type): Restore the
call to Set_Original_Access_Type.
Diff:
---
gcc/ada/einfo.ads | 7 +++++++
gcc/ada/exp_ch9.adb | 6 ++++++
gcc/ada/gen_il-fields.ads | 1 +
gcc/ada/gen_il-gen-gen_entities.adb | 3 ++-
4 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 152a8b296a0f..c07de681045a 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -3883,6 +3883,12 @@ package Einfo is
-- Optimize_Alignment (Off) mode applies to the type/object, then neither
-- of the flags Optimize_Alignment_Space/Optimize_Alignment_Time is set.
+-- Original_Access_Type
+-- Defined in E_Access_Subprogram_Type entities. Set only if the access
+-- type was generated by the expander as part of processing an access-
+-- to-protected-subprogram type. Points to the access-to-protected-
+-- subprogram type. Read by CodePeer.
+
-- Original_Array_Type
-- Defined in modular types and array types and subtypes. Set only if
-- the Is_Packed_Array_Impl_Type flag is set, indicating that the type
@@ -5122,6 +5128,7 @@ package Einfo is
-- E_Access_Subprogram_Type
-- Equivalent_Type (remote types only)
-- Directly_Designated_Type
+ -- Original_Access_Type
-- Needs_No_Actuals
-- Can_Use_Internal_Rep
-- Associated_Storage_Pool $$$
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 39ad2b10846b..ff5668e08c4c 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -5746,6 +5746,12 @@ package body Exp_Ch9 is
Insert_Before_And_Analyze (N, Decl1);
+ -- Associate the access to subprogram with its original access to
+ -- protected subprogram type. Needed by CodePeer to know that this
+ -- type corresponds with an access to protected subprogram type.
+
+ Set_Original_Access_Type (D_T2, T);
+
-- Create Equivalent_Type, a record with two components for an access to
-- object and an access to subprogram.
diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads
index 0092a5728c66..f664449ed966 100644
--- a/gcc/ada/gen_il-fields.ads
+++ b/gcc/ada/gen_il-fields.ads
@@ -839,6 +839,7 @@ package Gen_IL.Fields is
OK_To_Rename,
Optimize_Alignment_Space,
Optimize_Alignment_Time,
+ Original_Access_Type,
Original_Array_Type,
Original_Protected_Subprogram,
Original_Record_Component,
diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb
index 86e3f39f6d38..4548789383e2 100644
--- a/gcc/ada/gen_il-gen-gen_entities.adb
+++ b/gcc/ada/gen_il-gen-gen_entities.adb
@@ -677,7 +677,8 @@ begin -- Gen_IL.Gen.Gen_Entities
Cc (E_Access_Subprogram_Type, Access_Subprogram_Kind,
-- An access-to-subprogram type, created by an access-to-subprogram
-- declaration.
- (Sm (Equivalent_Type, Node_Id)));
+ (Sm (Equivalent_Type, Node_Id),
+ Sm (Original_Access_Type, Node_Id)));
Ab (Access_Protected_Kind, Access_Subprogram_Kind,
(Sm (Equivalent_Type, Node_Id)));
More information about the Gcc-cvs
mailing list