[Ada] Reuse Is_Rewrite_Substitution in Relocate_Node
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 17 Jul 2018 08:12:08 +0000 (08:12 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 17 Jul 2018 08:12:08 +0000 (08:12 +0000)
Semantics not affected; the reused routine is exactly the same as the replaced
condition.

2018-07-17  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* atree.adb (Relocate_Node): Simplify with Is_Rewrite_Substitution.

From-SVN: r262799

gcc/ada/ChangeLog
gcc/ada/atree.adb

index 7fe98a6..bde7a0e 100644 (file)
@@ -1,5 +1,9 @@
 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
 
+       * atree.adb (Relocate_Node): Simplify with Is_Rewrite_Substitution.
+
+2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
+
        * sem_util.ads (Denotes_Same_Object): Likewise.
        * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix RM rule references.
 
index 102d7f6..c788977 100644 (file)
@@ -2186,7 +2186,7 @@ package body Atree is
       --  If the node being relocated was a rewriting of some original node,
       --  then the relocated node has the same original node.
 
-      if Orig_Nodes.Table (Source) /= Source then
+      if Is_Rewrite_Substitution (Source) then
          Orig_Nodes.Table (New_Node) := Orig_Nodes.Table (Source);
       end if;