From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Eric Botcazou <ebotcazou@adacore.com>
Subject: [COMMITTED] ada: Fix formatting glitches in Make_Tag_Assignment
Date: Tue, 22 Nov 2022 13:36:39 +0100 [thread overview]
Message-ID: <20221122123639.336264-1-poulhies@adacore.com> (raw)
From: Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_ch3.adb (Make_Tag_Assignment): Fix formatting glitches.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/exp_ch3.adb | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 7b194bb9816..2661a3ff9f6 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -11769,37 +11769,39 @@ package body Exp_Ch3 is
function Make_Tag_Assignment (N : Node_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (N);
- Def_If : constant Entity_Id := Defining_Identifier (N);
- Expr : constant Node_Id := Expression (N);
- Typ : constant Entity_Id := Etype (Def_If);
- Full_Typ : constant Entity_Id := Underlying_Type (Typ);
+ Def_If : constant Entity_Id := Defining_Identifier (N);
+ Expr : constant Node_Id := Expression (N);
+ Typ : constant Entity_Id := Etype (Def_If);
+ Full_Typ : constant Entity_Id := Underlying_Type (Typ);
+
New_Ref : Node_Id;
begin
- -- This expansion activity is called during analysis.
+ -- This expansion activity is called during analysis
if Is_Tagged_Type (Typ)
- and then not Is_Class_Wide_Type (Typ)
- and then not Is_CPP_Class (Typ)
- and then Tagged_Type_Expansion
- and then Nkind (Expr) /= N_Aggregate
- and then (Nkind (Expr) /= N_Qualified_Expression
- or else Nkind (Expression (Expr)) /= N_Aggregate)
+ and then not Is_Class_Wide_Type (Typ)
+ and then not Is_CPP_Class (Typ)
+ and then Tagged_Type_Expansion
+ and then Nkind (Expr) /= N_Aggregate
+ and then (Nkind (Expr) /= N_Qualified_Expression
+ or else Nkind (Expression (Expr)) /= N_Aggregate)
then
New_Ref :=
Make_Selected_Component (Loc,
- Prefix => New_Occurrence_Of (Def_If, Loc),
- Selector_Name =>
- New_Occurrence_Of (First_Tag_Component (Full_Typ), Loc));
+ Prefix => New_Occurrence_Of (Def_If, Loc),
+ Selector_Name =>
+ New_Occurrence_Of (First_Tag_Component (Full_Typ), Loc));
+
Set_Assignment_OK (New_Ref);
return
Make_Assignment_Statement (Loc,
- Name => New_Ref,
- Expression =>
- Unchecked_Convert_To (RTE (RE_Tag),
- New_Occurrence_Of (Node
- (First_Elmt (Access_Disp_Table (Full_Typ))), Loc)));
+ Name => New_Ref,
+ Expression =>
+ Unchecked_Convert_To (RTE (RE_Tag),
+ New_Occurrence_Of
+ (Node (First_Elmt (Access_Disp_Table (Full_Typ))), Loc)));
else
return Empty;
end if;
--
2.34.1
reply other threads:[~2022-11-22 12:36 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=20221122123639.336264-1-poulhies@adacore.com \
--to=poulhies@adacore.com \
--cc=ebotcazou@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).