aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-writ.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-07-12 12:49:10 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-07-12 12:49:10 +0200
commit727e7b1a870bdc057c4cb6d7d09ef1b56a84f222 (patch)
tree9754099aee8625dc123639e1fe1bb60689179ee3 /gcc/ada/lib-writ.adb
parent03459f403ea66cc694767e8ca351cf6550e148a7 (diff)
downloadgcc-727e7b1a870bdc057c4cb6d7d09ef1b56a84f222.zip
gcc-727e7b1a870bdc057c4cb6d7d09ef1b56a84f222.tar.gz
gcc-727e7b1a870bdc057c4cb6d7d09ef1b56a84f222.tar.bz2
[multiple changes]
2012-07-12 Robert Dewar <dewar@adacore.com> * s-atopri.adb, s-atopri.ads: Minor reformatting. 2012-07-12 Robert Dewar <dewar@adacore.com> * ali.adb: Add circuitry to read new named form of restrictions lines. * debug.adb: Add doc for new -gnatd.R switch (used positional notation for output of restrictions data in ali file). * lib-writ.adb: Implement new named format for restrictions lines. * lib-writ.ads: Add documentation for new named format for restrictions in ali files. * restrict.adb, restrict.ads, sem_prag.adb: Update comments. * rident.ads: Go back to withing System.Rident * s-rident.ads: Add extensive comment on dealing with consistency checking. 2012-07-12 Thomas Quinot <quinot@adacore.com> * par_sco.adb, scos.ads: Emit detailed SCOs for SELECT statements. From-SVN: r189438
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r--gcc/ada/lib-writ.adb151
1 files changed, 114 insertions, 37 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index 29b435a..1c55a06 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -26,6 +26,7 @@
with ALI; use ALI;
with Atree; use Atree;
with Casing; use Casing;
+with Debug; use Debug;
with Einfo; use Einfo;
with Errout; use Errout;
with Fname; use Fname;
@@ -1140,52 +1141,128 @@ package body Lib.Writ is
end if;
end loop;
- -- Output first restrictions line
+ -- Positional case (only if debug flag -gnatd.R is set)
- Write_Info_Initiate ('R');
- Write_Info_Char (' ');
+ if Debug_Flag_Dot_RR then
- -- First the information for the boolean restrictions
+ -- Output first restrictions line
- for R in All_Boolean_Restrictions loop
- if Main_Restrictions.Set (R)
- and then not Restriction_Warnings (R)
- then
- Write_Info_Char ('r');
- elsif Main_Restrictions.Violated (R) then
- Write_Info_Char ('v');
- else
- Write_Info_Char ('n');
- end if;
- end loop;
+ Write_Info_Initiate ('R');
+ Write_Info_Char (' ');
- -- And now the information for the parameter restrictions
+ -- First the information for the boolean restrictions
- for RP in All_Parameter_Restrictions loop
- if Main_Restrictions.Set (RP)
- and then not Restriction_Warnings (RP)
- then
- Write_Info_Char ('r');
- Write_Info_Nat (Nat (Main_Restrictions.Value (RP)));
- else
- Write_Info_Char ('n');
- end if;
+ for R in All_Boolean_Restrictions loop
+ if Main_Restrictions.Set (R)
+ and then not Restriction_Warnings (R)
+ then
+ Write_Info_Char ('r');
+ elsif Main_Restrictions.Violated (R) then
+ Write_Info_Char ('v');
+ else
+ Write_Info_Char ('n');
+ end if;
+ end loop;
- if not Main_Restrictions.Violated (RP)
- or else RP not in Checked_Parameter_Restrictions
- then
- Write_Info_Char ('n');
- else
- Write_Info_Char ('v');
- Write_Info_Nat (Nat (Main_Restrictions.Count (RP)));
+ -- And now the information for the parameter restrictions
+
+ for RP in All_Parameter_Restrictions loop
+ if Main_Restrictions.Set (RP)
+ and then not Restriction_Warnings (RP)
+ then
+ Write_Info_Char ('r');
+ Write_Info_Nat (Nat (Main_Restrictions.Value (RP)));
+ else
+ Write_Info_Char ('n');
+ end if;
+
+ if not Main_Restrictions.Violated (RP)
+ or else RP not in Checked_Parameter_Restrictions
+ then
+ Write_Info_Char ('n');
+ else
+ Write_Info_Char ('v');
+ Write_Info_Nat (Nat (Main_Restrictions.Count (RP)));
- if Main_Restrictions.Unknown (RP) then
- Write_Info_Char ('+');
+ if Main_Restrictions.Unknown (RP) then
+ Write_Info_Char ('+');
+ end if;
end if;
- end if;
- end loop;
+ end loop;
- Write_Info_EOL;
+ Write_Info_EOL;
+
+ -- Named case (if debug flag -gnatd.R is not set)
+
+ else
+ declare
+ C : Character;
+
+ begin
+ -- Write RN header line with preceding blank line
+
+ Write_Info_EOL;
+ Write_Info_Initiate ('R');
+ Write_Info_Char ('N');
+ Write_Info_EOL;
+
+ -- First the lines for the boolean restrictions
+
+ for R in All_Boolean_Restrictions loop
+ if Main_Restrictions.Set (R)
+ and then not Restriction_Warnings (R)
+ then
+ C := 'R';
+ elsif Main_Restrictions.Violated (R) then
+ C := 'V';
+ else
+ goto Continue;
+ end if;
+
+ Write_Info_Initiate ('R');
+ Write_Info_Char (C);
+ Write_Info_Char (' ');
+ Write_Info_Str (All_Boolean_Restrictions'Image (R));
+ Write_Info_EOL;
+
+ <<Continue>>
+ null;
+ end loop;
+ end;
+
+ -- And now the lines for the parameter restrictions
+
+ for RP in All_Parameter_Restrictions loop
+ if Main_Restrictions.Set (RP)
+ and then not Restriction_Warnings (RP)
+ then
+ Write_Info_Initiate ('R');
+ Write_Info_Str ("R ");
+ Write_Info_Str (All_Parameter_Restrictions'Image (RP));
+ Write_Info_Char ('=');
+ Write_Info_Nat (Nat (Main_Restrictions.Value (RP)));
+ Write_Info_EOL;
+ end if;
+
+ if not Main_Restrictions.Violated (RP)
+ or else RP not in Checked_Parameter_Restrictions
+ then
+ null;
+ else
+ Write_Info_Initiate ('R');
+ Write_Info_Str ("V ");
+ Write_Info_Str (All_Parameter_Restrictions'Image (RP));
+ Write_Info_Char ('=');
+ Write_Info_Nat (Nat (Main_Restrictions.Count (RP)));
+
+ if Main_Restrictions.Unknown (RP) then
+ Write_Info_Char ('+');
+ end if;
+
+ Write_Info_EOL;
+ end if;
+ end loop;
+ end if;
-- Output R lines for No_Dependence entries