diff options
author | Ed Schonberg <schonberg@adacore.com> | 2014-07-30 13:46:35 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-07-30 15:46:35 +0200 |
commit | 274d2584e534a5e63be48999c794e90a73d420cb (patch) | |
tree | b9dd594866f029f8cb02de684dc83e809212b720 /gcc/ada/inline.adb | |
parent | 2afa8fdd1b6c2757b6d73660c10801647b7c0a18 (diff) | |
download | gcc-274d2584e534a5e63be48999c794e90a73d420cb.zip gcc-274d2584e534a5e63be48999c794e90a73d420cb.tar.gz gcc-274d2584e534a5e63be48999c794e90a73d420cb.tar.bz2 |
sem_ch5.adb: Improve error recovery.
2014-07-30 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb: Improve error recovery.
* inline.adb (Build_Body_To_Inline): Set Full_Analysis to false
before analyzing the body, so that in GNATprove mode there is
no light expansion. Whatever expansion is required by SPARK will
be performed when analysing the inlined code.
From-SVN: r213267
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r-- | gcc/ada/inline.adb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 44cdec4..b2ff243 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -833,6 +833,7 @@ package body Inline is procedure Build_Body_To_Inline (N : Node_Id; Subp : Entity_Id) is Decl : constant Node_Id := Unit_Declaration_Node (Subp); + Analysis_Status : constant Boolean := Full_Analysis; Original_Body : Node_Id; Body_To_Analyze : Node_Id; Max_Size : constant := 10; @@ -1388,7 +1389,12 @@ package body Inline is Append (Body_To_Analyze, Declarations (N)); end if; + -- The body to inline is pre-analyzed. In GNATprove mode we must + -- disable full analysis as well so that light expansion does not + -- take place either, and name resolution is unaffected. + Expander_Mode_Save_And_Set (False); + Full_Analysis := False; Remove_Pragmas; Analyze (Body_To_Analyze); @@ -1398,6 +1404,7 @@ package body Inline is Remove (Body_To_Analyze); Expander_Mode_Restore; + Full_Analysis := Analysis_Status; -- Restore environment if previously saved |