From b0d7135584eb90c1d4de57d754c8963b1703fcc6 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Tue, 15 May 2012 12:09:44 +0000 Subject: exp_ch4.adb (Insert_Dereference_Action): Reimplemented. 2012-05-15 Hristian Kirtchev * exp_ch4.adb (Insert_Dereference_Action): Reimplemented. The routine performs address and size adjustments for dereferences of heap-allocated controlled objects. This manipulation is needed in order to restore the original state of the memory at the time it was allocated by the finalization machinery. * rtsfind.ads: Add RE_Adjust_Controlled_Dereference to tables RE_Id and RE_Unit_Table. * sinfo.adb (Has_Dereference_Action): New routine. (Set_Has_Dereference_Action): New routine. * sinfo.ads: Add new semantic flag Has_Dereference_Action along its association in nodes. (Has_Dereference_Action): New routine and pragma Inline. (Set_Has_Dereference_Action): New routine and pragma Inline. * s-stposu.ads, s-stposu.adb (Adjust_Controlled_Dereference): New routine. From-SVN: r187530 --- gcc/ada/sinfo.adb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gcc/ada/sinfo.adb') diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb index a89f9b2..e7ad52e 100644 --- a/gcc/ada/sinfo.adb +++ b/gcc/ada/sinfo.adb @@ -1427,6 +1427,14 @@ package body Sinfo is return Flag15 (N); end Has_Created_Identifier; + function Has_Dereference_Action + (N : Node_Id) return Boolean is + begin + pragma Assert (False + or else NT (N).Nkind = N_Explicit_Dereference); + return Flag13 (N); + end Has_Dereference_Action; + function Has_Dynamic_Length_Check (N : Node_Id) return Boolean is begin @@ -4515,6 +4523,14 @@ package body Sinfo is Set_Flag15 (N, Val); end Set_Has_Created_Identifier; + procedure Set_Has_Dereference_Action + (N : Node_Id; Val : Boolean := True) is + begin + pragma Assert (False + or else NT (N).Nkind = N_Explicit_Dereference); + Set_Flag13 (N, Val); + end Set_Has_Dereference_Action; + procedure Set_Has_Dynamic_Length_Check (N : Node_Id; Val : Boolean := True) is begin -- cgit v1.1