Commit 1e4b91fc by Arnaud Charlet

[multiple changes]

2012-07-12  Thomas Quinot  <quinot@adacore.com>

	* s-bytswa.adb (Swapped2.Bswap16): Remove local function,
	no longer needed.

2012-07-12  Javier Miranda  <miranda@adacore.com>

	* exp_attr.adb (Expand_N_Attribute_Reference): For
	attributes 'access, 'unchecked_access and 'unrestricted_access,
	iff the current instance reference is located in a protected
	subprogram or entry then rewrite the access attribute to be the
	name of the "_object" parameter.

2012-07-12  Tristan Gingold  <gingold@adacore.com>

	* raise.h: Revert previous patch: structure is used in init.c
	by vms.

2012-07-12  Vincent Celier  <celier@adacore.com>

	* make.adb (Binding_Phase): If --subdirs was used, but not
	-P, change the working directory to the specified subdirectory
	before invoking gnatbind.
	(Linking_Phase): If --subdirs was used, but not -P, change the working
	directory to the specified subdirectory before invoking gnatlink.

2012-07-12  Vincent Pucci  <pucci@adacore.com>

	* exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body):
	For a procedure, instead of replacing each Comp reference by a
	reference to Current_Comp, make a renaming Comp of Current_Comp
	that rewrites the original renaming generated by the compiler
	during the analysis. Move the declarations of the procedure
	inside the generated block.
	(Process_Stmts): Moved in the body
	of Build_Lock_Free_Unprotected_Subprogram_Body.
	(Process_Node):
	Moved in the body of Build_Lock_Free_Unprotected_Subprogram_Body.
	* sem_ch9.adb (Allows_Lock_Free_Implementation): Restrict any
	non-elementary out parameters in protected procedures.

2012-07-12  Thomas Quinot  <quinot@adacore.com>

	* sem_ch13.adb (Analyze_Attribute_Definition_Clause, case
	Scalar_Storage_Order): Attribute applies to base type only.

From-SVN: r189435
parent d9819bbd
2012-07-12 Thomas Quinot <quinot@adacore.com>
* s-bytswa.adb (Swapped2.Bswap16): Remove local function,
no longer needed.
2012-07-12 Javier Miranda <miranda@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): For
attributes 'access, 'unchecked_access and 'unrestricted_access,
iff the current instance reference is located in a protected
subprogram or entry then rewrite the access attribute to be the
name of the "_object" parameter.
2012-07-12 Tristan Gingold <gingold@adacore.com>
* raise.h: Revert previous patch: structure is used in init.c
by vms.
2012-07-12 Vincent Celier <celier@adacore.com>
* make.adb (Binding_Phase): If --subdirs was used, but not
-P, change the working directory to the specified subdirectory
before invoking gnatbind.
(Linking_Phase): If --subdirs was used, but not -P, change the working
directory to the specified subdirectory before invoking gnatlink.
2012-07-12 Vincent Pucci <pucci@adacore.com>
* exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body):
For a procedure, instead of replacing each Comp reference by a
reference to Current_Comp, make a renaming Comp of Current_Comp
that rewrites the original renaming generated by the compiler
during the analysis. Move the declarations of the procedure
inside the generated block.
(Process_Stmts): Moved in the body
of Build_Lock_Free_Unprotected_Subprogram_Body.
(Process_Node):
Moved in the body of Build_Lock_Free_Unprotected_Subprogram_Body.
* sem_ch9.adb (Allows_Lock_Free_Implementation): Restrict any
non-elementary out parameters in protected procedures.
2012-07-12 Thomas Quinot <quinot@adacore.com>
* sem_ch13.adb (Analyze_Attribute_Definition_Clause, case
Scalar_Storage_Order): Attribute applies to base type only.
2012-07-12 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Convert_To_Positional): Increase acceptable size
......
......@@ -815,11 +815,19 @@ package body Exp_Attr is
-- rewrite into reference to current instance.
if Is_Protected_Self_Reference (Pref)
and then not
and then not
(Nkind_In (Parent (N), N_Index_Or_Discriminant_Constraint,
N_Discriminant_Association)
and then Nkind (Parent (Parent (Parent (Parent (N))))) =
N_Component_Definition)
-- No action needed for these attributes since the current instance
-- will be rewritten to be the name of the _object parameter
-- associated with the enclosing protected subprogram (see below).
and then Id /= Attribute_Access
and then Id /= Attribute_Unchecked_Access
and then Id /= Attribute_Unrestricted_Access
then
Rewrite (Pref, Concurrent_Ref (Pref));
Analyze (Pref);
......@@ -1028,10 +1036,36 @@ package body Exp_Attr is
New_Occurrence_Of (Formal, Loc)));
Set_Etype (N, Typ);
-- The expression must appear in a default expression,
-- (which in the initialization procedure is the
-- right-hand side of an assignment), and not in a
-- discriminant constraint.
elsif Is_Protected_Type (Entity (Pref)) then
-- No action needed for current instance located in a
-- component definition (expansion will occur in the
-- init proc)
if Is_Protected_Type (Current_Scope) then
null;
-- If the current instance reference is located in a
-- protected subprogram or entry then rewrite the access
-- attribute to be the name of the "_object" parameter.
-- An unchecked conversion is applied to ensure a type
-- match in cases of expander-generated calls (e.g. init
-- procs).
else
Formal :=
First_Entity
(Protected_Body_Subprogram (Current_Scope));
Rewrite (N,
Unchecked_Convert_To (Typ,
New_Occurrence_Of (Formal, Loc)));
Set_Etype (N, Typ);
end if;
-- The expression must appear in a default expression,
-- (which in the initialization procedure is the right-hand
-- side of an assignment), and not in a discriminant
-- constraint.
else
Par := Parent (N);
......
......@@ -4435,6 +4435,13 @@ package body Make is
declare
Success : Boolean := False;
begin
-- If gnatmake was invoked with --subdirs and no project file,
-- put the executable in the subdirectory specified.
if Prj.Subdirs /= null and then Main_Project = No_Project then
Change_Dir (Object_Directory_Path.all);
end if;
Link (Main_ALI_File,
Link_With_Shared_Libgcc.all &
Args (Args'First .. Last_Arg),
......@@ -4571,6 +4578,13 @@ package body Make is
end if;
end if;
-- If gnatmake was invoked with --subdirs and no project file, put the
-- binder generated files in the subdirectory specified.
if Main_Project = No_Project and then Prj.Subdirs /= null then
Change_Dir (Object_Directory_Path.all);
end if;
begin
Bind (Main_ALI_File,
Bind_Shared.all & Args (Args'First .. Last_Arg));
......
......@@ -37,7 +37,16 @@ extern "C" {
typedef unsigned Exception_Code;
struct Exception_Data;
struct Exception_Data
{
char Not_Handled_By_Others;
char Lang;
int Name_Length;
char *Full_Name, *Htable_Ptr;
Exception_Code Import_Code;
void (*Raise_Hook)(void);
};
typedef struct Exception_Data *Exception_Id;
extern void _gnat_builtin_longjmp (void *, int);
......
......@@ -56,9 +56,6 @@ package body System.Byte_Swapping is
function Swapped2 (Input : Item) return Item is
function As_U16 is new Unchecked_Conversion (Item, U16);
function As_Item is new Unchecked_Conversion (U16, Item);
function Bswap_16 (X : U16) return U16 is (X / 256 or X * 256);
-- ??? Need to have function local here to allow inlining
pragma Compile_Time_Error (Item'Max_Size_In_Storage_Elements /= 2,
"storage size must be 2 bytes");
begin
......
......@@ -3332,7 +3332,7 @@ package body Sem_Ch13 is
else
if (Expr_Value (Expr) = 0) /= Bytes_Big_Endian then
Set_Reverse_Storage_Order (U_Ent, True);
Set_Reverse_Storage_Order (Base_Type (U_Ent), True);
end if;
end if;
end if;
......
......@@ -170,24 +170,30 @@ package body Sem_Ch9 is
Par_Specs : constant List_Id :=
Parameter_Specifications
(Specification (Decl));
Par : constant Node_Id := First (Par_Specs);
Par_Typ : constant Entity_Id :=
Etype (Parameter_Type (Par));
Par : Node_Id;
begin
if Out_Present (Par)
and then not Is_Elementary_Type (Par_Typ)
then
if Complain then
Error_Msg_NE
("non-elementary out parameter& not allowed " &
"when Lock_Free given",
Par,
Defining_Identifier (Par));
Par := First (Par_Specs);
while Present (Par) loop
if Out_Present (Par)
and then not Is_Elementary_Type
(Etype (Parameter_Type (Par)))
then
if Complain then
Error_Msg_NE
("non-elementary out parameter& not allowed " &
"when Lock_Free given",
Par,
Defining_Identifier (Par));
end if;
return False;
end if;
return False;
end if;
Next (Par);
end loop;
end;
end if;
......@@ -451,9 +457,9 @@ package body Sem_Ch9 is
-- already been accessed by the subprogram body.
if No (Comp) then
Comp := Id;
Comp := Comp_Id;
elsif Comp /= Id then
elsif Comp /= Comp_Id then
if Complain then
Error_Msg_N
("only one protected component allowed",
......
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