Skip to content

Commit 2dbc237

Browse files
ArnaudCharletpmderodat
authored andcommitted
[Ada] Fix up handling of ghost units PR104027 #2
gcc/ada/ PR ada/104027 * gnat1drv.adb (Gnat1drv): Only call Exit_Program when not generating code, otherwise instead go to End_Of_Program.
1 parent 263a594 commit 2dbc237

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

gcc/ada/gnat1drv.adb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,11 +1504,19 @@ begin
15041504
Namet.Finalize;
15051505
Check_Rep_Info;
15061506

1507-
-- Exit the driver with an appropriate status indicator. This will
1508-
-- generate an empty object file for ignored Ghost units, otherwise
1509-
-- no object file will be generated.
1507+
if Ecode /= E_Success then
1508+
-- If we cannot generate code, exit the driver with an appropriate
1509+
-- status indicator.
15101510

1511-
Exit_Program (Ecode);
1511+
Exit_Program (Ecode);
1512+
1513+
else
1514+
-- Otherwise use a goto so that finalization occurs normally and
1515+
-- for instance any late processing in the GCC code can be
1516+
-- performed.
1517+
1518+
goto End_Of_Program;
1519+
end if;
15121520
end if;
15131521

15141522
-- In -gnatc mode we only do annotation if -gnatR is also set, or if

0 commit comments

Comments
 (0)