From: Eric Botcazou Date: Mon, 1 Jul 2019 13:37:31 +0000 (+0000) Subject: [Ada] Make No_Inline pragma effective for generic subprograms X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b9aa1a98fd194ab8fad3f54e232172fd857f077;p=gcc.git [Ada] Make No_Inline pragma effective for generic subprograms 2019-07-01 Eric Botcazou 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 38bd1d7ca2e..a342b9853a9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2019-07-01 Eric Botcazou + + * 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 * sem_ch3.adb (Build_Derived_Record_Type): If the parent type is diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index efbb6cc3e4e..0395af942a9 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -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 (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 -- be done explicitly because pragma does not appear in generic -- declaration (unlike the aspect case). @@ -5663,11 +5673,6 @@ package body Sem_Ch12 is Set_No_Return (Anon_Id); 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 -- body is instantiated at a later pass. This preserves the original -- context in effect for the body.