public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-548] [Ada] Remove repeated calls in Resolve_Range
@ 2021-05-06 7:59 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-05-06 7:59 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:a86fbc250c5a6c6d5ae408166ef440f6c0f65df7
commit r12-548-ga86fbc250c5a6c6d5ae408166ef440f6c0f65df7
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Wed Jan 20 17:41:09 2021 +0100
[Ada] Remove repeated calls in Resolve_Range
gcc/ada/
* sem_res.adb (First_Last_Ref): Simplify "if [condition] then
return True" in "return [condition]".
(Resolve_Range): Remove calls appearing in IF condition from the
THEN statements.
Diff:
---
gcc/ada/sem_res.adb | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 88d294efefb..d2819e4c437 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -10542,12 +10542,9 @@ package body Sem_Res is
PL : constant Node_Id := Prefix (Lorig);
PH : constant Node_Id := Prefix (Horig);
begin
- if Is_Entity_Name (PL)
+ return Is_Entity_Name (PL)
and then Is_Entity_Name (PH)
- and then Entity (PL) = Entity (PH)
- then
- return True;
- end if;
+ and then Entity (PL) = Entity (PH);
end;
end if;
@@ -10616,11 +10613,11 @@ package body Sem_Res is
if Is_Discrete_Type (Typ) and then Expander_Active then
if Is_OK_Static_Expression (L) then
- Fold_Uint (L, Expr_Value (L), Is_OK_Static_Expression (L));
+ Fold_Uint (L, Expr_Value (L), Static => True);
end if;
if Is_OK_Static_Expression (H) then
- Fold_Uint (H, Expr_Value (H), Is_OK_Static_Expression (H));
+ Fold_Uint (H, Expr_Value (H), Static => True);
end if;
end if;
end Resolve_Range;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-06 7:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06 7:59 [gcc r12-548] [Ada] Remove repeated calls in Resolve_Range Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).