exp_ch4.adb (Expand_Allocator_Expression): Disable the generation of Set_Finalize_Add...
authorHristian Kirtchev <kirtchev@adacore.com>
Thu, 4 Aug 2011 08:28:33 +0000 (08:28 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 4 Aug 2011 08:28:33 +0000 (10:28 +0200)
2011-08-04  Hristian Kirtchev  <kirtchev@adacore.com>

* exp_ch4.adb (Expand_Allocator_Expression): Disable the generation of
Set_Finalize_Address_Ptr for CodePeer because Finalize_Address was not
built in the first place.
(Expand_N_Allocator): Disable the generation of Set_Finalize_Address_Ptr
for CodePeer because Finalize_Address was not built to begin with.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Ditto.

From-SVN: r177330

gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch6.adb

index c4dd6f1dfd4396ed2f76e2e54e037573d3e5de42..e922351eaf80a9cfe3218cd9e3014c1527df3d89 100644 (file)
@@ -1,3 +1,12 @@
+2011-08-04  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * exp_ch4.adb (Expand_Allocator_Expression): Disable the generation of
+       Set_Finalize_Address_Ptr for CodePeer because Finalize_Address was not
+       built in the first place.
+       (Expand_N_Allocator): Disable the generation of Set_Finalize_Address_Ptr
+       for CodePeer because Finalize_Address was not built to begin with.
+       * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Ditto.
+
 2011-08-04  Pascal Obry  <obry@adacore.com>
 
        * adaint.c (__gnat_tmp_name): Use current process id to create temp
index e340fee75a17d496af9e73f223ba79daf650c6fd..7f9fdb23c37c37b8ed3c5b90e5b1e6b7386cbf02 100644 (file)
@@ -1076,9 +1076,11 @@ package body Exp_Ch4 is
             --      (Collection, <Finalize_Address>'Unrestricted_Access)
 
             --  Since .NET/JVM compilers do not support address arithmetic,
-            --  this call is skipped.
+            --  this call is skipped. The same is done for CodePeer because
+            --  Finalize_Address is never generated.
 
             if VM_Target = No_VM
+              and then not CodePeer_Mode
               and then Present (Associated_Collection (PtrT))
             then
                Insert_Action (N,
@@ -3847,7 +3849,10 @@ package body Exp_Ch4 is
                      --    Set_Finalize_Address_Ptr
                      --      (Pool, <Finalize_Address>'Unrestricted_Access)
 
-                     else
+                     --  Do not generate the above for CodePeer compilations
+                     --  because Finalize_Address is never built.
+
+                     elsif not CodePeer_Mode then
                         Insert_Action (N,
                           Make_Set_Finalize_Address_Ptr_Call
                             (Loc     => Loc,
index eabd3ef086cd264d902a718720a1926f3ef59265..1d9544dd9f35d9753e841e8cd351a15bdb03c33a 100644 (file)
@@ -7187,7 +7187,10 @@ package body Exp_Ch6 is
          then
             null;
 
-         else
+         --  Do not generate the call to Make_Set_Finalize_Address_Ptr for
+         --  CodePeer compilations becase Finalize_Address is never built.
+
+         elsif not CodePeer_Mode then
             Insert_Action (Allocator,
               Make_Set_Finalize_Address_Ptr_Call (Loc,
                 Typ     => Etype (Function_Id),