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.
-- 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
-- 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
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));
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
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)))