aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-04-12 14:58:01 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-04-12 14:58:01 +0200
commit7f18b29a17b0905afb33ab3c0617fc587b766f97 (patch)
tree6db6862ab6efa3907d870a62cf3e6efc4c96409e /gcc/ada/sem.adb
parent0c68c6135fcd6bf0b97fc801b1d0ddc606275651 (diff)
downloadgcc-7f18b29a17b0905afb33ab3c0617fc587b766f97.zip
gcc-7f18b29a17b0905afb33ab3c0617fc587b766f97.tar.gz
gcc-7f18b29a17b0905afb33ab3c0617fc587b766f97.tar.bz2
[multiple changes]
2013-04-12 Robert Dewar <dewar@adacore.com> * opt.ads (Style_Check_Main): New switch. * sem.adb (Semantics): Set Style_Check flag properly for new unit to be analyzed. * sem_ch10.adb (Analyze_With_Clause): Don't reset Style_Check, the proper setting of this flag is now part of the Semantics procedure. * switch-c.adb (Scan_Front_End_Switches): Set Style_Check_Main for -gnatg and -gnaty 2013-04-12 Doug Rupp <rupp@adacore.com> * s-crtl.ads (fopen, freopen): Add vms_form parameter * i-cstrea.ads (fopen, freopen): Likewise. * adaint.h (__gnat_fopen, __gnat_freopen): Likewise. * adaint.c (__gnat_fopen, __gnat_freopen): Likewise. [VMS]: Split out RMS keys and call CRTL function appropriately. * s-fileio.adb (Form_VMS_RMS_Keys, Form_RMS_Context_Key): New subprograms. (Open, Reset): Call Form_VMS_RMS_Keys. Call fopen,freopen with vms_form * gnat_rm.texi: Document implemented RMS keys. From-SVN: r197902
Diffstat (limited to 'gcc/ada/sem.adb')
-rw-r--r--gcc/ada/sem.adb27
1 files changed, 23 insertions, 4 deletions
diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb
index a81597a..d3ec497 100644
--- a/gcc/ada/sem.adb
+++ b/gcc/ada/sem.adb
@@ -1311,6 +1311,7 @@ package body Sem is
S_In_Spec_Expr : constant Boolean := In_Spec_Expression;
S_Inside_A_Generic : constant Boolean := Inside_A_Generic;
S_Outer_Gen_Scope : constant Entity_Id := Outer_Generic_Scope;
+ S_Style_Check : constant Boolean := Style_Check;
Generic_Main : constant Boolean :=
Nkind (Unit (Cunit (Main_Unit)))
@@ -1318,6 +1319,10 @@ package body Sem is
-- If the main unit is generic, every compiled unit, including its
-- context, is compiled with expansion disabled.
+ Ext_Main_Source_Unit : constant Boolean :=
+ In_Extended_Main_Source_Unit (Comp_Unit);
+ -- Determine if unit is in extended main source unit
+
Save_Config_Switches : Config_Switches_Type;
-- Variable used to save values of config switches while we analyze the
-- new unit, to be restored on exit for proper recursive behavior.
@@ -1386,9 +1391,6 @@ package body Sem is
-- Sequential_IO) as this would prevent pragma Extend_System from being
-- taken into account, for example when Text_IO is renaming DEC.Text_IO.
- -- Cleaner might be to do the kludge at the point of excluding the
- -- pragma (do not exclude for renamings ???)
-
if Is_Predefined_File_Name
(Unit_File_Name (Current_Sem_Unit), Renamings_Included => False)
then
@@ -1423,12 +1425,28 @@ package body Sem is
-- For unit in main extended unit, we reset the configuration values
-- for the non-partition-wide restrictions. For other units reset them.
- if In_Extended_Main_Source_Unit (Comp_Unit) then
+ if Ext_Main_Source_Unit then
Restore_Config_Cunit_Boolean_Restrictions;
else
Reset_Cunit_Boolean_Restrictions;
end if;
+ -- Turn off style checks for unit that is not in the extended main
+ -- source unit. This improves processing efficiency for such units
+ -- (for which we don't want style checks anyway, and where they will
+ -- get suppressed), and is definitely needed to stop some style checks
+ -- from invading the run-time units (e.g. overriding checks).
+
+ if not Ext_Main_Source_Unit then
+ Style_Check := False;
+
+ -- If this is part of the extended main source unit, set style check
+ -- mode to match the style check mode of the main source unit itself.
+
+ else
+ Style_Check := Style_Check_Main;
+ end if;
+
-- Only do analysis of unit that has not already been analyzed
if not Analyzed (Comp_Unit) then
@@ -1482,6 +1500,7 @@ package body Sem is
In_Spec_Expression := S_In_Spec_Expr;
Inside_A_Generic := S_Inside_A_Generic;
Outer_Generic_Scope := S_Outer_Gen_Scope;
+ Style_Check := S_Style_Check;
Restore_Opt_Config_Switches (Save_Config_Switches);