Commit 2aca76d6 by Arnaud Charlet

[multiple changes]

2012-08-06  Robert Dewar  <dewar@adacore.com>

	* sem_ch6.adb: Remove useless flag Body_Deleted.

2012-08-06  Thomas Quinot  <quinot@adacore.com>

	* sinfo.ads (End_Span): Change default from No_Uint to Uint_0,
	as this is what all usage occurrences of this attribute are
	expecting.
	* uintp.adb (UI_To_Int): Add assertion to guard against calling
	with No_Uint.

From-SVN: r190164
parent 0ebc109a
2012-08-06 Robert Dewar <dewar@adacore.com>
* sem_ch6.adb: Remove useless flag Body_Deleted.
2012-08-06 Thomas Quinot <quinot@adacore.com>
* sinfo.ads (End_Span): Change default from No_Uint to Uint_0,
as this is what all usage occurrences of this attribute are
expecting.
* uintp.adb (UI_To_Int): Add assertion to guard against calling
with No_Uint.
2012-08-06 Vincent Pucci <pucci@adacore.com>
PR ada/54125
* exp_attr.adb (Expand_N_Attribute_Reference): Expand new
Atomic_Always_Lock_Free attribute.
* sem_attr.adb (Analyze_Attribute): Analyze new
Atomic_Always_Lock_Free attribute.
(Eval_Attribute): Nothing to do with new Atomic_Always_Lock_Free
attribute.
* sem_ch9.adb (Allows_Lock_Free_Implementation):
Support_Atomic_Primitives check replaces previous erroneous
size check.
* sem_util.adb, sem_util.ads (Support_Atomic_Primitives):
New routine.
* snames.ads-tmpl: New name Name_Atomic_Always_Lock_Free and
new attribute Attribute_Atomic_Always_Lock_Free defined.
* s-atopri.adb: Support_Atomic_Primitives checks replaced by
Atomic_Always_Lock_Free queries.
* system-aix64.ads, system-aix.ads, system-darwin-ppc.ads,
system-hpux.ads, system-linux-alpha.ads, system-linux-hppa.ads,
system-linux-ppc.ads, system-linux-s390.ads,
system-linux-s390x.ads, system-linux-sh4.ads,
system-linux-sparc.ads, system-lynxos178-ppc.ads,
system-lynxos-ppc.ads, system-mingw.ads,
system-vxworks-arm.ads, system-solaris-sparc.ads,
system-solaris-sparcv9.ads, system-vms_64.ads,
system-vxworks-m68k.ads, system-vxworks-mips.ads,
system-vxworks-ppc.ads, system-vxworks-sparcv9.ads: Flag
Support_Atomic_Primitives removed.
2012-08-06 Hristian Kirtchev <kirtchev@adacore.com> 2012-08-06 Hristian Kirtchev <kirtchev@adacore.com>
* sem_mech.adb (Set_Mechanisms): OUT and IN OUT parameters are * sem_mech.adb (Set_Mechanisms): OUT and IN OUT parameters are
......
...@@ -1804,7 +1804,6 @@ package body Sem_Ch6 is ...@@ -1804,7 +1804,6 @@ package body Sem_Ch6 is
procedure Analyze_Subprogram_Body_Helper (N : Node_Id) is procedure Analyze_Subprogram_Body_Helper (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N); Loc : constant Source_Ptr := Sloc (N);
Body_Deleted : constant Boolean := False;
Body_Spec : constant Node_Id := Specification (N); Body_Spec : constant Node_Id := Specification (N);
Body_Id : Entity_Id := Defining_Entity (Body_Spec); Body_Id : Entity_Id := Defining_Entity (Body_Spec);
Prev_Id : constant Entity_Id := Current_Entity_In_Scope (Body_Id); Prev_Id : constant Entity_Id := Current_Entity_In_Scope (Body_Id);
...@@ -2076,9 +2075,8 @@ package body Sem_Ch6 is ...@@ -2076,9 +2075,8 @@ package body Sem_Ch6 is
Set_Has_Missing_Return (Id); Set_Has_Missing_Return (Id);
end if; end if;
elsif (Is_Generic_Subprogram (Id) elsif Is_Generic_Subprogram (Id)
or else not Is_Machine_Code_Subprogram (Id)) or else not Is_Machine_Code_Subprogram (Id)
and then not Body_Deleted
then then
Error_Msg_N ("missing RETURN statement in function body", N); Error_Msg_N ("missing RETURN statement in function body", N);
end if; end if;
...@@ -3133,13 +3131,9 @@ package body Sem_Ch6 is ...@@ -3133,13 +3131,9 @@ package body Sem_Ch6 is
end loop; end loop;
end if; end if;
-- Check references in body unless it was deleted. Note that the -- Check references in body
-- check of Body_Deleted here is not just for efficiency, it is
-- necessary to avoid junk warnings on formal parameters.
if not Body_Deleted then Check_References (Body_Id);
Check_References (Body_Id);
end if;
end; end;
end Analyze_Subprogram_Body_Helper; end Analyze_Subprogram_Body_Helper;
......
...@@ -4119,7 +4119,7 @@ package Sinfo is ...@@ -4119,7 +4119,7 @@ package Sinfo is
-- Then_Statements (List2) -- Then_Statements (List2)
-- Elsif_Parts (List3) (set to No_List if none present) -- Elsif_Parts (List3) (set to No_List if none present)
-- Else_Statements (List4) (set to No_List if no else part present) -- Else_Statements (List4) (set to No_List if no else part present)
-- End_Span (Uint5) (set to No_Uint if expander generated) -- End_Span (Uint5) (set to Uint_0 if expander generated)
-- N_Elsif_Part -- N_Elsif_Part
-- Sloc points to ELSIF -- Sloc points to ELSIF
...@@ -4151,7 +4151,7 @@ package Sinfo is ...@@ -4151,7 +4151,7 @@ package Sinfo is
-- Sloc points to CASE -- Sloc points to CASE
-- Expression (Node3) -- Expression (Node3)
-- Alternatives (List4) -- Alternatives (List4)
-- End_Span (Uint5) (set to No_Uint if expander generated) -- End_Span (Uint5) (set to Uint_0 if expander generated)
-- Note: Before Ada 2012, a pragma in a statement sequence is always -- Note: Before Ada 2012, a pragma in a statement sequence is always
-- followed by a statement, and this is true in the tree even in Ada -- followed by a statement, and this is true in the tree even in Ada
......
...@@ -2213,6 +2213,8 @@ package body Uintp is ...@@ -2213,6 +2213,8 @@ package body Uintp is
---------------- ----------------
function UI_To_Int (Input : Uint) return Int is function UI_To_Int (Input : Uint) return Int is
pragma Assert (Input /= No_Uint);
begin begin
if Direct (Input) then if Direct (Input) then
return Direct_Val (Input); return Direct_Val (Input);
......
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