+2015-02-05 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb (Set_Elab_Unit_Name): New name for Set_Unit_Name
+ (Analyze_Pragma): Change Set_Unit_Name to Set_Elab_Unit_Name
+ (Set_Elab_Unit_Name): Generate reference for Elaborate[_All]
+ * sem_warn.adb (Warn_On_Unreferenced_Entity): Suppress warning
+ for exported entity.
+
2015-02-05 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Check_Pragma_Conformance): Add
-- name _Pre, _Post, _Invariant, or _Type_Invariant. Used by pragmas
-- Check, Check_Policy.
- procedure Set_Unit_Name (N : Node_Id; With_Item : Node_Id);
+ procedure Set_Elab_Unit_Name (N : Node_Id; With_Item : Node_Id);
-- Place semantic information on the argument of an Elaborate/Elaborate_All
-- pragma. Entity name for unit and its parents is taken from item in
-- previous with_clause that mentions the unit.
and then Same_Name (Name (Citem), Get_Pragma_Arg (Arg))
then
Set_Elaborate_Present (Citem, True);
- Set_Unit_Name (Get_Pragma_Arg (Arg), Name (Citem));
- Generate_Reference (Entity (Name (Citem)), Citem);
+ Set_Elab_Unit_Name (Get_Pragma_Arg (Arg), Name (Citem));
-- With the pragma present, elaboration calls on
-- subprograms from the named unit need no further
and then Same_Name (Name (Citem), Get_Pragma_Arg (Arg))
then
Set_Elaborate_All_Present (Citem, True);
- Set_Unit_Name (Get_Pragma_Arg (Arg), Name (Citem));
+ Set_Elab_Unit_Name (Get_Pragma_Arg (Arg), Name (Citem));
-- Suppress warnings and elaboration checks on the named
-- unit if the pragma is in the current compilation, as
(Cunit_Entity
(Get_Source_Unit
(Library_Unit (Citem))));
- Set_Unit_Name
+ Set_Elab_Unit_Name
(Get_Pragma_Arg (Arg_Node), Name (Citem));
exit;
end if;
end if;
end Set_Encoded_Interface_Name;
- -------------------
- -- Set_Unit_Name --
- -------------------
+ ------------------------
+ -- Set_Elab_Unit_Name --
+ ------------------------
- procedure Set_Unit_Name (N : Node_Id; With_Item : Node_Id) is
+ procedure Set_Elab_Unit_Name (N : Node_Id; With_Item : Node_Id) is
Pref : Node_Id;
Scop : Entity_Id;
Set_Entity (Pref, Scop);
end if;
- end Set_Unit_Name;
+
+ Generate_Reference (Entity (With_Item), N, Set_Ref => False);
+ end Set_Elab_Unit_Name;
end Sem_Prag;