Commit 240fe2a4 by Arnaud Charlet

[multiple changes]

2009-07-22  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_aggr.adb (Gen_Loop): Do not qualify the bounds of the range if
	they are already of the base type of the index.

2009-07-22  Brett Porter  <porter@adacore.com>

	* sysdep.c, init.c: Fix typo: _SPE_ should have been __SPE__.

2009-07-22  Robert Dewar  <dewar@adacore.com>

	* vms_data.ads: Add entry for SCO_OUTPUT (-gnateS)
	* gnat_ugn.texi: Add documentation for -gnateS switch
	* ug_words: Add entry for -gnateS /SCO_OUTPUT
	* gcc-interface/Make-lang.in: Update dependenciest.3

	* get_scos.adb, get_scos.ads, gnat1drv.adb, par_sco.adb,
	par_sco.ads, put_scos.adb, put_scos.ads, scos.adb, scos.ads: Initial
	complete information for SCO input/output.

From-SVN: r149945
parent f7f0159d
2009-07-22 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Gen_Loop): Do not qualify the bounds of the range if
they are already of the base type of the index.
2009-07-22 Brett Porter <porter@adacore.com>
* sysdep.c, init.c: Fix typo: _SPE_ should have been __SPE__.
2009-07-22 Robert Dewar <dewar@adacore.com>
* vms_data.ads: Add entry for SCO_OUTPUT (-gnateS)
* gnat_ugn.texi: Add documentation for -gnateS switch
* ug_words: Add entry for -gnateS /SCO_OUTPUT
* gcc-interface/Make-lang.in: Update dependenciest.3
* get_scos.adb, get_scos.ads, gnat1drv.adb, par_sco.adb,
par_sco.ads, put_scos.adb, put_scos.ads, scos.adb, scos.ads: Initial
complete information for SCO input/output.
2009-07-22 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi: Update doc for some gnatcheck rules.
......
......@@ -1252,6 +1252,12 @@ package body Exp_Aggr is
function Gen_Loop (L, H : Node_Id; Expr : Node_Id) return List_Id is
L_J : Node_Id;
L_L : Node_Id;
-- Index_Base'(L)
L_H : Node_Id;
-- Index_Base'(H)
L_Range : Node_Id;
-- Index_Base'(L) .. Index_Base'(H)
......@@ -1330,19 +1336,32 @@ package body Exp_Aggr is
L_J := Make_Defining_Identifier (Loc, New_Internal_Name ('J'));
-- Construct "L .. H"
-- Construct "L .. H" in Index_Base. We use a qualified expression
-- for the bound to convert to the index base, but we don't need
-- to do that if we already have the base type at hand.
if Etype (L) = Index_Base then
L_L := L;
else
L_L :=
Make_Qualified_Expression (Loc,
Subtype_Mark => Index_Base_Name,
Expression => L);
end if;
if Etype (H) = Index_Base then
L_H := H;
else
L_H :=
Make_Qualified_Expression (Loc,
Subtype_Mark => Index_Base_Name,
Expression => H);
end if;
L_Range :=
Make_Range
(Loc,
Low_Bound => Make_Qualified_Expression
(Loc,
Subtype_Mark => Index_Base_Name,
Expression => L),
High_Bound => Make_Qualified_Expression
(Loc,
Subtype_Mark => Index_Base_Name,
Expression => H));
Make_Range (Loc,
Low_Bound => L_L,
High_Bound => L_H);
-- Construct "for L_J in Index_Base range L .. H"
......
......@@ -2295,30 +2295,30 @@ ada/gnat1drv.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
ada/erroutc.ads ada/exp_tss.ads ada/expander.ads ada/fmap.ads \
ada/fname.ads ada/fname-uf.ads ada/frontend.ads ada/get_targ.ads \
ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/gnat1drv.ads \
ada/gnat1drv.adb ada/gnatvsn.ads ada/hlo.ads ada/hostparm.ads \
ada/inline.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
ada/lib-load.ads ada/lib-sort.adb ada/lib-writ.ads ada/lib-xref.ads \
ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/opt.ads \
ada/osint.ads ada/output.ads ada/par_sco.ads ada/prepcomp.ads \
ada/repinfo.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_ch10.ads \
ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads \
ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_elim.ads \
ada/sem_eval.ads ada/sem_prag.ads ada/sem_type.ads ada/sem_util.ads \
ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
ada/sinput-l.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
ada/stringt.ads ada/stylesw.ads ada/system.ads ada/s-assert.ads \
ada/s-bitops.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
ada/targparm.ads ada/tree_gen.ads ada/tree_io.ads ada/treepr.ads \
ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/usage.ads \
ada/validsw.ads ada/widechar.ads
ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/g-table.ads \
ada/g-table.adb ada/gnat1drv.ads ada/gnat1drv.adb ada/gnatvsn.ads \
ada/hlo.ads ada/hostparm.ads ada/inline.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-writ.ads \
ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
ada/nmake.ads ada/opt.ads ada/osint.ads ada/output.ads ada/par_sco.ads \
ada/prepcomp.ads ada/repinfo.ads ada/restrict.ads ada/rident.ads \
ada/rtsfind.ads ada/scos.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads \
ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads \
ada/sem_ch2.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads \
ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.ads \
ada/sem_elim.ads ada/sem_eval.ads ada/sem_prag.ads ada/sem_type.ads \
ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
ada/sinput.adb ada/sinput-l.ads ada/snames.ads ada/sprint.ads \
ada/stand.ads ada/stringt.ads ada/stylesw.ads ada/system.ads \
ada/s-assert.ads ada/s-bitops.ads ada/s-exctab.ads ada/s-htable.ads \
ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
ada/table.adb ada/targparm.ads ada/tree_gen.ads ada/tree_io.ads \
ada/treepr.ads ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
ada/usage.ads ada/validsw.ads ada/widechar.ads
ada/gnatbind.o : ada/ada.ads ada/a-comlin.ads ada/a-clrefi.ads \
ada/a-except.ads ada/a-unccon.ads ada/a-uncdea.ads ada/ali.ads \
......
......@@ -149,11 +149,12 @@ procedure Get_SCOs is
begin
loop
Skipc;
C := Getc;
C := Nextc;
exit when C /= LF and then C /= CR;
if C = ' ' then
Skip_Spaces;
C := Nextc;
exit when C /= LF and then C /= CR;
end if;
end loop;
......@@ -173,8 +174,7 @@ procedure Get_SCOs is
-- Start of processing for Get_Scos
begin
SCO_Table.Init;
SCO_Unit_Table.Init;
SCOs.Initialize;
-- Loop through lines of SCO information
......@@ -276,7 +276,7 @@ begin
Cond := C;
Get_Sloc_Range (Loc1, Loc2);
Add_SCO
(C2 => C,
(C2 => Cond,
From => Loc1,
To => Loc2,
Last => False);
......@@ -288,9 +288,14 @@ begin
then
Add_SCO (C1 => C, Last => False);
elsif C = ' ' then
Skip_Spaces;
else
raise Data_Error;
end if;
C := Getc;
end loop;
-- Reset Last indication to True for last entry
......
......@@ -23,17 +23,17 @@
-- --
------------------------------------------------------------------------------
-- This package contains the function used to read SCO information from an
-- ALI file and populate the tables defined in package SCOs with the result.
-- This package contains the function used to read SCO information from an ALI
-- file and populate the tables defined in package SCOs with the result.
generic
-- These subprograms provide access to the ALI file. Locating, opening
-- and providing access to the ALI file is the callers' responsibility.
-- These subprograms provide access to the ALI file. Locating, opening and
-- providing access to the ALI file is the callers' responsibility.
with function Getc return Character is <>;
-- Get next character, positioning the ALI file ready to read the
-- following character (equivalent to calling Skipc, then Nextc). If
-- the end of file is encountered, the value Types.EOF is returned.
-- Get next character, positioning the ALI file ready to read the following
-- character (equivalent to calling Skipc, then Nextc). If the end of file
-- is encountered, the value Types.EOF is returned.
with function Nextc return Character is <>;
-- Look at the next character, and return it, leaving the position of the
......
......@@ -50,6 +50,7 @@ with Prepcomp;
with Repinfo; use Repinfo;
with Restrict;
with Rtsfind;
with SCOs;
with Sem;
with Sem_Ch8;
with Sem_Ch12;
......@@ -537,6 +538,7 @@ begin
Urealp.Initialize;
Errout.Initialize;
Namet.Initialize;
SCOs.Initialize;
Snames.Initialize;
Stringt.Initialize;
Inline.Initialize;
......
......@@ -4157,6 +4157,13 @@ Specify a preprocessing data file
@end ifclear
(@pxref{Integrated Preprocessing}).
@item -gnateS
@cindex @option{-gnateS} (@command{gcc})
Generate SCO (Source Coverage Obligation) information in the ALI
file. This information is used by advanced coverage tools. See
unit @file{SCOs} in the compiler sources for details in files
@file{scos.ads} and @file{scos.adb}.
@item -gnatE
@cindex @option{-gnatE} (@command{gcc})
Full dynamic elaboration checks.
......@@ -21013,6 +21020,7 @@ used as a parameter of the @option{+R} or @option{-R} options.
* Improperly_Called_Protected_Entries::
@end ignore
* Metrics::
* Misnamed_Controlling_Parameters::
* Misnamed_Identifiers::
* Multiple_Entries_In_Protected_Definitions::
* Name_Clashes::
......@@ -21798,6 +21806,25 @@ To turn OFF the check for cyclomatic complexity metric, use the following option
-RMetrics_Cyclomatic_Complexity
@end smallexample
@node Misnamed_Controlling_Parameters
@subsection @code{Misnamed_Controlling_Parameters}
@cindex @code{Misnamed_Controlling_Parameters} rule (for @command{gnatcheck})
@noindent
Flags a declaration of a dispatching operation, if the first parameter is
not a controlling one and its name is not @code{This} (the check for
parameter name is not case-sensitive). Declarations of dispatching functions
with controlling result and no controlling parameter are never flagged.
A subprogram body declaration, subprogram renaming declaration of subprogram
body stub is flagged only if it is not a completion of a pripr subprogram
declaration.
This rule has no parameters.
@node Misnamed_Identifiers
@subsection @code{Misnamed_Identifiers}
@cindex @code{Misnamed_Identifiers} rule (for @command{gnatcheck})
......@@ -1932,7 +1932,7 @@ __gnat_init_float (void)
overflow settings are an OS configuration issue. The instructions
below have no effect. */
#if defined (_ARCH_PPC) && !defined (_SOFT_FLOAT) && !defined (VTHREADS)
#if defined (_SPE_)
#if defined (__SPE__)
{
const unsigned long spefscr_mask = 0xfffffff3;
unsigned long spefscr;
......
......@@ -211,7 +211,12 @@ package Par_SCO is
-- unit U in the ALI file, as recorded by previous calls to SCO_Record,
-- possibly modified by calls to Set_SCO_Condition.
procedure dsco;
-- Debug routine to dump SCO table. This is a raw format dump showing
-- exactly what the tables contain.
procedure pscos;
-- Debugging procedure to output contents of SCO binary tables in SCOs
-- Debugging procedure to output contents of SCO binary tables in the
-- format in which they appear in an ALI file.
end Par_SCO;
......@@ -29,7 +29,7 @@ procedure Put_SCOs is
begin
-- Loop through entries in SCO_Unit_Table
for U in SCO_Unit_Table.First .. SCO_Unit_Table.Last loop
for U in 1 .. SCO_Unit_Table.Last loop
declare
SUT : SCO_Unit_Table_Entry renames SCO_Unit_Table.Table (U);
......@@ -50,16 +50,23 @@ begin
-- Loop through SCO entries for this unit
Start := SCO_Table.First;
Stop := SCO_Table.Last;
Start := SUT.From;
Stop := SUT.To;
loop
declare
exit when Start = Stop + 1;
pragma Assert (Start <= Stop);
Output_SCO_Line : declare
T : SCO_Table_Entry renames SCO_Table.Table (Start);
procedure Output_Range;
procedure Output_Range (T : SCO_Table_Entry);
-- Outputs T.From and T.To in line:col-line:col format
procedure Output_Range is
------------------
-- Output_Range --
------------------
procedure Output_Range (T : SCO_Table_Entry) is
begin
Write_Info_Nat (Nat (T.From.Line));
Write_Info_Char (':');
......@@ -70,6 +77,8 @@ begin
Write_Info_Nat (Nat (T.To.Col));
end Output_Range;
-- Start of processing for Output_SCO_Line
begin
Write_Info_Initiate ('C');
Write_Info_Char (T.C1);
......@@ -80,7 +89,7 @@ begin
when 'S' | 'T' =>
Write_Info_Char (' ');
Output_Range;
Output_Range (T);
-- Decision
......@@ -107,7 +116,7 @@ begin
else
Write_Info_Char (T.C2);
Output_Range;
Output_Range (T);
end if;
exit when T.Last;
......@@ -120,19 +129,10 @@ begin
end case;
Write_Info_Terminate;
end;
end Output_SCO_Line;
exit when Start = Stop;
Start := Start + 1;
pragma Assert (Start <= Stop);
end loop;
end;
-- If not last entry, blank line
if U /= SCO_Unit_Table.Last then
Write_Info_Terminate;
end if;
end loop;
end Put_SCOs;
......@@ -31,7 +31,10 @@
with Types; use Types;
generic
-- The following procedures are used to output text information
-- The following procedures are used to output text information. The
-- destination of the text information is thus under control of the
-- particular instantiation. In particular, this procedure is used to
-- write output to the ALI file, and also for debugging output.
with procedure Write_Info_Char (C : Character) is <>;
-- Outputs one character
......
......@@ -25,9 +25,13 @@
package body SCOs is
-------------
-- Add_SCO --
-------------
procedure Add_SCO
(From : Source_Location := No_Location;
To : Source_Location := No_Location;
(From : Source_Location := No_Source_Location;
To : Source_Location := No_Source_Location;
C1 : Character := ' ';
C2 : Character := ' ';
Last : Boolean := False)
......@@ -36,4 +40,18 @@ package body SCOs is
SCO_Table.Append ((From, To, C1, C2, Last));
end Add_SCO;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
SCO_Table.Init;
SCO_Unit_Table.Init;
-- Set dummy zeroth entry for sort routine, real entries start at 1
SCO_Unit_Table.Increment_Last;
end Initialize;
end SCOs;
......@@ -210,7 +210,7 @@ package SCOs is
Col : Column_Number;
end record;
No_Location : Source_Location := (No_Line_Number, No_Column_Number);
No_Source_Location : Source_Location := (No_Line_Number, No_Column_Number);
type SCO_Table_Entry is record
From : Source_Location;
......@@ -282,9 +282,8 @@ package SCOs is
-- This table keeps track of the units and the corresponding starting and
-- ending indexes (From, To) in the SCO table. Note that entry zero is
-- unused, it is for convenience in calling the sort routine. The Info
-- field is an identifier supplied when an entry is built (e.g. in the
-- compiler this is the Unit_Number_Type value.
-- unused, it is for convenience in calling the sort routine. Thus the
-- real lower bound for active entries is 1.
type SCO_Unit_Index is new Int;
-- Used to index values in this table. Values start at 1 and are assigned
......@@ -307,7 +306,7 @@ package SCOs is
package SCO_Unit_Table is new GNAT.Table (
Table_Component_Type => SCO_Unit_Table_Entry,
Table_Index_Type => SCO_Unit_Index,
Table_Low_Bound => 0,
Table_Low_Bound => 0, -- see note above on sorting
Table_Initial => 20,
Table_Increment => 200);
......@@ -315,9 +314,12 @@ package SCOs is
-- Subprograms --
-----------------
procedure Initialize;
-- Reset tables for a new compilation
procedure Add_SCO
(From : Source_Location := No_Location;
To : Source_Location := No_Location;
(From : Source_Location := No_Source_Location;
To : Source_Location := No_Source_Location;
C1 : Character := ' ';
C2 : Character := ' ';
Last : Boolean := False);
......
......@@ -954,7 +954,7 @@ __gnat_get_task_options (void)
/* Force VX_FP_TASK because it is almost always required */
options |= VX_FP_TASK;
#if defined (_SPE_)
#if defined (__SPE__)
options |= VX_SPE_TASK;
#endif
......
......@@ -66,6 +66,7 @@ gcc -c ^ GNAT COMPILE
-gnateG ^ /GENERATE_PROCESSED_SOURCE
-gnatem ^ /MAPPING_FILE
-gnatep ^ /DATA_PREPROCESSING
-gnateS ^ /SCO_OUTPUT
-gnatE ^ /CHECKS=ELABORATION
-gnatf ^ /REPORT_ERRORS=FULL
-gnatF ^ /UPPERCASE_EXTERNALS
......
......@@ -2183,6 +2183,16 @@ package VMS_Data is
--
-- Build against an alternate runtime system named xxx or RTS-xxx.
S_GCC_SCO : aliased constant S := "/SCO_OUTPUT " &
"-gnateS";
-- /NOSCO_OUTPUT (D)
-- /SCO_OUTPUT
--
-- Controls the output of SCO (Source Coverage Obligation) information
-- in the generated ALI file. This information is used by advanced source
-- coverage tools. For a full description of the SCO format, see unit
-- SCOs in the compiler sources (sco.ads/sco.adb).
S_GCC_Search : aliased constant S := "/SEARCH=*" &
"-I*";
-- /SEARCH=(directory[,...])
......@@ -3474,6 +3484,7 @@ package VMS_Data is
S_GCC_Repinfo 'Access,
S_GCC_RepinfX 'Access,
S_GCC_RTS 'Access,
S_GCC_SCO 'Access,
S_GCC_Search 'Access,
S_GCC_Style 'Access,
S_GCC_StyleX 'Access,
......
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