public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-7858] ada: Small code cleanup
@ 2023-09-27  8:24 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2023-09-27  8:24 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:302f05a0fe0f9f88a787c3960868a45dec98bce7

commit r13-7858-g302f05a0fe0f9f88a787c3960868a45dec98bce7
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Feb 14 17:03:19 2023 +0100

    ada: Small code cleanup
    
    This just merges two conditional blocks depending on the same condition.
    
    gcc/ada/
    
            * frontend.adb (Frontend): Merge two conditional blocks and adjust.

Diff:
---
 gcc/ada/frontend.adb | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb
index d964acd19f8..f2faa0960c6 100644
--- a/gcc/ada/frontend.adb
+++ b/gcc/ada/frontend.adb
@@ -426,24 +426,17 @@ begin
 
             --  Cleanup processing after completing main analysis
 
-            --  In GNATprove_Mode we do not perform most expansions but body
-            --  instantiation is needed.
+            pragma Assert (Operating_Mode in Check_Semantics | Generate_Code);
 
-            pragma Assert
-              (Operating_Mode = Generate_Code
-                or else Operating_Mode = Check_Semantics);
+            if Operating_Mode = Generate_Code or else GNATprove_Mode then
+
+               --  In GNATprove_Mode we do not perform most expansions but body
+               --  instantiation is needed.
 
-            if Operating_Mode = Generate_Code
-              or else GNATprove_Mode
-            then
                Instantiate_Bodies;
-            end if;
 
-            --  Analyze all inlined bodies, check access-before-elaboration
-            --  rules, and remove ignored Ghost code when generating code or
-            --  compiling for GNATprove.
+               --  Analyze inlined bodies if required
 
-            if Operating_Mode = Generate_Code or else GNATprove_Mode then
                if Inline_Processing_Required then
                   Analyze_Inlined_Bodies;
                end if;
@@ -455,6 +448,8 @@ begin
                   Collect_Garbage_Entities;
                end if;
 
+               --  Check access-before-elaboration rules
+
                if Legacy_Elaboration_Checks then
                   Check_Elab_Calls;
                end if;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-27  8:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-27  8:24 [gcc r13-7858] ada: Small code cleanup Eric Botcazou

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).