aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo-cn.adb
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
committerIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
commite252b51ccde010cbd2a146485d8045103cd99533 (patch)
treee060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/ada/sinfo-cn.adb
parentf10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff)
parent104c05c5284b7822d770ee51a7d91946c7e56d50 (diff)
downloadgcc-e252b51ccde010cbd2a146485d8045103cd99533.zip
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/ada/sinfo-cn.adb')
-rw-r--r--gcc/ada/sinfo-cn.adb42
1 files changed, 18 insertions, 24 deletions
diff --git a/gcc/ada/sinfo-cn.adb b/gcc/ada/sinfo-cn.adb
index f2f9b58..c676d47 100644
--- a/gcc/ada/sinfo-cn.adb
+++ b/gcc/ada/sinfo-cn.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -30,27 +30,23 @@
-- general manner, but in some specific cases, the fields of related nodes
-- have been deliberately layed out in a manner that permits such alteration.
-with Atree; use Atree;
-with Snames; use Snames;
+with Atree; use Atree;
+with Snames; use Snames;
+with Sinfo.Nodes; use Sinfo.Nodes;
+with Sinfo.Utils; use Sinfo.Utils;
package body Sinfo.CN is
- use Atree.Unchecked_Access;
- -- This package is one of the few packages which is allowed to make direct
- -- references to tree nodes (since it is in the business of providing a
- -- higher level of tree access which other clients are expected to use and
- -- which implements checks).
-
------------------------------------------------------------
-- Change_Character_Literal_To_Defining_Character_Literal --
------------------------------------------------------------
procedure Change_Character_Literal_To_Defining_Character_Literal
- (N : in out Node_Id)
+ (N : Node_Id)
is
begin
- Set_Nkind (N, N_Defining_Character_Literal);
- N := Extend_Node (N);
+ Reinit_Field_To_Zero (N, F_Char_Literal_Value);
+ Extend_Node (N);
end Change_Character_Literal_To_Defining_Character_Literal;
------------------------------------
@@ -60,19 +56,17 @@ package body Sinfo.CN is
procedure Change_Conversion_To_Unchecked (N : Node_Id) is
begin
Set_Do_Overflow_Check (N, False);
- Set_Do_Tag_Check (N, False);
Set_Do_Length_Check (N, False);
- Set_Nkind (N, N_Unchecked_Type_Conversion);
+ Mutate_Nkind (N, N_Unchecked_Type_Conversion);
end Change_Conversion_To_Unchecked;
----------------------------------------------
-- Change_Identifier_To_Defining_Identifier --
----------------------------------------------
- procedure Change_Identifier_To_Defining_Identifier (N : in out Node_Id) is
+ procedure Change_Identifier_To_Defining_Identifier (N : Node_Id) is
begin
- Set_Nkind (N, N_Defining_Identifier);
- N := Extend_Node (N);
+ Extend_Node (N);
end Change_Identifier_To_Defining_Identifier;
---------------------------------------------
@@ -132,12 +126,11 @@ package body Sinfo.CN is
--------------------------------------------------------
procedure Change_Operator_Symbol_To_Defining_Operator_Symbol
- (N : in out Node_Id)
+ (N : Node_Id)
is
begin
- Set_Nkind (N, N_Defining_Operator_Symbol);
- Set_Node2 (N, Empty); -- Clear unused Str2 field
- N := Extend_Node (N);
+ Reinit_Field_To_Zero (N, F_Strval);
+ Extend_Node (N);
end Change_Operator_Symbol_To_Defining_Operator_Symbol;
----------------------------------------------
@@ -146,8 +139,9 @@ package body Sinfo.CN is
procedure Change_Operator_Symbol_To_String_Literal (N : Node_Id) is
begin
- Set_Nkind (N, N_String_Literal);
- Set_Node1 (N, Empty); -- clear Name1 field
+ Reinit_Field_To_Zero (N, F_Chars);
+ Set_Entity (N, Empty);
+ Mutate_Nkind (N, N_String_Literal);
end Change_Operator_Symbol_To_String_Literal;
------------------------------------------------
@@ -156,7 +150,7 @@ package body Sinfo.CN is
procedure Change_Selected_Component_To_Expanded_Name (N : Node_Id) is
begin
- Set_Nkind (N, N_Expanded_Name);
+ Mutate_Nkind (N, N_Expanded_Name);
Set_Chars (N, Chars (Selector_Name (N)));
end Change_Selected_Component_To_Expanded_Name;