summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_prag.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-06 08:26:27 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-06 08:26:27 +0000
commitfafc6b97000e420240e78934a1cad2b92a27dca8 (patch)
tree252d34fec92d6b22e8d4f8e3c7dedd6b4cf771ed /gcc/ada/sem_prag.adb
parent825c35988f4318028a74bf0ce1710e9a3d3d822a (diff)
downloadgcc-fafc6b97000e420240e78934a1cad2b92a27dca8.tar.gz
2012-08-06 Robert Dewar <dewar@adacore.com>
* exp_util.adb, switch-c.adb, inline.ads, sem_ch10.adb, types.ads, checks.adb, sem_prag.adb, sem.adb, sem.ads, sem_res.adb, sem_attr.adb, gnat1drv.adb, exp_ch4.adb, exp_ch6.adb, opt.ads, osint.adb: Implement extended overflow checks (step 1). (Overflow_Check_Type, Suppress_Record, Suppress_All): New types. (Suppress_Array): Extended to include switches to control extended overflow checking (and renamed to Suppress_Record). Update all uses of Suppress_Array. 2012-08-06 Thomas Quinot <quinot@adacore.com> * makeutl.ads: Minor documentation fix. 2012-08-06 Thomas Quinot <quinot@adacore.com> * exp_ch7.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190166 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r--gcc/ada/sem_prag.adb32
1 files changed, 19 insertions, 13 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 8a67b471d8d..4d377585e5f 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -5485,9 +5485,9 @@ package body Sem_Prag is
-- affected by this processing).
if R_Id = No_Exceptions and then not Warn then
- for J in Scope_Suppress'Range loop
+ for J in Scope_Suppress.Suppress'Range loop
if J /= Atomic_Synchronization then
- Scope_Suppress (J) := True;
+ Scope_Suppress.Suppress (J) := True;
end if;
end loop;
end if;
@@ -5641,9 +5641,7 @@ package body Sem_Prag is
-- user code: we want to generate checks for analysis purposes, as
-- set respectively by -gnatC and -gnatd.F
- if (CodePeer_Mode or Alfa_Mode)
- and then Comes_From_Source (N)
- then
+ if (CodePeer_Mode or Alfa_Mode) and then Comes_From_Source (N) then
return;
end if;
@@ -5666,10 +5664,17 @@ package body Sem_Prag is
("argument of pragma% is not valid check name", Arg1);
end if;
- if not Suppress_Case
- and then (C = All_Checks or else C = Overflow_Check)
- then
- Opt.Overflow_Checks_Unsuppressed := True;
+ -- Special processing for overflow check case
+
+ if C = All_Checks or else C = Overflow_Check then
+ if Suppress_Case then
+ Scope_Suppress.Overflow_Checks_General := Suppress;
+ Scope_Suppress.Overflow_Checks_Assertions := Suppress;
+ else
+ Scope_Suppress.Overflow_Checks_General := Check_All;
+ Scope_Suppress.Overflow_Checks_Assertions := Check_All;
+ Opt.Overflow_Checks_Unsuppressed := True;
+ end if;
end if;
if Arg_Count = 1 then
@@ -5687,11 +5692,12 @@ package body Sem_Prag is
-- Atomic_Synchronization is also not affected, since this is
-- not a real check.
- for J in Scope_Suppress'Range loop
+ for J in Scope_Suppress.Suppress'Range loop
if J /= Elaboration_Check
- and then J /= Atomic_Synchronization
+ and then
+ J /= Atomic_Synchronization
then
- Scope_Suppress (J) := Suppress_Case;
+ Scope_Suppress.Suppress (J) := Suppress_Case;
end if;
end loop;
@@ -5704,7 +5710,7 @@ package body Sem_Prag is
and then (not Comes_From_Source (N)
or else C /= Atomic_Synchronization)
then
- Scope_Suppress (C) := Suppress_Case;
+ Scope_Suppress.Suppress (C) := Suppress_Case;
end if;
-- Also make an entry in the Local_Entity_Suppress table