aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/frontend.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-02-14 17:03:19 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-23 09:50:58 +0200
commit507fe403b505fdaeffcc1beb2188e86f9ab8de9f (patch)
treed46abc1bee203402e4a6ea7e36513ecc546ece70 /gcc/ada/frontend.adb
parent55d10287e5a404724f0bd12003daaf8129c2c595 (diff)
downloadgcc-507fe403b505fdaeffcc1beb2188e86f9ab8de9f.zip
gcc-507fe403b505fdaeffcc1beb2188e86f9ab8de9f.tar.gz
gcc-507fe403b505fdaeffcc1beb2188e86f9ab8de9f.tar.bz2
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.
Diffstat (limited to 'gcc/ada/frontend.adb')
-rw-r--r--gcc/ada/frontend.adb21
1 files changed, 8 insertions, 13 deletions
diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb
index d964acd..f2faa09 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;