public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1494] [Ada] Reorder processing of default expressions to avoid repeated calls
@ 2022-07-05 8:31 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-07-05 8:31 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:6ba8c078cabee2c6abc669971e1351536ce721ec
commit r13-1494-g6ba8c078cabee2c6abc669971e1351536ce721ec
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Wed Jun 8 20:49:57 2022 +0200
[Ada] Reorder processing of default expressions to avoid repeated calls
Code cleanup related to improved detection of uninitialised objects;
semantics is unaffected.
gcc/ada/
* sem_ch6.adb (Process_Formals): Avoid repeated calls to
Expression.
Diff:
---
gcc/ada/sem_ch6.adb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 440770ad8bf..1efc8842db9 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -12985,10 +12985,10 @@ package body Sem_Ch6 is
Set_Formal_Mode (Formal);
if Ekind (Formal) = E_In_Parameter then
- Set_Default_Value (Formal, Expression (Param_Spec));
+ Default := Expression (Param_Spec);
- if Present (Expression (Param_Spec)) then
- Default := Expression (Param_Spec);
+ if Present (Default) then
+ Set_Default_Value (Formal, Default);
if Is_Scalar_Type (Etype (Default)) then
if Nkind (Parameter_Type (Param_Spec)) /=
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-05 8:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05 8:31 [gcc r13-1494] [Ada] Reorder processing of default expressions to avoid repeated calls 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).