+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>
* sem_spark.ads, sem_spark.adb (Is_Pledge_Function): New
MCU : constant Node_Id := Unit (Main_CU);
begin
- CL := First (Context_Items (CU));
-
-- Problem does not arise with main subprograms
- if
- not Nkind_In (MCU, N_Package_Body, N_Package_Declaration)
- then
+ if not Nkind_In (MCU, N_Package_Body, N_Package_Declaration) then
return False;
end if;
+ CL := First (Context_Items (CU));
+
while Present (CL) loop
if Nkind (CL) = N_With_Clause
and then Library_Unit (CL) = Main_CU
Decl := Unit_Declaration_Node (Corresponding_Body (Decl));
end if;
- if Nkind_In (Original_Node (Decl), N_Function_Instantiation,
- N_Package_Instantiation,
- N_Procedure_Instantiation)
- then
+ if Nkind (Original_Node (Decl)) in N_Generic_Instantiation then
return Original_Node (Decl);
else
return Unit (Parent (Decl));