Commit 88a27b18 by Arnaud Charlet

[multiple changes]

2012-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch12.adb (Analyze_Associations): Alphabetize local variables and
	constants. Rename Actual_Types to Actuals_To_Freeze. Rename Next_Formal
	to Saved_Formal.
	Freeze all eligible subprograms which appear as actuals in
	the instantiation.
	(Has_Fully_Defined_Profile): New routine.
	(Renames_Standard_Subprogram): New routine.
	(Earlier): Add local variable N. Comment update. Do not use source
	locations when trying to determine whether one node precedes another.

2012-01-23  Gary Dismukes  <dismukes@adacore.com>

	* exp_ch4.adb (Expand_Concatenate): In the case
	where the result of a concatentation can be null, set the to
	result have both the low and high bounds of the right operand (not
	just the high bound, as was the case prior to this fix). Also,
	fix the saved high bound setting (Last_Opnd_High_Bound) in the
	empty string literal case (should have been low bound minus one,
	rather than plus one).

2012-01-23  Thomas Quinot  <quinot@adacore.com>

	* scos.ads, put_scos.adb, get_scos.adb (Get_SCOs, Put_SCOs): Do not
	omit statement SCOs for disabled pragmas.

From-SVN: r183419
parent 3c24c853
2012-01-23 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch12.adb (Analyze_Associations): Alphabetize local variables and
constants. Rename Actual_Types to Actuals_To_Freeze. Rename Next_Formal
to Saved_Formal.
Freeze all eligible subprograms which appear as actuals in
the instantiation.
(Has_Fully_Defined_Profile): New routine.
(Renames_Standard_Subprogram): New routine.
(Earlier): Add local variable N. Comment update. Do not use source
locations when trying to determine whether one node precedes another.
2012-01-23 Gary Dismukes <dismukes@adacore.com>
* exp_ch4.adb (Expand_Concatenate): In the case
where the result of a concatentation can be null, set the to
result have both the low and high bounds of the right operand (not
just the high bound, as was the case prior to this fix). Also,
fix the saved high bound setting (Last_Opnd_High_Bound) in the
empty string literal case (should have been low bound minus one,
rather than plus one).
2012-01-23 Thomas Quinot <quinot@adacore.com>
* scos.ads, put_scos.adb, get_scos.adb (Get_SCOs, Put_SCOs): Do not
omit statement SCOs for disabled pragmas.
2012-01-23 Matthew Heaney <heaney@adacore.com>
* a-cohase.ads, a-cihase.ads, a-cbhase.ads, a-coorse.ads,
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- 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- --
......@@ -2601,6 +2601,12 @@ package body Exp_Ch4 is
-- This is either an integer literal node, or an identifier reference to
-- a constant entity initialized to the appropriate value.
Last_Opnd_Low_Bound : Node_Id;
-- A tree node representing the low bound of the last operand. This
-- need only be set if the result could be null. It is used for the
-- special case of setting the right low bound for a null result.
-- This is of type Ityp.
Last_Opnd_High_Bound : Node_Id;
-- A tree node representing the high bound of the last operand. This
-- need only be set if the result could be null. It is used for the
......@@ -2811,11 +2817,14 @@ package body Exp_Ch4 is
Result_May_Be_Null := False;
end if;
-- Capture last operand high bound if result could be null
-- Capture last operand low and high bound if result could be null
if J = N and then Result_May_Be_Null then
Last_Opnd_Low_Bound :=
New_Copy_Tree (String_Literal_Low_Bound (Opnd_Typ));
Last_Opnd_High_Bound :=
Make_Op_Add (Loc,
Make_Op_Subtract (Loc,
Left_Opnd =>
New_Copy_Tree (String_Literal_Low_Bound (Opnd_Typ)),
Right_Opnd => Make_Integer_Literal (Loc, 1));
......@@ -2871,9 +2880,13 @@ package body Exp_Ch4 is
Result_May_Be_Null := False;
end if;
-- Capture last operand bound if result could be null
-- Capture last operand bounds if result could be null
if J = N and then Result_May_Be_Null then
Last_Opnd_Low_Bound :=
Convert_To (Ityp,
Make_Integer_Literal (Loc, Expr_Value (Lo)));
Last_Opnd_High_Bound :=
Convert_To (Ityp,
Make_Integer_Literal (Loc, Expr_Value (Hi)));
......@@ -2914,7 +2927,16 @@ package body Exp_Ch4 is
Duplicate_Subexpr (Opnd, Name_Req => True),
Attribute_Name => Name_First);
-- Capture last operand bounds if result could be null
if J = N and Result_May_Be_Null then
Last_Opnd_Low_Bound :=
Convert_To (Ityp,
Make_Attribute_Reference (Loc,
Prefix =>
Duplicate_Subexpr (Opnd, Name_Req => True),
Attribute_Name => Name_First));
Last_Opnd_High_Bound :=
Convert_To (Ityp,
Make_Attribute_Reference (Loc,
......@@ -3124,6 +3146,15 @@ package body Exp_Ch4 is
-- bounds if the last operand is super-flat).
if Result_May_Be_Null then
Low_Bound :=
Make_Conditional_Expression (Loc,
Expressions => New_List (
Make_Op_Eq (Loc,
Left_Opnd => New_Copy (Aggr_Length (NN)),
Right_Opnd => Make_Artyp_Literal (0)),
Last_Opnd_Low_Bound,
Low_Bound));
High_Bound :=
Make_Conditional_Expression (Loc,
Expressions => New_List (
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009-2011, Free Software Foundation, Inc. --
-- Copyright (C) 2009-2012, Free Software Foundation, Inc. --
-- --
-- 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- --
......@@ -301,7 +301,7 @@ begin
when others =>
Skipc;
if Typ = 'P' then
if Typ = 'P' or else Typ = 'p' then
if Nextc not in '1' .. '9' then
N := 1;
loop
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009-2011, Free Software Foundation, Inc. --
-- Copyright (C) 2009-2012, Free Software Foundation, Inc. --
-- --
-- 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- --
......@@ -139,12 +139,6 @@ begin
Ctr := 0;
Continuation := False;
loop
if SCO_Pragma_Disabled
(SCO_Table.Table (Start).Pragma_Sloc)
then
goto Next_Statement;
end if;
if Ctr = 0 then
Write_SCO_Initiate (U);
if not Continuation then
......@@ -169,7 +163,7 @@ begin
Write_Info_Char (Sent.C2);
if Sent.C1 = 'S'
and then Sent.C2 = 'P'
and then (Sent.C2 = 'P' or else Sent.C2 = 'p')
and then Sent.Pragma_Name /= Unknown_Pragma
then
-- Strip leading "PRAGMA_"
......@@ -205,7 +199,6 @@ begin
Ctr := 0;
end if;
<<Next_Statement>>
exit when SCO_Table.Table (Start).Last;
Start := Start + 1;
end loop;
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2011, Free Software Foundation, Inc. --
-- Copyright (C) 2009-2012, Free Software Foundation, Inc. --
-- --
-- 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- --
......@@ -157,6 +157,7 @@ package SCOs is
-- F FOR loop (from FOR through end of iteration scheme)
-- I IF statement (from IF through end of condition)
-- P[name:] PRAGMA with the indicated name
-- p[name:] disabled PRAGMA with the indicated name
-- R extended RETURN statement
-- W WHILE loop statement (from WHILE through end of condition)
......
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