Commit 170b2989 by Arnaud Charlet

[multiple changes]

2011-08-03  Robert Dewar  <dewar@adacore.com>

	* exp_ch4.adb: Minor code cleanup.

2011-08-03  Thomas Quinot  <quinot@adacore.com>

	* exp_dist.adb: Do not generate distribution stubs if serious errors
	have been diagnosed.

2011-08-03  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch4.adb (Try_Primitive_Operation): when checking the validity of
	the first formal of a primitive operation, go to the base type to
	handle properly an access to a derived type with constrained
	discriminants.
	* sem_type.adb (Disambiguate): an immediately visible operator hides a
	user-defined function that is only use-visible.
	* inline.adb: init procs are inlineable.

From-SVN: r177253
parent e917aec2
2011-08-03 Robert Dewar <dewar@adacore.com> 2011-08-03 Robert Dewar <dewar@adacore.com>
* exp_ch4.adb: Minor code cleanup.
2011-08-03 Thomas Quinot <quinot@adacore.com>
* exp_dist.adb: Do not generate distribution stubs if serious errors
have been diagnosed.
2011-08-03 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Try_Primitive_Operation): when checking the validity of
the first formal of a primitive operation, go to the base type to
handle properly an access to a derived type with constrained
discriminants.
* sem_type.adb (Disambiguate): an immediately visible operator hides a
user-defined function that is only use-visible.
* inline.adb: init procs are inlineable.
2011-08-03 Robert Dewar <dewar@adacore.com>
* sem_aggr.adb, sem_ch3.adb, lib.ads, gnatcmd.adb, prj-proc.adb, * sem_aggr.adb, sem_ch3.adb, lib.ads, gnatcmd.adb, prj-proc.adb,
make.adb, lib-writ.adb, prj-part.adb, prj-part.ads, prj-ext.adb, make.adb, lib-writ.adb, prj-part.adb, prj-part.ads, prj-ext.adb,
fname-uf.adb, prj-ext.ads, prj.adb, prj.ads, sem_attr.adb, alfa.adb, fname-uf.adb, prj-ext.ads, prj.adb, prj.ads, sem_attr.adb, alfa.adb,
......
...@@ -7764,9 +7764,8 @@ package body Exp_Ch4 is ...@@ -7764,9 +7764,8 @@ package body Exp_Ch4 is
if Disc = Entity (Selector_Name (N)) if Disc = Entity (Selector_Name (N))
and then (Is_Entity_Name (Dval) and then (Is_Entity_Name (Dval)
or else Nkind (Dval) = N_Integer_Literal or else Compile_Time_Known_Value (Dval)
or else Is_Subtype_Declaration or else Is_Subtype_Declaration)
or else Is_Static_Expression (Dval))
then then
-- Here we have the matching discriminant. Check for -- Here we have the matching discriminant. Check for
-- the case of a discriminant of a component that is -- the case of a discriminant of a component that is
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2011, 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- --
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
with Atree; use Atree; with Atree; use Atree;
with Einfo; use Einfo; with Einfo; use Einfo;
with Elists; use Elists; with Elists; use Elists;
with Errout; use Errout;
with Exp_Atag; use Exp_Atag; with Exp_Atag; use Exp_Atag;
with Exp_Disp; use Exp_Disp; with Exp_Disp; use Exp_Disp;
with Exp_Strm; use Exp_Strm; with Exp_Strm; use Exp_Strm;
...@@ -1029,6 +1030,10 @@ package body Exp_Dist is ...@@ -1029,6 +1030,10 @@ package body Exp_Dist is
pragma Warnings (Off, Subp_Str); pragma Warnings (Off, Subp_Str);
begin begin
if Serious_Errors_Detected /= 0 then
return;
end if;
Assign_Subprogram_Identifier Assign_Subprogram_Identifier
(Defining_Unit_Name (Spec), Current_Subprogram_Number, Subp_Str); (Defining_Unit_Name (Spec), Current_Subprogram_Number, Subp_Str);
...@@ -3836,6 +3841,10 @@ package body Exp_Dist is ...@@ -3836,6 +3841,10 @@ package body Exp_Dist is
pragma Warnings (Off, Subp_Val); pragma Warnings (Off, Subp_Val);
begin begin
if Serious_Errors_Detected /= 0 then
return;
end if;
-- Build receiving stub -- Build receiving stub
Current_Stubs := Current_Stubs :=
...@@ -6840,6 +6849,10 @@ package body Exp_Dist is ...@@ -6840,6 +6849,10 @@ package body Exp_Dist is
Proxy_Obj_Addr : Entity_Id; Proxy_Obj_Addr : Entity_Id;
begin begin
if Serious_Errors_Detected /= 0 then
return;
end if;
-- Build receiving stub -- Build receiving stub
Current_Stubs := Current_Stubs :=
......
...@@ -344,6 +344,7 @@ package body Inline is ...@@ -344,6 +344,7 @@ package body Inline is
elsif not Is_Inlined (Pack) elsif not Is_Inlined (Pack)
and then and then
(not Has_Completion (E) (not Has_Completion (E)
or else Is_Init_Proc (E)
or else Is_Expression_Function (E)) or else Is_Expression_Function (E))
then then
Set_Is_Inlined (Pack); Set_Is_Inlined (Pack);
......
...@@ -7260,7 +7260,8 @@ package body Sem_Ch4 is ...@@ -7260,7 +7260,8 @@ package body Sem_Ch4 is
or else or else
(Ekind (Typ) = E_Anonymous_Access_Type (Ekind (Typ) = E_Anonymous_Access_Type
and then Designated_Type (Typ) = Base_Type (Corr_Type)); and then
Base_Type (Designated_Type (Typ)) = Base_Type (Corr_Type));
end Valid_First_Argument_Of; end Valid_First_Argument_Of;
-- Start of processing for Try_Primitive_Operation -- Start of processing for Try_Primitive_Operation
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2011, 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- --
...@@ -1908,6 +1908,25 @@ package body Sem_Type is ...@@ -1908,6 +1908,25 @@ package body Sem_Type is
end if; end if;
end; end;
-- An immediately visible operator hides a use-visible user-
-- defined operation. This disambiguation cannot take place
-- earlier because the visibility of the predefined operator
-- can only be established when operand types are known.
elsif Ekind (User_Subp) = E_Function
and then Ekind (Predef_Subp) = E_Operator
and then Nkind (N) in N_Op
and then not Is_Overloaded (Right_Opnd (N))
and then
Is_Immediately_Visible (Base_Type (Etype (Right_Opnd (N))))
and then Is_Potentially_Use_Visible (User_Subp)
then
if It2.Nam = Predef_Subp then
return It1;
else
return It2;
end if;
else else
return No_Interp; return No_Interp;
end if; end if;
......
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