Commit 8b9aa1a9 by Eric Botcazou Committed by Pierre-Marie de Rodat

[Ada] Make No_Inline pragma effective for generic subprograms

2019-07-01  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch12.adb (Analyze_Subprogram_Instantiation): Move up
	handling of Has_Pragma_Inline_Always and deal with
	Has_Pragma_No_Inline.

From-SVN: r272880
parent f603c985
2019-07-01 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Move up
handling of Has_Pragma_Inline_Always and deal with
Has_Pragma_No_Inline.
2019-07-01 Ed Schonberg <schonberg@adacore.com> 2019-07-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Build_Derived_Record_Type): If the parent type is * sem_ch3.adb (Build_Derived_Record_Type): If the parent type is
......
...@@ -5654,6 +5654,16 @@ package body Sem_Ch12 is ...@@ -5654,6 +5654,16 @@ package body Sem_Ch12 is
Set_Has_Pragma_Inline (Act_Decl_Id, Has_Pragma_Inline (Gen_Unit)); Set_Has_Pragma_Inline (Act_Decl_Id, Has_Pragma_Inline (Gen_Unit));
Set_Has_Pragma_Inline (Anon_Id, Has_Pragma_Inline (Gen_Unit)); Set_Has_Pragma_Inline (Anon_Id, Has_Pragma_Inline (Gen_Unit));
Set_Has_Pragma_Inline_Always
(Act_Decl_Id, Has_Pragma_Inline_Always (Gen_Unit));
Set_Has_Pragma_Inline_Always
(Anon_Id, Has_Pragma_Inline_Always (Gen_Unit));
Set_Has_Pragma_No_Inline
(Act_Decl_Id, Has_Pragma_No_Inline (Gen_Unit));
Set_Has_Pragma_No_Inline
(Anon_Id, Has_Pragma_No_Inline (Gen_Unit));
-- Propagate No_Return if pragma applied to generic unit. This must -- Propagate No_Return if pragma applied to generic unit. This must
-- be done explicitly because pragma does not appear in generic -- be done explicitly because pragma does not appear in generic
-- declaration (unlike the aspect case). -- declaration (unlike the aspect case).
...@@ -5663,11 +5673,6 @@ package body Sem_Ch12 is ...@@ -5663,11 +5673,6 @@ package body Sem_Ch12 is
Set_No_Return (Anon_Id); Set_No_Return (Anon_Id);
end if; end if;
Set_Has_Pragma_Inline_Always
(Act_Decl_Id, Has_Pragma_Inline_Always (Gen_Unit));
Set_Has_Pragma_Inline_Always
(Anon_Id, Has_Pragma_Inline_Always (Gen_Unit));
-- Mark both the instance spec and the anonymous package in case the -- Mark both the instance spec and the anonymous package in case the
-- body is instantiated at a later pass. This preserves the original -- body is instantiated at a later pass. This preserves the original
-- context in effect for the body. -- context in effect for the body.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment