diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-12 14:30:20 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-12 14:30:20 +0100 |
commit | 5f325af2606476be7ef1db50b1a46ab842901bb9 (patch) | |
tree | 1eb80eba1ca449f68eb93ecacde316fd096aa023 /gcc/ada/exp_util.adb | |
parent | 10c2c151f1204439e8b2698bf3369b8d2c29efbf (diff) | |
download | gcc-5f325af2606476be7ef1db50b1a46ab842901bb9.zip gcc-5f325af2606476be7ef1db50b1a46ab842901bb9.tar.gz gcc-5f325af2606476be7ef1db50b1a46ab842901bb9.tar.bz2 |
[multiple changes]
2017-01-12 Yannick Moy <moy@adacore.com>
* exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
subtree.
2017-01-12 Justin Squirek <squirek@adacore.com>
* 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 <kirtchev@adacore.com>
* 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 <squirek@adacore.com>
* exp_ch6.adb (Expand_Call): Add guard to prevent
invariant checks from being created for internally generated
subprograms.
2017-01-12 Bob Duff <duff@adacore.com>
* lib-writ.ads: Remove incorrect comment.
2017-01-12 Javier Miranda <miranda@adacore.com>
* 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
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r-- | gcc/ada/exp_util.adb | 26 |
1 files changed, 18 insertions, 8 deletions
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; |