[Ada] Make No_Inline pragma effective for generic subprograms
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 1 Jul 2019 13:37:31 +0000 (13:37 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 1 Jul 2019 13:37:31 +0000 (13:37 +0000)
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

gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb

index 38bd1d7..a342b98 100644 (file)
@@ -1,3 +1,9 @@
+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>
 
        * sem_ch3.adb (Build_Derived_Record_Type): If the parent type is
index efbb6cc..0395af9 100644 (file)
@@ -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.