aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/einfo.ads
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-06-04 21:33:28 +0200
committerMarc Poulhiès <poulhies@adacore.com>2024-06-21 10:34:20 +0200
commit7a51065e94e759d20dcb00cf58d4b472cc8185fd (patch)
tree3d4ffc2312b94a910abf4481d81a13e6109148e2 /gcc/ada/einfo.ads
parent3c99b1a75585b3c5ea5f79c87702c33b60e47a14 (diff)
downloadgcc-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.ads')
-rw-r--r--gcc/ada/einfo.ads34
1 files changed, 18 insertions, 16 deletions
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index dd95ea0..de17531 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -932,18 +932,17 @@ package Einfo is
-- subtypes. Contains the Digits value specified in the declaration.
-- Direct_Primitive_Operations
--- Defined in tagged types and subtypes (including synchronized types),
--- in tagged private types, and in tagged incomplete types. Moreover, it
--- is also defined for untagged types, both when Extensions_Allowed is
--- True (-gnatX) to support the extension feature of prefixed calls for
--- untagged types, and when Extensions_Allowed is False to get better
--- error messages. This field is an element list of entities for
--- primitive operations of the type. For incomplete types the list is
--- always empty. In order to follow the C++ ABI, entities of primitives
--- that come from source must be stored in this list in the order of
--- their occurrence in the sources. When expansion is disabled, the
--- corresponding record type of a synchronized type is not constructed.
--- In that case, such types carry this attribute directly.
+-- Defined in concurrent types, tagged record types and subtypes, tagged
+-- private types, and tagged incomplete types. Moreover, it is also
+-- defined in untagged types, both when GNAT extensions are allowed, to
+-- support prefixed calls for untagged types, and when GNAT extensions
+-- are not allowed, to give better error messages. Set to a list of
+-- entities for primitive operations of the type. For incomplete types
+-- the list is always empty. In order to follow the C++ ABI, entities of
+-- primitives that come from source must be stored in this list in the
+-- order of their occurrence in the sources. When expansion is disabled,
+-- the corresponding record type of concurrent types is not constructed;
+-- in this case, such types carry this attribute directly.
-- Directly_Designated_Type
-- Defined in access types. This field points to the type that is
@@ -4066,10 +4065,13 @@ package Einfo is
-- Primitive_Operations (synthesized)
-- Defined in concurrent types, tagged record types and subtypes, tagged
--- private types and tagged incomplete types. For concurrent types whose
--- Corresponding_Record_Type (CRT) is available, returns the list of
--- Direct_Primitive_Operations of its CRT; otherwise returns No_Elist.
--- For all the other types returns the Direct_Primitive_Operations.
+-- private types, and tagged incomplete types. Moreover, it is also
+-- defined in untagged types, both when GNAT extensions are allowed, to
+-- support prefixed calls for untagged types, and when GNAT extensions
+-- are not allowed, to give better error messages. For concurrent types
+-- whose Corresponding_Record_Type (CRT) is available, returns the list
+-- of Direct_Primitive_Operations of this CRT. In all the other cases,
+-- returns the list of Direct_Primitive_Operations.
-- Prival
-- Defined in private components of protected types. Refers to the entity