public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Fix implementation issues with equality for untagged record types
@ 2022-05-16  8:43 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-16  8:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Eric Botcazou

[-- Attachment #1: Type: text/plain, Size: 2654 bytes --]

This moves the implementation of AI12-0101 + AI05-0123 from the expander
to the semantic analyzer and completes the implementation of AI12-0413,
which are both binding interpretations in Ada 2012, fixing a few bugs in
the process and removing a fair amount of duplicated code throughout.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* einfo-utils.adb (Remove_Entity): Fix couple of oversights.
	* exp_ch3.adb (Is_User_Defined_Equality): Delete.
	(User_Defined_Eq): Call Get_User_Defined_Equality.
	(Make_Eq_Body): Likewise.
	(Predefined_Primitive_Eq_Body): Call Is_User_Defined_Equality.
	* exp_ch4.adb (Build_Eq_Call): Call Get_User_Defined_Equality.
	(Is_Equality): Delete.
	(User_Defined_Primitive_Equality_Op): Likewise.
	(Find_Aliased_Equality): Call Is_User_Defined_Equality.
	(Expand_N_Op_Eq): Call Underlying_Type unconditionally.
	Do not implement AI12-0101 + AI05-0123 here.
	(Expand_Set_Membership): Call Resolve_Membership_Equality.
	* exp_ch6.adb (Expand_Call_Helper): Remove obsolete code.
	* sem_aux.ads (Is_Record_Or_Limited_Type): Delete.
	* sem_aux.adb (Is_Record_Or_Limited_Type): Likewise.
	* sem_ch4.ads (Nondispatching_Call_To_Abstract_Operation): Declare.
	* sem_ch4.adb (Analyze_Call): Call Call_Abstract_Operation.
	(Analyze_Membership_Op): Call Resolve_Membership_Equality.
	(Nondispatching_Call_To_Abstract_Operation): New procedure.
	(Remove_Abstract_Operations): Call it.
	* sem_ch6.adb (Check_Untagged_Equality): Remove obsolete error and
	call Is_User_Defined_Equality.
	* sem_ch7.adb (Inspect_Untagged_Record_Completion): New procedure
	implementing AI12-0101 + AI05-0123.
	(Analyze_Package_Specification): Call it.
	(Declare_Inherited_Private_Subprograms): Minor tweak.
	(Uninstall_Declarations): Likewise.
	* sem_disp.adb (Check_Direct_Call): Adjust to new implementation
	of Is_User_Defined_Equality.
	* sem_res.ads (Resolve_Membership_Equality): Declare.
	* sem_res.adb (Resolve): Replace direct error handling with call to
	Nondispatching_Call_To_Abstract_Operation
	(Resolve_Call): Likewise.
	(Resolve_Equality_Op): Likewise.  mplement AI12-0413.
	(Resolve_Membership_Equality): New procedure.
	(Resolve_Membership_Op): Call Get_User_Defined_Equality.
	* sem_util.ads (Get_User_Defined_Eq): Rename into...
	(Get_User_Defined_Equality): ...this.
	* sem_util.adb (Get_User_Defined_Eq): Rename into...
	(Get_User_Defined_Equality): ...this. Call Is_User_Defined_Equality.
	(Is_User_Defined_Equality): Also check the profile but remove tests
	on Comes_From_Source and Parent.
	* sinfo.ads (Generic_Parent_Type): Adjust field description.
	* uintp.ads (Ubool): Invoke user-defined equality in predicate.

[-- Attachment #2: patch.diff.gz --]
[-- Type: application/gzip, Size: 9872 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-16  8:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16  8:43 [Ada] Fix implementation issues with equality for untagged record types Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).