aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-01-22 19:38:10 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-10 08:19:28 +0000
commitd118bc58f56a7aa0bcd4e0371782e59ffb8cde73 (patch)
tree4ea0a431e04d8264bb3a2556c1078bfa1157d128 /gcc/ada/sem_res.adb
parentb814f0bdf1c1f6bcb628567c8e0e95fd68425657 (diff)
downloadgcc-d118bc58f56a7aa0bcd4e0371782e59ffb8cde73.zip
gcc-d118bc58f56a7aa0bcd4e0371782e59ffb8cde73.tar.gz
gcc-d118bc58f56a7aa0bcd4e0371782e59ffb8cde73.tar.bz2
[Ada] Reuse Is_Rewrite_Substitution where possible
Replace comparisons of Original_Node with semantically equivalent but high-level calls to Is_Rewrite_Substitution. Offending occurrences found with: $ grep -n "Original_Node (\([A-Za-z_]\+\)) /\?= \1" *.adb Code cleanup only; semantics is unaffected. gcc/ada/ * atree.adb, exp_ch6.adb, exp_ch9.adb, ghost.adb, sem_ch3.adb, sem_ch4.adb, sem_res.adb, sem_util.adb: Use Is_Rewrite_Substitution where possible.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 5a57d62..538f860 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -2472,7 +2472,7 @@ package body Sem_Res is
-- Declare_Expression and requires scope management.
if Nkind (N) = N_Expression_With_Actions then
- if Comes_From_Source (N) and then N = Original_Node (N) then
+ if Comes_From_Source (N) and then not Is_Rewrite_Substitution (N) then
Resolve_Declare_Expression (N, Typ);
else
Resolve (Expression (N), Typ);