From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Bob Duff <duff@adacore.com>
Subject: [COMMITTED] ada: Use named notation in calls to Expand_Composite_Equality
Date: Mon, 7 Nov 2022 09:41:35 +0100 [thread overview]
Message-ID: <20221107084135.151888-1-poulhies@adacore.com> (raw)
From: Bob Duff <duff@adacore.com>
Use named notation in calls to Expand_Composite_Equality.
gcc/ada/
* exp_ch4.adb
(Component_Equality, Expand_Array_Equality)
(Expand_Record_Equality): Use named notation.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/exp_ch4.adb | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 4a60ff59601..0a104cd8e23 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -1725,7 +1725,8 @@ package body Exp_Ch4 is
Expressions => Index_List2);
Test := Expand_Composite_Equality
- (Typ, Nod, Component_Type (Typ), L, R);
+ (Outer_Type => Typ, Nod => Nod, Comp_Type => Component_Type (Typ),
+ Lhs => L, Rhs => R);
-- If some (sub)component is an unchecked_union, the whole operation
-- will raise program error.
@@ -2013,7 +2014,9 @@ package body Exp_Ch4 is
Prefix => New_Copy_Tree (New_Rhs),
Expressions => New_List (New_Copy_Tree (Low_B)));
- TestL := Expand_Composite_Equality (Ltyp, Nod, Ctyp, L, R);
+ TestL := Expand_Composite_Equality
+ (Outer_Type => Ltyp, Nod => Nod, Comp_Type => Ctyp,
+ Lhs => L, Rhs => R);
L :=
Make_Indexed_Component (Loc,
@@ -2025,7 +2028,9 @@ package body Exp_Ch4 is
Prefix => New_Rhs,
Expressions => New_List (New_Copy_Tree (High_B)));
- TestH := Expand_Composite_Equality (Ltyp, Nod, Ctyp, L, R);
+ TestH := Expand_Composite_Equality
+ (Outer_Type => Ltyp, Nod => Nod, Comp_Type => Ctyp,
+ Lhs => L, Rhs => R);
return
Make_And_Then (Loc, Left_Opnd => TestL, Right_Opnd => TestH);
@@ -13380,15 +13385,16 @@ package body Exp_Ch4 is
end if;
Check :=
- Expand_Composite_Equality (Typ, Nod, Etype (C),
- Lhs =>
- Make_Selected_Component (Loc,
- Prefix => New_Lhs,
- Selector_Name => New_Occurrence_Of (C, Loc)),
- Rhs =>
- Make_Selected_Component (Loc,
- Prefix => New_Rhs,
- Selector_Name => New_Occurrence_Of (C, Loc)));
+ Expand_Composite_Equality
+ (Outer_Type => Typ, Nod => Nod, Comp_Type => Etype (C),
+ Lhs =>
+ Make_Selected_Component (Loc,
+ Prefix => New_Lhs,
+ Selector_Name => New_Occurrence_Of (C, Loc)),
+ Rhs =>
+ Make_Selected_Component (Loc,
+ Prefix => New_Rhs,
+ Selector_Name => New_Occurrence_Of (C, Loc)));
-- If some (sub)component is an unchecked_union, the whole
-- operation will raise program error.
--
2.34.1
reply other threads:[~2022-11-07 8:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221107084135.151888-1-poulhies@adacore.com \
--to=poulhies@adacore.com \
--cc=duff@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).