From: Piotr Trojanek <[email protected]>
Code cleanup; semantics is unaffected.
gcc/ada/ChangeLog:
* errout.adb, exp_util.adb, sem_case.adb, sem_ch4.adb, sem_res.adb:
Replace low-lever inequality with a high-level routine.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/errout.adb | 2 +-
gcc/ada/exp_util.adb | 2 +-
gcc/ada/sem_case.adb | 2 +-
gcc/ada/sem_ch4.adb | 2 +-
gcc/ada/sem_res.adb | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index cf11a0a6c1c..2263168bbba 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -3752,7 +3752,7 @@ package body Errout is
-- Handle direct attribute definitions
if Parent_Kind (Node) in N_Subprogram_Specification
- and then Original_Node (Parent (Node)) /= Parent (Node)
+ and then Is_Rewrite_Substitution (Parent (Node))
and then Nkind (Defining_Unit_Name
(Original_Node (Parent (Node))))
= N_Attribute_Reference
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index d10bd801ef6..7a19c6c1d04 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -6829,7 +6829,7 @@ package body Exp_Util is
-- early return if we have no more statements or they have been
-- rewritten, which means that they were in the source code.
- elsif No (Stmt) or else Original_Node (Stmt) /= Stmt then
+ elsif No (Stmt) or else Is_Rewrite_Substitution (Stmt) then
return Last_Init;
-- In all other cases the initialization calls follow the related
diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb
index b3c38999e3b..7c29fbea341 100644
--- a/gcc/ada/sem_case.adb
+++ b/gcc/ada/sem_case.adb
@@ -1698,7 +1698,7 @@ package body Sem_Case is
elsif Nkind (Expr) = N_Type_Conversion
and then not Comes_From_Source (Expr)
then
- if Expr /= Original_Node (Expr) then
+ if Is_Rewrite_Substitution (Expr) then
Traverse_Choice (Original_Node (Expr));
else
Traverse_Choice (Expression (Expr));
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 8eb017ee838..1ea77679ef3 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -274,7 +274,7 @@ package body Sem_Ch4 is
is (Is_Visible_Operator (N => N, Typ => Typ)
or else
-- test for a rewritten Foo."+" call
- (N /= Original_Node (N)
+ (Is_Rewrite_Substitution (N)
and then Is_Effectively_Visible_Operator
(N => Original_Node (N), Typ => Typ))
or else Checking_Potentially_Static_Expression
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 9dc8afecd4f..2d23b3f8567 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -2053,7 +2053,7 @@ package body Sem_Res is
Parent_Id : Node_Id;
begin
if Nkind (IBT_Decl) = N_Full_Type_Declaration
- and then Original_Node (IBT_Decl) /= IBT_Decl
+ and then Is_Rewrite_Substitution (IBT_Decl)
and then Nkind (Original_Node (IBT_Decl)) =
N_Full_Type_Declaration
and then Nkind (Type_Definition (Original_Node (IBT_Decl)))
--
2.53.0