@@ -3799,8 +3799,8 @@ package Einfo is
-- pragma No_Component_Reordering applies.
-- No_Return
+-- Defined in subprograms and generic subprograms. Set if a valid aspect
+-- or pragma No_Return applies.
-- No_Strict_Aliasing [base type only]
-- Defined in access types. Set to direct the backend to avoid any
@@ -4969,7 +4969,6 @@ package Einfo is
-- Materialize_Entity
-- Needs_Debug_Info
-- Never_Set_In_Source
- -- No_Return
-- Overlays_Constant
-- Referenced
-- Referenced_As_LHS
@@ -5579,6 +5578,7 @@ package Einfo is
-- Is_Visible_Lib_Unit
-- Is_Wrapper
-- Needs_No_Actuals
+ -- No_Return
-- Requires_Overriding (non-generic case only)
-- Return_Present
-- Returns_By_Ref
@@ -215,7 +215,6 @@ begin -- Gen_IL.Gen.Gen_Entities
Sm (Needs_Activation_Record, Flag),
Sm (Needs_Debug_Info, Flag),
Sm (Never_Set_In_Source, Flag),
- Sm (No_Return, Flag),
Sm (Overlays_Constant, Flag),
Sm (Prev_Entity, Node_Id),
Sm (Referenced, Flag),
@@ -985,6 +984,7 @@ begin -- Gen_IL.Gen.Gen_Entities
Sm (Linker_Section_Pragma, Node_Id),
Sm (Overridden_Operation, Node_Id),
Sm (Protected_Body_Subprogram, Node_Id),
+ Sm (No_Return, Flag),
Sm (Scope_Depth_Value, Unat),
Sm (Static_Call_Helper, Node_Id),
Sm (SPARK_Pragma, Node_Id),
@@ -1193,6 +1193,7 @@ begin -- Gen_IL.Gen.Gen_Entities
(Sm (Has_Out_Or_In_Out_Parameter, Flag),
Sm (Is_Primitive, Flag),
Sm (Next_Inlined_Subprogram, Node_Id),
+ Sm (No_Return, Flag),
Sm (Overridden_Operation, Node_Id)));
Cc (E_Generic_Function, Generic_Subprogram_Kind,
@@ -1937,8 +1937,8 @@ package body Sem_Ch6 is
-- Check that pragma No_Return is obeyed. Don't complain about the
-- implicitly-generated return that is placed at the end.
- if No_Return (Scope_Id)
- and then Kind in E_Procedure | E_Generic_Procedure
+ if Kind in E_Procedure | E_Generic_Procedure
+ and then No_Return (Scope_Id)
and then Comes_From_Source (N)
then
Error_Msg_N
From: Eric Botcazou <ebotcazou@adacore.com> ...instead of defining it for all entities. gcc/ada/ * einfo.ads (No_Return): Change description and adjust accordingly. * gen_il-gen-gen_entities.adb (Entity_Kind): Remove No_Return. (Subprogram_Kind): Add No_Return. (Generic_Subprogram_Kind): Likewise. * sem_ch6.adb (Analyze_Return_Statement): Adjust No_Return test. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo.ads | 6 +++--- gcc/ada/gen_il-gen-gen_entities.adb | 3 ++- gcc/ada/sem_ch6.adb | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-)