Commit eb9cb0fc by Ed Schonberg Committed by Arnaud Charlet

exp_ch9.ads, [...] (Build_Wrapper_Spec): Use source line of primitive operation...

2009-04-29  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch9.ads, exp_ch9.adb (Build_Wrapper_Spec): Use source line of
	primitive operation, rather than source line of synchronized type, when
	building the wrapper for a primitive operation that overrides an
	operation inherited from a progenitor, to improve the error message on
	duplicate declarations.

	* sem_ch3.adb (Process_Full_View): Use new signature of
	Build_Wrapper_Spec.

From-SVN: r146961
parent 7f7d37cb
2009-04-29 Ed Schonberg <schonberg@adacore.com>
* exp_ch9.ads, exp_ch9.adb (Build_Wrapper_Spec): Use source line of
primitive operation, rather than source line of synchronized type, when
building the wrapper for a primitive operation that overrides an
operation inherited from a progenitor, to improve the error message on
duplicate declarations.
* sem_ch3.adb (Process_Full_View): Use new signature of
Build_Wrapper_Spec.
2009-04-29 Robert Dewar <dewar@adacore.com> 2009-04-29 Robert Dewar <dewar@adacore.com>
* prj-nmsc.ads: Minor reformatting * prj-nmsc.ads: Minor reformatting
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -1599,7 +1599,7 @@ package body Exp_Ch9 is ...@@ -1599,7 +1599,7 @@ package body Exp_Ch9 is
Body_Spec : Node_Id; Body_Spec : Node_Id;
begin begin
Body_Spec := Build_Wrapper_Spec (Loc, Subp_Id, Obj_Typ, Formals); Body_Spec := Build_Wrapper_Spec (Subp_Id, Obj_Typ, Formals);
-- The subprogram is not overriding or is not a primitive declared -- The subprogram is not overriding or is not a primitive declared
-- between two views. -- between two views.
...@@ -1776,11 +1776,11 @@ package body Exp_Ch9 is ...@@ -1776,11 +1776,11 @@ package body Exp_Ch9 is
------------------------ ------------------------
function Build_Wrapper_Spec function Build_Wrapper_Spec
(Loc : Source_Ptr; (Subp_Id : Entity_Id;
Subp_Id : Entity_Id;
Obj_Typ : Entity_Id; Obj_Typ : Entity_Id;
Formals : List_Id) return Node_Id Formals : List_Id) return Node_Id
is is
Loc : constant Source_Ptr := Sloc (Subp_Id);
First_Param : Node_Id; First_Param : Node_Id;
Iface : Entity_Id; Iface : Entity_Id;
Iface_Elmt : Elmt_Id; Iface_Elmt : Elmt_Id;
...@@ -2147,15 +2147,15 @@ package body Exp_Ch9 is ...@@ -2147,15 +2147,15 @@ package body Exp_Ch9 is
and then Ekind (Defining_Identifier (Decl)) = E_Entry and then Ekind (Defining_Identifier (Decl)) = E_Entry
then then
Wrap_Spec := Wrap_Spec :=
Build_Wrapper_Spec (Loc, Build_Wrapper_Spec
Subp_Id => Defining_Identifier (Decl), (Subp_Id => Defining_Identifier (Decl),
Obj_Typ => Rec_Typ, Obj_Typ => Rec_Typ,
Formals => Parameter_Specifications (Decl)); Formals => Parameter_Specifications (Decl));
elsif Nkind (Decl) = N_Subprogram_Declaration then elsif Nkind (Decl) = N_Subprogram_Declaration then
Wrap_Spec := Wrap_Spec :=
Build_Wrapper_Spec (Loc, Build_Wrapper_Spec
Subp_Id => Defining_Unit_Name (Specification (Decl)), (Subp_Id => Defining_Unit_Name (Specification (Decl)),
Obj_Typ => Rec_Typ, Obj_Typ => Rec_Typ,
Formals => Formals =>
Parameter_Specifications (Specification (Decl))); Parameter_Specifications (Specification (Decl)));
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -154,8 +154,7 @@ package Exp_Ch9 is ...@@ -154,8 +154,7 @@ package Exp_Ch9 is
-- Build_Task_Allocate_Block. -- Build_Task_Allocate_Block.
function Build_Wrapper_Spec function Build_Wrapper_Spec
(Loc : Source_Ptr; (Subp_Id : Entity_Id;
Subp_Id : Entity_Id;
Obj_Typ : Entity_Id; Obj_Typ : Entity_Id;
Formals : List_Id) return Node_Id; Formals : List_Id) return Node_Id;
-- Ada 2005 (AI-345): Build the specification of a primitive operation -- Ada 2005 (AI-345): Build the specification of a primitive operation
...@@ -203,7 +202,9 @@ package Exp_Ch9 is ...@@ -203,7 +202,9 @@ package Exp_Ch9 is
-- routine to make sure Complete_Master is called on exit). -- routine to make sure Complete_Master is called on exit).
procedure Expand_Access_Protected_Subprogram_Type (N : Node_Id); procedure Expand_Access_Protected_Subprogram_Type (N : Node_Id);
-- Build Equivalent_Type for an Access_to_protected_Subprogram -- Build Equivalent_Type for an Access_To_Protected_Subprogram.
-- Equivalent_Type is a record type with two components: a pointer
-- to the protected object, and a pointer to the operation itself.
procedure Expand_Accept_Declarations (N : Node_Id; Ent : Entity_Id); procedure Expand_Accept_Declarations (N : Node_Id; Ent : Entity_Id);
-- Expand declarations required for accept statement. See bodies of -- Expand declarations required for accept statement. See bodies of
......
...@@ -16262,7 +16262,6 @@ package body Sem_Ch3 is ...@@ -16262,7 +16262,6 @@ package body Sem_Ch3 is
declare declare
Conc_Typ : constant Entity_Id := Conc_Typ : constant Entity_Id :=
Corresponding_Record_Type (Full_T); Corresponding_Record_Type (Full_T);
Loc : constant Source_Ptr := Sloc (Conc_Typ);
Curr_Nod : Node_Id := Parent (Conc_Typ); Curr_Nod : Node_Id := Parent (Conc_Typ);
Wrap_Spec : Node_Id; Wrap_Spec : Node_Id;
...@@ -16274,10 +16273,10 @@ package body Sem_Ch3 is ...@@ -16274,10 +16273,10 @@ package body Sem_Ch3 is
and then not Is_Abstract_Subprogram (Prim) and then not Is_Abstract_Subprogram (Prim)
then then
Wrap_Spec := Wrap_Spec :=
Make_Subprogram_Declaration (Loc, Make_Subprogram_Declaration (Sloc (Prim),
Specification => Specification =>
Build_Wrapper_Spec (Loc, Build_Wrapper_Spec
Subp_Id => Prim, (Subp_Id => Prim,
Obj_Typ => Conc_Typ, Obj_Typ => Conc_Typ,
Formals => Formals =>
Parameter_Specifications ( Parameter_Specifications (
......
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