aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch7.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 16:45:56 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 16:45:56 +0200
commite4982b648918b60ab55da0e34d59c9ed4644f30b (patch)
tree2d32960fb664e091bc9b840b4f4cdbdfb1bc9b8b /gcc/ada/exp_ch7.adb
parentac88396b5e3bf22b4013339e7980a748d88eddf7 (diff)
downloadgcc-e4982b648918b60ab55da0e34d59c9ed4644f30b.zip
gcc-e4982b648918b60ab55da0e34d59c9ed4644f30b.tar.gz
gcc-e4982b648918b60ab55da0e34d59c9ed4644f30b.tar.bz2
[multiple changes]
2011-08-03 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb (Expand_Iterator_Loop): indicate that the cursor is modified in the source, to prevent spurious warnings when compiling with -gnatg. 2011-08-03 Thomas Quinot <quinot@adacore.com> * a-except-2005.adb: Minor reformatting. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * sem_warn.adb (Check_One_Unit): if the only mention of a withed unit is a renaming declaration in the private part of a package, do not emit a warning that the with_clause could be moved because the renaming may be used in the body or in a child unit. 2011-08-03 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Propagate the Comes_From_Source attribute from the original return object to the renaming. 2011-08-03 Jose Ruiz <ruiz@adacore.com> * exp_ch7.adb (Build_Raise_Statement): Do not call Raise_From_Controlled_Operation when this routine is not present in the run-time library. (Cleanup_Protected_Object, Cleanup_Task): For restricted run-time libraries (Ravenscar), tasks are non-terminating, and protected objects and tasks can only appear at library level, so we do not want finalization of protected objects nor tasks. * exp_intr.adb: Minor clarification in comment. bindgen.adb (Gen_Adainit_Ada, Gen_Main_C, Gen_Output_File_Ada, Gen_Output_File_C): Remove references to finalization of library-level objects when using restricted run-time libraries. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Build_Discriminant_Constraints): Set Original_Discriminant only if the parent type is a generic formal. From-SVN: r177278
Diffstat (limited to 'gcc/ada/exp_ch7.adb')
-rw-r--r--gcc/ada/exp_ch7.adb55
1 files changed, 40 insertions, 15 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index ad48e5a..e72c19b 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -316,7 +316,7 @@ package body Exp_Ch7 is
-- Save_Occurrence (E_Id, Get_Current_Excep.all.all);
-- end if;
--
- -- If flag For_Library is set:
+ -- If flag For_Library is set (and not in restricted profile):
--
-- when others =>
-- if not Raised_Id then
@@ -769,7 +769,7 @@ package body Exp_Ch7 is
Prefix =>
New_Reference_To (RTE (RE_Get_Current_Excep), Loc)))));
- if For_Library then
+ if For_Library and then not Restricted_Profile then
Proc_To_Call := RTE (RE_Save_Library_Occurrence);
else
@@ -2922,8 +2922,15 @@ package body Exp_Ch7 is
Raise_Id : Entity_Id;
begin
- if VM_Target = No_VM then
+ if VM_Target /= No_VM then
+ Raise_Id := RTE (RE_Reraise_Occurrence);
+
+ -- Standard run-time library
+ elsif RTE_Available (RE_Raise_From_Controlled_Operation) then
Raise_Id := RTE (RE_Raise_From_Controlled_Operation);
+
+ -- Restricted runtime: exception messages are not supported and hence
+ -- Raise_From_Controlled_Operation is not supported.
else
Raise_Id := RTE (RE_Reraise_Occurrence);
end if;
@@ -3166,12 +3173,21 @@ package body Exp_Ch7 is
Loc : constant Source_Ptr := Sloc (N);
begin
- return
- Make_Procedure_Call_Statement (Loc,
- Name =>
- New_Reference_To (RTE (RE_Finalize_Protection), Loc),
- Parameter_Associations =>
- New_List (Concurrent_Ref (Ref)));
+ -- For restricted run-time libraries (Ravenscar), tasks are
+ -- non-terminating, and protected objects can only appear at library
+ -- level, so we do not want finalization of protected objects.
+
+ if Restricted_Profile then
+ return Empty;
+
+ else
+ return
+ Make_Procedure_Call_Statement (Loc,
+ Name =>
+ New_Reference_To (RTE (RE_Finalize_Protection), Loc),
+ Parameter_Associations =>
+ New_List (Concurrent_Ref (Ref)));
+ end if;
end Cleanup_Protected_Object;
------------------
@@ -3184,12 +3200,21 @@ package body Exp_Ch7 is
is
Loc : constant Source_Ptr := Sloc (N);
begin
- return
- Make_Procedure_Call_Statement (Loc,
- Name =>
- New_Reference_To (RTE (RE_Free_Task), Loc),
- Parameter_Associations =>
- New_List (Concurrent_Ref (Ref)));
+ -- For restricted run-time libraries (Ravenscar), tasks are
+ -- non-terminating and they can only appear at library level, so we do
+ -- not want finalization of task objects.
+
+ if Restricted_Profile then
+ return Empty;
+
+ else
+ return
+ Make_Procedure_Call_Statement (Loc,
+ Name =>
+ New_Reference_To (RTE (RE_Free_Task), Loc),
+ Parameter_Associations =>
+ New_List (Concurrent_Ref (Ref)));
+ end if;
end Cleanup_Task;
------------------------------