[Ada] Avoid unnecessary call in preanalysis without freezing

gcc/ada/

	* sem_res.adb (Preanalyze_And_Resolve): Only call
	Set_Must_Not_Freeze when it is necessary to restore the previous
	value.
This commit is contained in:
Piotr Trojanek 2021-05-28 14:54:01 +02:00 committed by Pierre-Marie de Rodat
parent e37e175e7d
commit 7e12d491ce

View File

@ -1886,9 +1886,9 @@ package body Sem_Res is
Expander_Mode_Restore;
Full_Analysis := Save_Full_Analysis;
Set_Must_Not_Freeze (N, Save_Must_Not_Freeze);
if not With_Freezing then
Set_Must_Not_Freeze (N, Save_Must_Not_Freeze);
Inside_Preanalysis_Without_Freezing :=
Inside_Preanalysis_Without_Freezing - 1;
end if;