Skip to content

Commit

Permalink
[Ada] Fix up handling of ghost units PR104027 #2
Browse files Browse the repository at this point in the history
gcc/ada/

	PR ada/104027
	* gnat1drv.adb (Gnat1drv): Only call Exit_Program when not
	generating code, otherwise instead go to End_Of_Program.
  • Loading branch information
ArnaudCharlet authored and pmderodat committed Jan 31, 2022
1 parent 263a594 commit 2dbc237
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions gcc/ada/gnat1drv.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1504,11 +1504,19 @@ begin
Namet.Finalize;
Check_Rep_Info;

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

Exit_Program (Ecode);
Exit_Program (Ecode);

else
-- Otherwise use a goto so that finalization occurs normally and
-- for instance any late processing in the GCC code can be
-- performed.

goto End_Of_Program;
end if;
end if;

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

0 comments on commit 2dbc237

Please sign in to comment.