Commit 196379c6 by Ed Schonberg Committed by Arnaud Charlet

sem_res.adb (Resolve_Call): If the call is rewritten as an indexed of a…

sem_res.adb (Resolve_Call): If the call is rewritten as an indexed of a parameterless function call...

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

	* sem_res.adb (Resolve_Call): If the call is rewritten as an indexed of
	a parameterless function call, preserve parentheses of original
	expression, for proper handling by pretty printer.
	* sem_attr.adb (Analyze_Attribute, case 'Old): Add guard to Process
	procedure, to handle quietly identifiers that have no entity names.
	* exp_util.adb (Get_Current_Value_Condition): If the parent of an
	elsif_part is missing, it has been rewritten as a nested if, and there
	is no useful information on the current value of the variable.

From-SVN: r161136
parent f0d10385
2010-06-22 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve_Call): If the call is rewritten as an indexed of
a parameterless function call, preserve parentheses of original
expression, for proper handling by pretty printer.
* sem_attr.adb (Analyze_Attribute, case 'Old): Add guard to Process
procedure, to handle quietly identifiers that have no entity names.
* exp_util.adb (Get_Current_Value_Condition): If the parent of an
elsif_part is missing, it has been rewritten as a nested if, and there
is no useful information on the current value of the variable.
2010-06-22 Gary Dismukes <dismukes@adacore.com>
* sem_ch3.adb (Build_Discriminal): Set default scopes for newly created
......
......@@ -2007,6 +2007,17 @@ package body Exp_Util is
-- unknown before the ELSE part or after the IF statement.
elsif Nkind (CV) = N_Elsif_Part then
-- if the Elsif_Part had condition_actions, the elsif has been
-- rewritten as a nested if, and the original elsif_part is
-- detached from the tree, so there is no way to obtain useful
-- information on the current value of the variable.
-- Can this be improved ???
if No (Parent (CV)) then
return;
end if;
Stm := Parent (CV);
-- Before start of ELSIF part
......
......@@ -3652,6 +3652,7 @@ package body Sem_Attr is
function Process (N : Node_Id) return Traverse_Result is
begin
if Is_Entity_Name (N)
and then Present (Entity (N))
and then not Is_Formal (Entity (N))
and then Enclosing_Subprogram (Entity (N)) = Subp
then
......
......@@ -5085,7 +5085,10 @@ package body Sem_Res is
-- Since we are correcting a node classification error made
-- by the parser, we call Replace rather than Rewrite.
-- Preserve the parenthesis count of the node, for use by
-- tools.
Set_Paren_Count (Index_Node, Paren_Count (N));
Replace (N, Index_Node);
Set_Etype (Prefix (N), Ret_Type);
Set_Etype (N, Typ);
......
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