diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-06-04 21:33:28 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-06-21 10:34:20 +0200 |
commit | 7a51065e94e759d20dcb00cf58d4b472cc8185fd (patch) | |
tree | 3d4ffc2312b94a910abf4481d81a13e6109148e2 /gcc/ada/einfo-utils.adb | |
parent | 3c99b1a75585b3c5ea5f79c87702c33b60e47a14 (diff) | |
download | gcc-7a51065e94e759d20dcb00cf58d4b472cc8185fd.zip gcc-7a51065e94e759d20dcb00cf58d4b472cc8185fd.tar.gz gcc-7a51065e94e759d20dcb00cf58d4b472cc8185fd.tar.bz2 |
ada: Small cleanup in processing of primitive operations
The processing of primitive operations is now always uniform for tagged and
untagged types, but the code contains left-overs from the time where it was
specific to tagged types, in particular for the handling of subtypes.
gcc/ada/
* einfo.ads (Direct_Primitive_Operations): Mention concurrent types
as well as GNAT extensions instead of implementation details.
(Primitive_Operations): Document that Direct_Primitive_Operations is
also used for concurrent types as a fallback.
* einfo-utils.adb (Primitive_Operations): Tweak formatting.
* exp_util.ads (Find_Prim_Op): Adjust description.
* exp_util.adb (Make_Subtype_From_Expr): In the private case with
unknown discriminants, always copy Direct_Primitive_Operations and
do not overwrite the Class_Wide_Type of the expression's base type.
* sem_ch3.adb (Analyze_Incomplete_Type_Decl): Tweak comment.
(Analyze_Subtype_Declaration): Remove older and now dead calls to
Set_Direct_Primitive_Operations. Tweak comment.
(Build_Derived_Private_Type): Likewise.
(Build_Derived_Record_Type): Likewise.
(Build_Discriminated_Subtype): Set Direct_Primitive_Operations in
all cases instead of just for tagged types.
(Complete_Private_Subtype): Likewise.
(Derived_Type_Declaration): Tweak comment.
* sem_ch4.ads (Try_Object_Operation): Adjust description.
Diffstat (limited to 'gcc/ada/einfo-utils.adb')
-rw-r--r-- | gcc/ada/einfo-utils.adb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb index 4c86ba1..c0c79f9 100644 --- a/gcc/ada/einfo-utils.adb +++ b/gcc/ada/einfo-utils.adb @@ -2422,8 +2422,8 @@ package body Einfo.Utils is begin if Is_Concurrent_Type (Id) then if Present (Corresponding_Record_Type (Id)) then - return Direct_Primitive_Operations - (Corresponding_Record_Type (Id)); + return + Direct_Primitive_Operations (Corresponding_Record_Type (Id)); -- When expansion is disabled, the corresponding record type is -- absent, but if this is a tagged type with ancestors, or if the |