+2018-05-30 Piotr Trojanek <trojanek@adacore.com>
+
+ * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb,
+ sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb
+ (Has_Original_Node): Refactor to use Is_Rewrite_Substitution.
+
2018-05-30 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Pragma): Remove conjuncts that are always true.
end loop;
if Nkind (N) = N_Raise_Constraint_Error
- and then Original_Node (N) /= N
+ and then Is_Rewrite_Substitution (N)
and then No (Condition (N))
then
-- Warnings may have been posted on subexpressions of the original
-- that Convert_To_Positional succeeded and reanalyzed the rewritten
-- aggregate.
- elsif Analyzed (N) and then N /= Original_Node (N) then
+ elsif Analyzed (N) and then Is_Rewrite_Substitution (N) then
return;
end if;
-- node. Inspect the original node to detect the initial placement
-- of the call.
- elsif Original_Node (N) /= N then
+ elsif Is_Rewrite_Substitution (N) then
Detect_Subprogram_Call (Original_Node (N));
if Must_Hook then
while Present (E) loop
Force_Evaluation (E);
- if Original_Node (E) /= E then
+ if Is_Rewrite_Substitution (E) then
Set_Do_Range_Check
(E, Do_Range_Check (Original_Node (E)));
end if;
Write_Str ("=");
Write_Str (Node_Kind'Image (Nkind (Item)));
- if Item /= Original_Node (Item) then
+ if Is_Rewrite_Substitution (Item) then
Write_Str (", orig = ");
Write_Int (Int (Original_Node (Item)));
Write_Str ("=");
-- from the node, since we may have rewritten things and
-- substituted an identifier representing the rewrite.
- if Original_Node (Nod) /= Nod then
+ if Is_Rewrite_Substitution (Nod) then
Check_Expr_Constants (Original_Node (Nod));
-- If the node is an object declaration without initial
-- parameter has been analyzed, but may need a subsequent
-- dereference, so skip its analysis now.
- if N /= Original_Node (N)
+ if Is_Rewrite_Substitution (N)
and then Nkind (Original_Node (N)) = Nkind (N)
and then Nkind (Name (N)) /= Nkind (Name (Original_Node (N)))
and then Present (Parameter_Associations (N))
if Ada_Version >= Ada_2012
and then not Comes_From_Source (N)
- and then N /= Original_Node (N)
+ and then Is_Rewrite_Substitution (N)
and then Ekind (Target_Type) = E_General_Access_Type
and then Ekind (Opnd_Type) = E_Anonymous_Access_Type
then
-- original node is a conversion, then Is_Variable will not be true
-- but we still want to allow the conversion if it converts a variable).
- elsif Original_Node (AV) /= AV then
+ elsif Is_Rewrite_Substitution (AV) then
-- In Ada 2012, the explicit dereference may be a rewritten call to a
-- Reference function.