From 5f325af2606476be7ef1db50b1a46ab842901bb9 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 12 Jan 2017 14:30:20 +0100 Subject: [multiple changes] 2017-01-12 Yannick Moy * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied subtree. 2017-01-12 Justin Squirek * exp_attr.adb (Expand_N_Attribute_Reference): Fix Finalization_Size case by properly resolving the type after rewritting the node. 2017-01-12 Hristian Kirtchev * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into the tree. (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree. * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb, exp_sel.ads: Minor reformatting. 2017-01-12 Justin Squirek * exp_ch6.adb (Expand_Call): Add guard to prevent invariant checks from being created for internally generated subprograms. 2017-01-12 Bob Duff * lib-writ.ads: Remove incorrect comment. 2017-01-12 Javier Miranda * debug.adb (-gnatd.K): Enable generation of contract-only procedures in CodePeer mode. * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms): New subprogram. (Analyze_Contracts): Generate contract-only procedures if -gnatdK is set. * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New subprogram. (Get_Contract_Only_Missing_Body_Name): New subprogram. (Get_Contract_Only_Body): New subprogram. (Set_Contract_Only_Body): New subprogram. (Is_Contract_Only_Body): New subprogram. (Set_Is_Contract_Only_Body): New subprogram. (SCIL_Nodes): Replace table by hash-table. From-SVN: r244356 --- gcc/ada/exp_util.adb | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'gcc/ada/exp_util.adb') diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 7791ad46..f19b6e3 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -1897,13 +1897,19 @@ package body Exp_Util is Set_Corresponding_Spec (Proc_Body, Proc_Id); -- The body should not be inserted into the tree when the context is - -- ASIS, GNATprove or a generic unit because it is not part of the - -- template. Note that the body must still be generated in order to - -- resolve the DIC assertion expression. + -- ASIS or a generic unit because it is not part of the template. Note + -- that the body must still be generated in order to resolve the DIC + -- assertion expression. - if ASIS_Mode or GNATprove_Mode or Inside_A_Generic then + if ASIS_Mode or Inside_A_Generic then null; + -- Semi-insert the body into the tree for GNATprove by setting its + -- Parent field. This allows for proper upstream tree traversals. + + elsif GNATprove_Mode then + Set_Parent (Proc_Body, Parent (Declaration_Node (Work_Typ))); + -- Otherwise the body is part of the freezing actions of the working -- type. @@ -2083,16 +2089,20 @@ package body Exp_Util is New_Occurrence_Of (Work_Typ, Loc))))); -- The declaration should not be inserted into the tree when the context - -- is ASIS, GNATprove, or a generic unit because it is not part of the - -- template. + -- is ASIS or a generic unit because it is not part of the template. - if ASIS_Mode or GNATprove_Mode or Inside_A_Generic then + if ASIS_Mode or Inside_A_Generic then null; + -- Semi-insert the declaration into the tree for GNATprove by setting + -- its Parent field. This allows for proper upstream tree traversals. + + elsif GNATprove_Mode then + Set_Parent (Proc_Decl, Parent (Typ_Decl)); + -- Otherwise insert the declaration else - pragma Assert (Present (Typ_Decl)); Insert_After_And_Analyze (Typ_Decl, Proc_Decl); end if; -- cgit v1.1