aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/frontend.adb
diff options
context:
space:
mode:
authorRichard Kenner <kenner@adacore.com>2021-11-16 09:39:57 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-12-01 10:24:41 +0000
commitbe6bb3fc57e2af376e5c18eeca51119e87a55ee3 (patch)
tree1d50d1498e024a3413c26384480c616008d6afa7 /gcc/ada/frontend.adb
parentdbdb6b93a2808d5c3d518e9675d058fab3b8f89b (diff)
downloadgcc-be6bb3fc57e2af376e5c18eeca51119e87a55ee3.zip
gcc-be6bb3fc57e2af376e5c18eeca51119e87a55ee3.tar.gz
gcc-be6bb3fc57e2af376e5c18eeca51119e87a55ee3.tar.bz2
[Ada] Fix issues with ignored ghost code and unnesting
gcc/ada/ * frontend.adb (Frontend): Do unnesting after ignored ghost code has been removed. * inline.adb (Analyze_Inlined_Bodies): Don't put ignored ghost entities on inlined subprogram list.
Diffstat (limited to 'gcc/ada/frontend.adb')
-rw-r--r--gcc/ada/frontend.adb15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb
index a65b3e1..b78fc9c 100644
--- a/gcc/ada/frontend.adb
+++ b/gcc/ada/frontend.adb
@@ -473,12 +473,6 @@ begin
Check_Elaboration_Scenarios;
end if;
- -- At this stage we can unnest subprogram bodies if required
-
- if Total_Errors_Detected = 0 then
- Exp_Unst.Unnest_Subprograms (Cunit (Main_Unit));
- end if;
-
-- List library units if requested
if List_Units then
@@ -494,12 +488,19 @@ begin
Sem_Warn.Output_Unused_Warnings_Off_Warnings;
-- Remove any ignored Ghost code as it must not appear in the
- -- executable. This action must be performed last because it
+ -- executable. This action must be performed very late because it
-- heavily alters the tree.
if Operating_Mode = Generate_Code or else GNATprove_Mode then
Remove_Ignored_Ghost_Code;
end if;
+
+ -- At this stage we can unnest subprogram bodies if required
+
+ if Total_Errors_Detected = 0 then
+ Exp_Unst.Unnest_Subprograms (Cunit (Main_Unit));
+ end if;
+
end if;
end if;
end;