diff options
author | Robert Dewar <dewar@adacore.com> | 2005-09-05 09:56:02 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-09-05 09:56:02 +0200 |
commit | 6e18b0e511a2008299790a08da0a291c0bb4752f (patch) | |
tree | b5b30756f1f19c01bed62b9b9fef8126093e6cdb /gcc/ada/opt.adb | |
parent | 1b3b0f45a4a159b3c204749377e15b1b3dda0fab (diff) | |
download | gcc-6e18b0e511a2008299790a08da0a291c0bb4752f.zip gcc-6e18b0e511a2008299790a08da0a291c0bb4752f.tar.gz gcc-6e18b0e511a2008299790a08da0a291c0bb4752f.tar.bz2 |
opt.ads, opt.adb: Add new switches Debug_Pragmas_Enabled[_Config]
2005-09-01 Robert Dewar <dewar@adacore.com>
* opt.ads, opt.adb: Add new switches Debug_Pragmas_Enabled[_Config]
* par-prag.adb: Implement new pragma Debug_Policy
* sem_prag.adb Implement new pragma Debug_Policy
(Analyze_Pragma, case Pack): do not let pragma Pack override an explicit
Component_Size attribute specification. Give warning for ignored pragma
Pack.
* snames.h, snames.ads, snames.adb: Introduce entries in
Preset_Names for Name_Disp_Asynchronous_Select,
Name_Disp_Conditional_Select, Name_Disp_Get_Prim_Op_Kind,
Name_Disp_Timed_Select.
New pragma Debug_Policy
* switch-c.adb (Scan_Front_End_Switches): Set Ada 2005 mode
explicitly.
Switch -gnata also sets Debug_Pragmas_Enabled
* sem.adb, par.adb (Set_Opt_Config_Switch): Add parameter Main_Unit to
handle an explicit -gnata when compiling predefined files.
From-SVN: r103873
Diffstat (limited to 'gcc/ada/opt.adb')
-rw-r--r-- | gcc/ada/opt.adb | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/gcc/ada/opt.adb b/gcc/ada/opt.adb index 3fba785..576c0d8 100644 --- a/gcc/ada/opt.adb +++ b/gcc/ada/opt.adb @@ -31,7 +31,6 @@ -- -- ------------------------------------------------------------------------------ -with Gnatvsn; use Gnatvsn; with System; use System; with Tree_IO; use Tree_IO; @@ -52,6 +51,7 @@ package body Opt is Ada_Version_Config := Ada_Version; Ada_Version_Explicit_Config := Ada_Version_Explicit; Assertions_Enabled_Config := Assertions_Enabled; + Debug_Pragmas_Enabled_Config := Debug_Pragmas_Enabled; Dynamic_Elaboration_Checks_Config := Dynamic_Elaboration_Checks; Exception_Locations_Suppressed_Config := Exception_Locations_Suppressed; Extensions_Allowed_Config := Extensions_Allowed; @@ -71,6 +71,7 @@ package body Opt is Ada_Version := Save.Ada_Version; Ada_Version_Explicit := Save.Ada_Version_Explicit; Assertions_Enabled := Save.Assertions_Enabled; + Debug_Pragmas_Enabled := Save.Debug_Pragmas_Enabled; Dynamic_Elaboration_Checks := Save.Dynamic_Elaboration_Checks; Exception_Locations_Suppressed := Save.Exception_Locations_Suppressed; Extensions_Allowed := Save.Extensions_Allowed; @@ -90,6 +91,7 @@ package body Opt is Save.Ada_Version := Ada_Version; Save.Ada_Version_Explicit := Ada_Version_Explicit; Save.Assertions_Enabled := Assertions_Enabled; + Save.Debug_Pragmas_Enabled := Debug_Pragmas_Enabled; Save.Dynamic_Elaboration_Checks := Dynamic_Elaboration_Checks; Save.Exception_Locations_Suppressed := Exception_Locations_Suppressed; Save.Extensions_Allowed := Extensions_Allowed; @@ -104,11 +106,15 @@ package body Opt is -- Set_Opt_Config_Switches -- ----------------------------- - procedure Set_Opt_Config_Switches (Internal_Unit : Boolean) is + procedure Set_Opt_Config_Switches + (Internal_Unit : Boolean; + Main_Unit : Boolean) + is begin + -- Case of internal unit + if Internal_Unit then Ada_Version := Ada_Version_Runtime; - Assertions_Enabled := False; Dynamic_Elaboration_Checks := False; Extensions_Allowed := True; External_Name_Exp_Casing := As_Is; @@ -116,9 +122,23 @@ package body Opt is Persistent_BSS_Mode := False; Use_VADS_Size := False; + -- For an internal unit, assertions/debug pragmas are off unless this + -- is the main unit and they were explicitly enabled. + + if Main_Unit then + Assertions_Enabled := Assertions_Enabled_Config; + Debug_Pragmas_Enabled := Debug_Pragmas_Enabled_Config; + else + Assertions_Enabled := False; + Debug_Pragmas_Enabled := False; + end if; + + -- Case of non-internal unit + else Ada_Version := Ada_Version_Config; Assertions_Enabled := Assertions_Enabled_Config; + Debug_Pragmas_Enabled := Debug_Pragmas_Enabled_Config; Dynamic_Elaboration_Checks := Dynamic_Elaboration_Checks_Config; Extensions_Allowed := Extensions_Allowed_Config; External_Name_Exp_Casing := External_Name_Exp_Casing_Config; @@ -158,6 +178,7 @@ package body Opt is Tree_Read_Int (Assertions_Enabled_Config_Val); Tree_Read_Bool (All_Errors_Mode); Tree_Read_Bool (Assertions_Enabled); + Tree_Read_Bool (Debug_Pragmas_Enabled); Tree_Read_Bool (Enable_Overflow_Checks); Tree_Read_Bool (Full_List); @@ -226,6 +247,7 @@ package body Opt is Tree_Write_Int (Boolean'Pos (Assertions_Enabled_Config)); Tree_Write_Bool (All_Errors_Mode); Tree_Write_Bool (Assertions_Enabled); + Tree_Write_Bool (Debug_Pragmas_Enabled); Tree_Write_Bool (Enable_Overflow_Checks); Tree_Write_Bool (Full_List); Tree_Write_Int (Int (Version_String'Length)); |