Commit 1d57c04f by Arnaud Charlet

[multiple changes]

2010-06-23  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch13.adb (Check_Constant_Address_Clauses): Do not check legality
	of address clauses if if Ignore_Rep_Clauses is active.
	* freeze.adb (Check_Address_Clause): If Ignore_Rep_Clauses is active,
	remove address clause from tree so that it does not reach the backend.

2010-06-23  Arnaud Charlet  <charlet@adacore.com>

	* exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Valid]): Do not
	expand 'Valid from user code in CodePeer mode, will be handled by the
	back-end directly.

2010-06-23  Bob Duff  <duff@adacore.com>

	* g-comlin.ads: Minor comment improvements.

2010-06-23  Ed Schonberg  <schonberg@adacore.com>

	* sem_res.adb (Uses_SS): The expression that initializes a controlled
	component of a record type may be a user-defined operator that is
	rewritten as a function call.

From-SVN: r161271
parent b91fccb3
2010-06-23 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Check_Constant_Address_Clauses): Do not check legality
of address clauses if if Ignore_Rep_Clauses is active.
* freeze.adb (Check_Address_Clause): If Ignore_Rep_Clauses is active,
remove address clause from tree so that it does not reach the backend.
2010-06-23 Arnaud Charlet <charlet@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Valid]): Do not
expand 'Valid from user code in CodePeer mode, will be handled by the
back-end directly.
2010-06-23 Bob Duff <duff@adacore.com>
* g-comlin.ads: Minor comment improvements.
2010-06-23 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Uses_SS): The expression that initializes a controlled
component of a record type may be a user-defined operator that is
rewritten as a function call.
2010-06-23 Bob Duff <duff@adacore.com>
* g-comlin.ads, sem_ch13.adb: Minor comment fix.
......
......@@ -4733,6 +4733,13 @@ package body Exp_Attr is
-- Start of processing for Attribute_Valid
begin
-- Do not expand sourced code 'Valid reference in CodePeer mode,
-- will be handled by the back-end directly.
if CodePeer_Mode and then Comes_From_Source (N) then
return;
end if;
-- Turn off validity checks. We do not want any implicit validity
-- checks to intefere with the explicit check from the attribute
......
......@@ -591,7 +591,36 @@ package body Freeze is
end if;
end if;
if not Error_Posted (Expr)
-- If Rep_Clauses are to be ignored, remove address clause from
-- list attached to entity, because it may be illegal for gigi,
-- for example by breaking order of elaboration..
if Ignore_Rep_Clauses then
declare
Rep : Node_Id;
begin
Rep := First_Rep_Item (E);
if Rep = Addr then
Set_First_Rep_Item (E, Next_Rep_Item (Addr));
else
while Present (Rep)
and then Next_Rep_Item (Rep) /= Addr
loop
Rep := Next_Rep_Item (Rep);
end loop;
end if;
if Present (Rep) then
Set_Next_Rep_Item (Rep, Next_Rep_Item (Addr));
end if;
end;
Rewrite (Addr, Make_Null_Statement (Sloc (E)));
elsif not Error_Posted (Expr)
and then not Needs_Finalization (Typ)
then
Warn_Overlay (Expr, Typ, Name (Addr));
......
......@@ -3138,7 +3138,14 @@ package body Sem_Ch13 is
-- Start of processing for Check_Constant_Address_Clause
begin
Check_Expr_Constants (Expr);
-- If rep_clauses are to be ignored, no need for legality checks. In
-- particular, no need to pester user about rep clauses that violate
-- the rule on constant addresses, given that these clauses will be
-- removed by Freeze before they reach the back end.
if not Ignore_Rep_Clauses then
Check_Expr_Constants (Expr);
end if;
end Check_Constant_Address_Clause;
----------------------------------------
......
......@@ -906,10 +906,12 @@ package body Sem_Res is
Expr := Original_Node (Expression (Parent (Comp)));
-- Return True if the expression is a call to a function
-- (including an attribute function such as Image) with
-- a result that requires a transient scope.
-- (including an attribute function such as Image, or a
-- user-defined operator) with a result that requires a
-- transient scope.
if (Nkind (Expr) = N_Function_Call
or else Nkind (Expr) in N_Op
or else (Nkind (Expr) = N_Attribute_Reference
and then Present (Expressions (Expr))))
and then Requires_Transient_Scope (Etype (Expr))
......
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