Commit 086734ae by Piotr Trojanek Committed by Pierre-Marie de Rodat

[Ada] Minor refactorings

2019-08-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_ch12.adb (Get_Unit_Instantiation_Node): Simplify Nkind_In
	membership test.
	* sem.adb (Depends_On_Main): Whitespace cleanup; only assign a
	local variable if needed.

From-SVN: r274645
parent ef1c6c0e
2019-08-19 Piotr Trojanek <trojanek@adacore.com>
* sem_ch12.adb (Get_Unit_Instantiation_Node): Simplify Nkind_In
membership test.
* sem.adb (Depends_On_Main): Whitespace cleanup; only assign a
local variable if needed.
2019-08-19 Claire Dross <dross@adacore.com> 2019-08-19 Claire Dross <dross@adacore.com>
* sem_spark.ads, sem_spark.adb (Is_Pledge_Function): New * sem_spark.ads, sem_spark.adb (Is_Pledge_Function): New
......
...@@ -1729,16 +1729,14 @@ package body Sem is ...@@ -1729,16 +1729,14 @@ package body Sem is
MCU : constant Node_Id := Unit (Main_CU); MCU : constant Node_Id := Unit (Main_CU);
begin begin
CL := First (Context_Items (CU));
-- Problem does not arise with main subprograms -- Problem does not arise with main subprograms
if if not Nkind_In (MCU, N_Package_Body, N_Package_Declaration) then
not Nkind_In (MCU, N_Package_Body, N_Package_Declaration)
then
return False; return False;
end if; end if;
CL := First (Context_Items (CU));
while Present (CL) loop while Present (CL) loop
if Nkind (CL) = N_With_Clause if Nkind (CL) = N_With_Clause
and then Library_Unit (CL) = Main_CU and then Library_Unit (CL) = Main_CU
......
...@@ -8953,10 +8953,7 @@ package body Sem_Ch12 is ...@@ -8953,10 +8953,7 @@ package body Sem_Ch12 is
Decl := Unit_Declaration_Node (Corresponding_Body (Decl)); Decl := Unit_Declaration_Node (Corresponding_Body (Decl));
end if; end if;
if Nkind_In (Original_Node (Decl), N_Function_Instantiation, if Nkind (Original_Node (Decl)) in N_Generic_Instantiation then
N_Package_Instantiation,
N_Procedure_Instantiation)
then
return Original_Node (Decl); return Original_Node (Decl);
else else
return Unit (Parent (Decl)); return Unit (Parent (Decl));
......
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