2013-04-23 Robert Dewar <dewar@adacore.com>
+ * xoscons.adb: Minor reformatting.
+
+2013-04-23 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_prag.adb (Check_Mode): Ensure that a
+ self-referential output appears in both input and output lists of
+ the subprogram as categorized by aspect Global.
+ (Check_Usage): Rename formal parameters to better illustrate their
+ function. Update all uses of the said formals.
+
+2013-04-23 Thomas Quinot <quinot@adacore.com>
+
+ * exp_util.adb, exp_util.ads (Fully_Qualified_Name_String): New
+ parameter Append_NUL to make NUL-termination optional.
+ * exp_dist.adb: Consistently use the above throughout instead of
+ Get_Library_Unit_Name_String.
+
+2013-04-23 Robert Dewar <dewar@adacore.com>
+
* sem_util.adb, sem_res.adb, prj-tree.adb, prj-tree.ads: Minor
reformatting.
procedure Build_Passive_Partition_Stub (U : Node_Id) is
Pkg_Spec : Node_Id;
- Pkg_Name : String_Id;
+ Pkg_Ent : Entity_Id;
L : List_Id;
Reg : Node_Id;
Loc : constant Source_Ptr := Sloc (U);
Pkg_Spec := Parent (Corresponding_Spec (U));
L := Declarations (U);
end if;
+ Pkg_Ent := Defining_Entity (Pkg_Spec);
- Get_Library_Unit_Name_String (Pkg_Spec);
- Pkg_Name := String_From_Name_Buffer;
Reg :=
Make_Procedure_Call_Statement (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Register_Passive_Package), Loc),
Parameter_Associations => New_List (
- Make_String_Literal (Loc, Pkg_Name),
+ Make_String_Literal (Loc,
+ Fully_Qualified_Name_String (Pkg_Ent, Append_NUL => False)),
Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (Defining_Entity (Pkg_Spec), Loc),
+ Prefix => New_Occurrence_Of (Pkg_Ent, Loc),
Attribute_Name => Name_Version)));
Append_To (L, Reg);
Analyze (Reg);
Append_To (Decls, Pkg_RPC_Receiver_Body);
Analyze (Last (Decls));
- Get_Library_Unit_Name_String (Pkg_Spec);
-
-- Name
Append_To (Register_Pkg_Actuals,
Make_String_Literal (Loc,
- Strval => String_From_Name_Buffer));
+ Strval =>
+ Fully_Qualified_Name_String
+ (Defining_Entity (Pkg_Spec), Append_NUL => False)));
-- Receiver
-- Name
Make_String_Literal (Loc,
- Fully_Qualified_Name_String (Desig)),
+ Fully_Qualified_Name_String (Desig, Append_NUL => False)),
-- Handler
New_Occurrence_Of (RACW_Parameter, Loc)),
Make_String_Literal (Loc,
Strval => Fully_Qualified_Name_String
- (Etype (Designated_Type (RACW_Type)))),
+ (Etype (Designated_Type (RACW_Type)),
+ Append_NUL => False)),
Build_Stub_Tag (Loc, RACW_Type),
New_Occurrence_Of (Boolean_Literals (Is_RAS), Loc),
Make_Attribute_Reference (Loc,
Unchecked_Convert_To (RTE (RE_Address), Object),
Make_String_Literal (Loc,
Strval => Fully_Qualified_Name_String
- (Etype (Designated_Type (RACW_Type)))),
+ (Etype (Designated_Type (RACW_Type)),
+ Append_NUL => False)),
Build_Stub_Tag (Loc, RACW_Type),
New_Occurrence_Of (Boolean_Literals (Is_RAS), Loc),
Make_Attribute_Reference (Loc,
Append_To (Decls, Pkg_RPC_Receiver_Object);
Analyze (Last (Decls));
- Get_Library_Unit_Name_String (Pkg_Spec);
-
-- Name
Append_To (Register_Pkg_Actuals,
Make_String_Literal (Loc,
- Strval => String_From_Name_Buffer));
+ Strval =>
+ Fully_Qualified_Name_String
+ (Defining_Entity (Pkg_Spec), Append_NUL => False)));
-- Version
Repo_Id_Str : out String_Id)
is
begin
+ Name_Str := Fully_Qualified_Name_String (E, Append_NUL => False);
Start_String;
Store_String_Chars ("DSA:");
- Get_Library_Unit_Name_String (Scope (E));
- Store_String_Chars
- (Name_Buffer (Name_Buffer'First ..
- Name_Buffer'First + Name_Len - 1));
- Store_String_Char ('.');
- Get_Name_String (Chars (E));
- Store_String_Chars
- (Name_Buffer (Name_Buffer'First ..
- Name_Buffer'First + Name_Len - 1));
+ Store_String_Chars (Name_Str);
Store_String_Chars (":1.0");
Repo_Id_Str := End_String;
- Name_Str := String_From_Name_Buffer;
end Build_Name_And_Repository_Id;
-----------------------
Package_Spec : Node_Id) return Node_Id
is
Inst : Node_Id;
- Pkg_Name : String_Id;
+ Pkg_Name : constant String_Id :=
+ Fully_Qualified_Name_String
+ (Defining_Entity (Package_Spec), Append_NUL => False);
begin
- Get_Library_Unit_Name_String (Package_Spec);
- Pkg_Name := String_From_Name_Buffer;
Inst :=
Make_Package_Instantiation (Loc,
Defining_Unit_Name => Make_Temporary (Loc, 'R'),
-- dependency clause has operator "+".
procedure Check_Usage
- (Subp_List : Elist_Id;
- Item_List : Elist_Id;
- Is_Input : Boolean);
- -- Verify that all items from list Subp_List appear in Item_List.
+ (Subp_Items : Elist_Id;
+ Used_Items : Elist_Id;
+ Is_Input : Boolean);
+ -- Verify that all items from Subp_Items appear in Used_Items.
-- Emit an error if this is not the case.
procedure Collect_Subprogram_Inputs_Outputs;
if Ekind_In (Item_Id, E_Abstract_State, E_Variable) then
if Global_Seen
- and then not Appears_In (Subp_Inputs, Item_Id)
+ and then not
+ (Appears_In (Subp_Inputs, Item_Id)
+ and then
+ Appears_In (Subp_Outputs, Item_Id))
then
Error_Msg_NE
("item & must have mode in out", Item, Item_Id);
-----------------
procedure Check_Usage
- (Subp_List : Elist_Id;
- Item_List : Elist_Id;
- Is_Input : Boolean)
+ (Subp_Items : Elist_Id;
+ Used_Items : Elist_Id;
+ Is_Input : Boolean)
is
procedure Usage_Error (Item : Node_Id; Item_Id : Entity_Id);
-- Emit an error concerning the erroneous usage of an item
-- Start of processing for Check_Usage
begin
- if No (Subp_List) then
+ if No (Subp_Items) then
return;
end if;
-- Each input or output of the subprogram must appear in a
-- dependency relation.
- Elmt := First_Elmt (Subp_List);
+ Elmt := First_Elmt (Subp_Items);
while Present (Elmt) loop
Item := Node (Elmt);
-- The item does not appear in a dependency
- if not Contains (Item_List, Item_Id) then
+ if not Contains (Used_Items, Item_Id) then
if Is_Formal (Item_Id) then
Usage_Error (Item, Item_Id);