Commit c75c4293 by Arnaud Charlet

[multiple changes]

2009-04-09  Vincent Celier  <celier@adacore.com>

	* errout.adb: Remove dependency on package Style

	* style.ads, styleg.adb, styleg.ads (RM_Column_Check): Remove function,
	moved to Stylesw.
	
	* stylesw.ads, stylesw.adb (RM_Column_Check): New function, moved from
	Styleg.

	* errutil.adb, par.adb: Import Stylesw

2009-04-09  Arnaud Charlet  <charlet@adacore.com>

	* opt.ads: Fix typos.

2009-04-09  Robert Dewar  <dewar@adacore.com>

	* einfo.adb: Minor reformatting

From-SVN: r145832
parent e7aea0fa
2009-04-09 Vincent Celier <celier@adacore.com>
* errout.adb: Remove dependency on package Style
* style.ads, styleg.adb, styleg.ads (RM_Column_Check): Remove function,
moved to Stylesw.
* stylesw.ads, stylesw.adb (RM_Column_Check): New function, moved from
Styleg.
* errutil.adb, par.adb: Import Stylesw
2009-04-09 Arnaud Charlet <charlet@adacore.com>
* opt.ads: Fix typos.
2009-04-09 Robert Dewar <dewar@adacore.com>
* einfo.adb: Minor reformatting
2009-04-09 Robert Dewar <dewar@adacore.com> 2009-04-09 Robert Dewar <dewar@adacore.com>
* gcc-interface/Make-lang.in, style.ads, style.adb: Reorganize style * gcc-interface/Make-lang.in, style.ads, style.adb: Reorganize style
...@@ -52,11 +52,11 @@ package body Einfo is ...@@ -52,11 +52,11 @@ package body Einfo is
---------------------------------------------- ----------------------------------------------
-- Four of these fields are defined in Sinfo, since they in are the -- Four of these fields are defined in Sinfo, since they in are the
-- base part of the node. The access routines for these fields and -- base part of the node. The access routines for these fields and the
-- the corresponding set procedures are defined in Sinfo. These fields -- corresponding set procedures are defined in Sinfo. These fields are
-- are present in all entities. Note that Homonym is also in the base -- present in all entities. Note that Homonym is also in the base part of
-- part of the node, but has access routines that are more properly -- the node, but has access routines that are more properly part of Einfo,
-- part of Einfo, which is why they are defined here. -- which is why they are defined here.
-- Chars Name1 -- Chars Name1
-- Next_Entity Node2 -- Next_Entity Node2
......
...@@ -47,7 +47,7 @@ with Sinput; use Sinput; ...@@ -47,7 +47,7 @@ with Sinput; use Sinput;
with Sinfo; use Sinfo; with Sinfo; use Sinfo;
with Snames; use Snames; with Snames; use Snames;
with Stand; use Stand; with Stand; use Stand;
with Style; with Stylesw; use Stylesw;
with Uname; use Uname; with Uname; use Uname;
package body Errout is package body Errout is
...@@ -2138,7 +2138,7 @@ package body Errout is ...@@ -2138,7 +2138,7 @@ package body Errout is
procedure Set_Msg_Insertion_Column is procedure Set_Msg_Insertion_Column is
begin begin
if Style.RM_Column_Check then if RM_Column_Check then
Set_Msg_Str (" in column "); Set_Msg_Str (" in column ");
Set_Msg_Int (Int (Error_Msg_Col) + 1); Set_Msg_Int (Int (Error_Msg_Col) + 1);
end if; end if;
......
...@@ -30,6 +30,7 @@ with Opt; use Opt; ...@@ -30,6 +30,7 @@ with Opt; use Opt;
with Output; use Output; with Output; use Output;
with Scans; use Scans; with Scans; use Scans;
with Sinput; use Sinput; with Sinput; use Sinput;
with Stylesw; use Stylesw;
package body Errutil is package body Errutil is
...@@ -658,7 +659,7 @@ package body Errutil is ...@@ -658,7 +659,7 @@ package body Errutil is
procedure Set_Msg_Insertion_Column is procedure Set_Msg_Insertion_Column is
begin begin
if Style.RM_Column_Check then if RM_Column_Check then
Set_Msg_Str (" in column "); Set_Msg_Str (" in column ");
Set_Msg_Int (Int (Error_Msg_Col) + 1); Set_Msg_Int (Int (Error_Msg_Col) + 1);
end if; end if;
......
...@@ -1430,8 +1430,8 @@ package Opt is ...@@ -1430,8 +1430,8 @@ package Opt is
Assume_No_Invalid_Values_Config : Boolean; Assume_No_Invalid_Values_Config : Boolean;
-- GNAT -- GNAT
-- This is the value of the configuration switch for assuming no invalid -- This is the value of the configuration switch for assuming "no invalid
-- values enabled mode mode, as possibly set by the command line switch -- values enabled" mode, as possibly set by the command line switch
-- -gnatB, and possibly modified by the use of the configuration pragma -- -gnatB, and possibly modified by the use of the configuration pragma
-- Assume_No_Invalid_Values. -- Assume_No_Invalid_Values.
......
...@@ -1104,7 +1104,7 @@ package body Ch5 is ...@@ -1104,7 +1104,7 @@ package body Ch5 is
procedure Check_If_Column is procedure Check_If_Column is
begin begin
if Style.RM_Column_Check and then Token_Is_At_Start_Of_Line if RM_Column_Check and then Token_Is_At_Start_Of_Line
and then Start_Column /= Scope.Table (Scope.Last).Ecol and then Start_Column /= Scope.Table (Scope.Last).Ecol
then then
Error_Msg_Col := Scope.Table (Scope.Last).Ecol; Error_Msg_Col := Scope.Table (Scope.Last).Ecol;
...@@ -2076,7 +2076,7 @@ package body Ch5 is ...@@ -2076,7 +2076,7 @@ package body Ch5 is
Error_Msg_Col := Scope.Table (Scope.Last).Ecol; Error_Msg_Col := Scope.Table (Scope.Last).Ecol;
if Style.RM_Column_Check if RM_Column_Check
and then Token_Is_At_Start_Of_Line and then Token_Is_At_Start_Of_Line
and then Start_Column /= Error_Msg_Col and then Start_Column /= Error_Msg_Col
then then
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -200,7 +200,7 @@ package body Ch7 is ...@@ -200,7 +200,7 @@ package body Ch7 is
if Token = Tok_Private then if Token = Tok_Private then
Error_Msg_Col := Scope.Table (Scope.Last).Ecol; Error_Msg_Col := Scope.Table (Scope.Last).Ecol;
if Style.RM_Column_Check then if RM_Column_Check then
if Token_Is_At_Start_Of_Line if Token_Is_At_Start_Of_Line
and then Start_Column /= Error_Msg_Col and then Start_Column /= Error_Msg_Col
then then
......
...@@ -1029,7 +1029,7 @@ package body Endh is ...@@ -1029,7 +1029,7 @@ package body Endh is
-- Right in this context means exactly right, or on the same -- Right in this context means exactly right, or on the same
-- line as the opener. -- line as the opener.
if Style.RM_Column_Check then if RM_Column_Check then
if End_Column /= Scope.Table (Scope.Last).Ecol if End_Column /= Scope.Table (Scope.Last).Ecol
and then Current_Line_Start > Scope.Table (Scope.Last).Sloc and then Current_Line_Start > Scope.Table (Scope.Last).Sloc
......
...@@ -158,7 +158,7 @@ package body Util is ...@@ -158,7 +158,7 @@ package body Util is
procedure Check_Bad_Layout is procedure Check_Bad_Layout is
begin begin
if Style.RM_Column_Check and then Token_Is_At_Start_Of_Line if RM_Column_Check and then Token_Is_At_Start_Of_Line
and then Start_Column <= Scope.Table (Scope.Last).Ecol and then Start_Column <= Scope.Table (Scope.Last).Ecol
then then
Error_Msg_BC ("(style) incorrect layout"); Error_Msg_BC ("(style) incorrect layout");
......
...@@ -42,6 +42,7 @@ with Sinput.L; use Sinput.L; ...@@ -42,6 +42,7 @@ with Sinput.L; use Sinput.L;
with Sinfo; use Sinfo; with Sinfo; use Sinfo;
with Snames; use Snames; with Snames; use Snames;
with Style; with Style;
with Stylesw; use Stylesw;
with Table; with Table;
with Tbuild; use Tbuild; with Tbuild; use Tbuild;
......
...@@ -210,10 +210,4 @@ package Style is ...@@ -210,10 +210,4 @@ package Style is
-- lower case letters. On entry Token_Ptr points to the keyword token. -- lower case letters. On entry Token_Ptr points to the keyword token.
-- This is not used for keywords appearing as attribute designators, -- This is not used for keywords appearing as attribute designators,
-- where instead Check_Attribute_Name (True) is called. -- where instead Check_Attribute_Name (True) is called.
function RM_Column_Check return Boolean
renames Style_Inst.RM_Column_Check;
-- Determines whether style checking is active and the RM column check
-- mode is set requiring checking of RM format layout.
end Style; end Style;
...@@ -1006,13 +1006,4 @@ package body Styleg is ...@@ -1006,13 +1006,4 @@ package body Styleg is
end if; end if;
end Require_Preceding_Space; end Require_Preceding_Space;
---------------------
-- RM_Column_Check --
---------------------
function RM_Column_Check return Boolean is
begin
return Style_Check and Style_Check_Layout;
end RM_Column_Check;
end Styleg; end Styleg;
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
-- to these subprograms are only made if Opt.Style_Check is set True. -- to these subprograms are only made if Opt.Style_Check is set True.
-- Styleg does not depends on the GNAT tree (Atree, Sinfo, ...). -- Styleg does not depends on the GNAT tree (Atree, Sinfo, ...).
-- For the compiler, there is also a child package Styleg.C that depends
-- on the GNAT tree.
with Types; use Types; with Types; use Types;
generic generic
...@@ -173,9 +170,4 @@ package Styleg is ...@@ -173,9 +170,4 @@ package Styleg is
-- This is not used for keywords appearing as attribute designators, -- This is not used for keywords appearing as attribute designators,
-- where instead Check_Attribute_Name (True) is called. -- where instead Check_Attribute_Name (True) is called.
function RM_Column_Check return Boolean;
pragma Inline (RM_Column_Check);
-- Determines whether style checking is active and the RM column check
-- mode is set requiring checking of RM format layout.
end Styleg; end Styleg;
...@@ -61,6 +61,15 @@ package body Stylesw is ...@@ -61,6 +61,15 @@ package body Stylesw is
Style_Check_Xtra_Parens := False; Style_Check_Xtra_Parens := False;
end Reset_Style_Check_Options; end Reset_Style_Check_Options;
---------------------
-- RM_Column_Check --
---------------------
function RM_Column_Check return Boolean is
begin
return Style_Check and Style_Check_Layout;
end RM_Column_Check;
------------------------------ ------------------------------
-- Save_Style_Check_Options -- -- Save_Style_Check_Options --
------------------------------ ------------------------------
......
...@@ -272,6 +272,10 @@ package Stylesw is ...@@ -272,6 +272,10 @@ package Stylesw is
-- Subprograms -- -- Subprograms --
----------------- -----------------
function RM_Column_Check return Boolean;
-- Determines whether style checking is active and the RM column check
-- mode is set requiring checking of RM format layout.
procedure Set_Default_Style_Check_Options; procedure Set_Default_Style_Check_Options;
-- This procedure is called to set the default style checking options in -- This procedure is called to set the default style checking options in
-- response to a -gnaty switch with no suboptions or from -gnatyy. -- response to a -gnaty switch with no suboptions or from -gnatyy.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment