diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-04 13:27:57 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-04 13:27:57 +0000 |
commit | 61e77e4568a4510e54c4d17733a8ed29cd1ae77b (patch) | |
tree | 762cf5586088eb7449e204245ad71d64685bca32 /gcc/ada/sem_ch12.adb | |
parent | f6742bc085755096f16bd4f80d89b53e5508d0be (diff) | |
download | gcc-61e77e4568a4510e54c4d17733a8ed29cd1ae77b.tar.gz |
2010-10-04 Vincent Celier <celier@adacore.com>
* frontend.adb: Set Lib.Parsing_Main_Extended_Source to True before
loading the main source, so that if it is preprocessed and -gnateG is
used, the preprocessed file is written.
* lib.ads (Analysing_Subunit_Of_Main): New global variable to indicate
if a subunit is from the main unit when it is loaded.
* sem_ch10.adb (Analyze_Proper_Body): Set Lib.Analysing_Subunit_Of_Main
to True before loading a subunit.
* sem_ch12.adb (Copy_Generic_Node): Set Lib.Analysing_Subunit_Of_Main
to True when the main is a generic unit before loading one of its
subunits.
* sinput-l.adb (Load_File): If -gnateG is used, write the preprocessed
file only for the main unit (spec, body and subunits).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164934 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index b325ccbe89c..5f258f23d68 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -5906,12 +5906,19 @@ package body Sem_Ch12 is New_Body : Node_Id; begin + -- Make sure that, if it is a subunit of the main unit that is + -- preprocessed and if -gnateG is specified, the preprocessed + -- file will be written. + + Lib.Analysing_Subunit_Of_Main := + Lib.In_Extended_Main_Source_Unit (N); Unum := Load_Unit (Load_Name => Subunit_Name, Required => False, Subunit => True, Error_Node => N); + Lib.Analysing_Subunit_Of_Main := False; -- If the proper body is not found, a warning message will be -- emitted when analyzing the stub, or later at the point |