+2010-06-18 Thomas Quinot <quinot@adacore.com>
+
+ * types.ads: Clean up obsolete comments
+ * tbuild.adb: Minor reformatting.
+ * exp_ch5.adb, sem_intr.adb, sem_ch10.adb, rtsfind.adb, s-shasto.adb,
+ exp_strm.adb, aa_drive.adb: Minor reformatting.
+ * sem_res.adb (Is_Predefined_Operator): An operator that is an imported
+ intrinsic with an Interface_Name denotes an imported back-end builtin,
+ and must be rewritten into a call, not left in the tree as an operator,
+ so return False in that case.
+
+2010-06-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * exp_util.adb (Remove_Side_Effects): Make a copy for an allocator.
+
+2010-06-18 Robert Dewar <dewar@adacore.com>
+
+ * scos.ads: Add proposed output for case expression
+
+2010-06-18 Jose Ruiz <ruiz@adacore.com>
+
+ * gnat_ugn.texi: Document that, when using the RTX compiler to generate
+ RTSS modules, we need to use the Microsoft linker.
+
2010-06-18 Robert Dewar <dewar@adacore.com>
* checks.adb (Safe_To_Capture_In_Parameter_Value): Deal with case
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- 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- --
end;
end if;
- -- If we are returning an object that may not be bit-aligned, then
- -- copy the value into a temporary first. This copy may need to expand
- -- to a loop of component operations..
+ -- If we are returning an object that may not be bit-aligned, then copy
+ -- the value into a temporary first. This copy may need to expand to a
+ -- loop of component operations.
if Is_Possibly_Unaligned_Slice (Exp)
or else Is_Possibly_Unaligned_Object (Exp)
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- 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- --
-- If the enclosing record is an unchecked_union, we use the
-- default expressions for the discriminant (it must exist)
-- because we cannot generate a reference to it, given that
- -- it is not stored..
+ -- it is not stored.
if Is_Unchecked_Union (Scope (Entity (Name (VP)))) then
D_Ref :=
Scope_Suppress := (others => True);
-- If it is a scalar type and we need to capture the value, just make
- -- a copy. Likewise for a function call, an attribute reference or an
- -- operator. And if we have a volatile reference and Name_Req is not
- -- set (see comments above for Side_Effect_Free).
+ -- a copy. Likewise for a function call, an attribute reference, an
+ -- allocator or an operator. And if we have a volatile reference and
+ -- Name_Req is not set (see comments above for Side_Effect_Free).
if Is_Elementary_Type (Exp_Type)
and then (Variable_Ref
or else Nkind (Exp) = N_Function_Call
or else Nkind (Exp) = N_Attribute_Reference
+ or else Nkind (Exp) = N_Allocator
or else Nkind (Exp) in N_Op
or else (not Name_Req and then Is_Volatile_Reference (Exp)))
then
@item
Real-time subsystem (RTSS) executables that run in Ring 0, where
performance can be optimized with RTSS applications taking precedent
-over all Windows applications (@emph{rts-rtx-rtss}).
+over all Windows applications (@emph{rts-rtx-rtss}). This mode requires
+the Microsoft linker to handle RTSS libraries.
@end itemize
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- 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- --
-- The RT_Unit_Table entry that may need updating
begin
- -- If entry is not set, set it now, and indicate that it
- -- was loaded through an explicit context clause..
+ -- If entry is not set, set it now, and indicate that it was
+ -- loaded through an explicit context clause.
if No (U.Entity) then
U := (Entity => E,
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
--- --
+-- Copyright (C) 1998-2010, Free Software Foundation, Inc. --
+-- --
-- 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
Item : AS.Stream_Element_Array);
subtype Hash_Header is Natural range 0 .. 30;
- -- Number of hash headers, related (for efficiency purposes only)
- -- to the maximum number of lock files..
+ -- Number of hash headers, related (for efficiency purposes only) to the
+ -- maximum number of lock files.
type Shared_Var_File_Entry;
type Shared_Var_File_Entry_Ptr is access Shared_Var_File_Entry;
-- --
-- S p e c --
-- --
--- Copyright (C) 2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2009-2010, Free Software Foundation, Inc. --
-- --
-- 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- --
-- and is omitted for all other cases.
- -- Note: up to 6 entries can appear on a single CS line. If more than 6
- -- entries appear in one logical statement sequence, continuation lines are
- -- marked by Cs and appear immediately after the CS line they continue.
+ -- Note: up to 6 entries can appear on a single CS line. If more than 6
+ -- entries appear in one logical statement sequence, continuation lines
+ -- are marked by Cs and appear immediately after the CS line.
-- Decisions
-- enclosing statement. The SCO line for a nested decision always occurs
-- after the line for the enclosing decision.
+ -- Case Expressions
+
+ -- For case statements, we rely on statement coverage to make sure that
+ -- all branches of a case statement are covered, but that does not work
+ -- for case expressions, since the entire expression is contained in a
+ -- single statement. However, for complete coverage we really should be
+ -- able to check that every branch of the case statement is covered, so
+ -- we generate a SCO of the form:
+
+ -- CC sloc-range sloc-range ...
+
+ -- where sloc-range covers the range of the case expression.
+
+ -- Note: up to 6 entries can appear on a single CC line. If more than 6
+ -- entries appear in one logical statement sequence, continuation lines
+ -- are marked by Cc and appear immediately after the CC line.
+
---------------------------------------------------------------------
-- Internal table used to store Source Coverage Obligations (SCOs) --
---------------------------------------------------------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- 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- --
or else
Used_In_Spec)
then
- Error_Msg_N ("?redundant with clause in body", Clause);
+ Error_Msg_N -- CODEFIX
+ ("?redundant with clause in body", Clause);
end if;
Used_In_Body := False;
Exit_On_Self => True);
if Withed then
- Error_Msg_N ("?redundant with clause", Clause);
+ Error_Msg_N -- CODEFIX
+ ("?redundant with clause", Clause);
end if;
end;
end if;
end if;
if Circularity then
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("circular dependency caused by with_clauses", N);
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("\possibly missing limited_with clause"
& " in one of the following", N);
Unit_Name)
then
Error_Msg_Sloc := Sloc (It);
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("simultaneous visibility of limited "
& "and unlimited views not allowed",
Item);
- Error_Msg_NE
+ Error_Msg_NE -- CODEFIX???
("\unlimited view visible through "
& "context clause #",
Item, It);
if No (Nam)
or else not Is_Protected_Type (Etype (Nam))
then
- Error_Msg_N ("missing specification for Protected body", N);
+ Error_Msg_N -- CODEFIX???
+ ("missing specification for Protected body", N);
else
Set_Scope (Defining_Entity (N), Current_Scope);
Set_Has_Completion (Etype (Nam));
end if;
if No (Nam) or else not Is_Task_Type (Etype (Nam)) then
- Error_Msg_N ("missing specification for task body", N);
+ Error_Msg_N -- CODEFIX???
+ ("missing specification for task body", N);
else
Set_Scope (Defining_Entity (N), Current_Scope);
Generate_Reference (Nam, Defining_Identifier (N), 'b');
begin
if U_Kind = Implementation_Unit then
- Error_Msg_F ("& is an internal 'G'N'A'T unit?", Name (N));
+ Error_Msg_F -- CODEFIX???
+ ("& is an internal 'G'N'A'T unit?", Name (N));
-- Add alternative name if available, otherwise issue a
-- general warning message.
if Error_Msg_Strlen /= 0 then
- Error_Msg_F ("\use ""~"" instead", Name (N));
+ Error_Msg_F -- CODEFIX???
+ ("\use ""~"" instead", Name (N));
else
Error_Msg_F
("\use of this unit is non-portable " &
end loop;
if E2 = WEnt then
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("unlimited view visible through use clause ", W);
return;
end if;
N_Generic_Package_Declaration)
and then Nkind (Lib_Unit) not in N_Generic_Renaming_Declaration
then
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("child of a generic package must be a generic unit", Lib_Unit);
elsif not Is_Package_Or_Generic_Package (P_Name) then
-- installed.
if Kind = N_Package_Declaration then
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("simultaneous visibility of the limited and " &
"unlimited views not allowed", N);
Error_Msg_Sloc := Sloc (Item);
- Error_Msg_NE
+ Error_Msg_NE -- CODEFIX???
("\\ unlimited view of & visible through the " &
"context clause #", N, P);
Error_Msg_Sloc := Sloc (Decl);
if Nkind (Item) = N_With_Clause
and then Private_Present (Item)
then
- -- If private_with_clause is redundant, remove it from
- -- context, as a small optimization to subsequent handling
- -- of private_with clauses in other nested packages..
+ -- If private_with_clause is redundant, remove it from context,
+ -- as a small optimization to subsequent handling of private_with
+ -- clauses in other nested packages.
if In_Regular_With_Clause (Entity (Name (Item))) then
declare
-- returns type String.
procedure Check_Intrinsic_Operator (E : Entity_Id; N : Node_Id);
- -- Check that operator is one of the binary arithmetic operators, and
- -- that the types involved both have underlying integer types.
+ -- Check that operator is one of the binary arithmetic operators, and that
+ -- the types involved both have underlying integer types.
procedure Check_Shift (E : Entity_Id; N : Node_Id);
-- Check intrinsic shift subprogram, the two arguments are the same
-- declaration, and not an (anonymous) allocator type.
function Is_Predefined_Op (Nam : Entity_Id) return Boolean;
- -- Utility to check whether the name in the call is a predefined
- -- operator, in which case the call is made into an operator node.
- -- An instance of an intrinsic conversion operation may be given
- -- an operator name, but is not treated like an operator.
+ -- Utility to check whether the entity for an operator is a predefined
+ -- operator, in which case the expression is left as an operator in the
+ -- tree (else it is rewritten into a call). An instance of an intrinsic
+ -- conversion operation may be given an operator name, but is not treated
+ -- like an operator. Note that an operator that is an imported back-end
+ -- builtin has convention Intrinsic, but is expected to be rewritten into
+ -- a call, so such an operator is not treated as predefined by this
+ -- predicate.
procedure Replace_Actual_Discriminants (N : Node_Id; Default : Node_Id);
-- If a default expression in entry call N depends on the discriminants
procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id);
-- A call to a user-defined intrinsic operator is rewritten as a call
-- to the corresponding predefined operator, with suitable conversions.
+ -- Note that this applies only for intrinsic operators that denote
+ -- predefined operators, not opeartors that are intrinsic imports of
+ -- back-end builtins.
procedure Resolve_Intrinsic_Unary_Operator (N : Node_Id; Typ : Entity_Id);
-- Ditto, for unary operators (arithmetic ones and "not" on signed
function Is_Predefined_Op (Nam : Entity_Id) return Boolean is
begin
- return Is_Intrinsic_Subprogram (Nam)
- and then not Is_Generic_Instance (Nam)
+ -- Predefined operators are intrinsic subprograms
+
+ if not Is_Intrinsic_Subprogram (Nam) then
+ return False;
+ end if;
+
+ -- A call to a back-end builtin is never a predefined operator
+
+ if Is_Imported (Nam) and then Present (Interface_Name (Nam)) then
+ return False;
+ end if;
+
+ return not Is_Generic_Instance (Nam)
and then Chars (Nam) in Any_Operator_Name
- and then (No (Alias (Nam))
- or else Is_Predefined_Op (Alias (Nam)));
+ and then (No (Alias (Nam)) or else Is_Predefined_Op (Alias (Nam)));
end Is_Predefined_Op;
-----------------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- 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- --
-- We don't really need these shift operators, since they never
-- appear as operators in the source, but the path of least
- -- resistance is to put them in (the aggregate must be complete)
+ -- resistance is to put them in (the aggregate must be complete).
N_Op_Rotate_Left => Name_Rotate_Left,
N_Op_Rotate_Right => Name_Rotate_Right,
-- lie in. Such tests appear only in the lowest level packages.
subtype List_Range is Union_Id
- range List_Low_Bound .. List_High_Bound;
+ range List_Low_Bound .. List_High_Bound;
subtype Node_Range is Union_Id
- range Node_Low_Bound .. Node_High_Bound;
+ range Node_Low_Bound .. Node_High_Bound;
subtype Elist_Range is Union_Id
- range Elist_Low_Bound .. Elist_High_Bound;
+ range Elist_Low_Bound .. Elist_High_Bound;
subtype Elmt_Range is Union_Id
- range Elmt_Low_Bound .. Elmt_High_Bound;
+ range Elmt_Low_Bound .. Elmt_High_Bound;
subtype Names_Range is Union_Id
range Names_Low_Bound .. Names_High_Bound;
range Uint_Low_Bound .. Uint_High_Bound;
subtype Ureal_Range is Union_Id
- range Ureal_Low_Bound .. Ureal_High_Bound;
+ range Ureal_Low_Bound .. Ureal_High_Bound;
- ----------------------------
+ -----------------------------
-- Types for Atree Package --
- ----------------------------
+ -----------------------------
-- Node_Id values are used to identify nodes in the tree. They are
- -- subscripts into the Node table declared in package Tree. Note that
- -- the special values Empty and Error are subscripts into this table,
+ -- subscripts into the Nodes table declared in package Atree. Note that
+ -- the special values Empty and Error are subscripts into this table.
-- See package Atree for further details.
type Node_Id is range Node_Low_Bound .. Node_High_Bound;
-- Type used to identify nodes in the tree
subtype Entity_Id is Node_Id;
- -- A synonym for node types, used in the entity package to refer to nodes
- -- that are entities (i.e. nodes with an Nkind of N_Defining_xxx) All such
+ -- A synonym for node types, used in the Einfo package to refer to nodes
+ -- that are entities (i.e. nodes with an Nkind of N_Defining_xxx). All such
-- nodes are extended nodes and these are the only extended nodes, so that
-- in practice entity and extended nodes are synonymous.
Empty_List_Or_Node : constant := 0;
-- This constant is used in situations (e.g. initializing empty fields)
- -- where the value set will be used to represent either an empty node
- -- or a non-existent list, depending on the context.
+ -- where the value set will be used to represent either an empty node or
+ -- a non-existent list, depending on the context.
Error : constant Node_Id := Node_Low_Bound + 1;
- -- Used to indicate that there was an error in the source program. A node
- -- is actually allocated at this address, so that Nkind (Error) = N_Error.
+ -- Used to indicate an error in the source program. A node is actually
+ -- allocated with this Id value, so that Nkind (Error) = N_Error.
Empty_Or_Error : constant Node_Id := Error;
-- Since Empty and Error are the first two Node_Id values, the test for
-- Types for Nlists Package --
------------------------------
- -- List_Id values are used to identify node lists in the tree. They are
- -- subscripts into the Lists table declared in package Tree. Note that the
- -- special value Error_List is a subscript in this table, but the value
- -- No_List is *not* a valid subscript, and any attempt to apply list
- -- operations to No_List will cause a (detected) error.
+ -- List_Id values are used to identify node lists stored in the tree, so
+ -- that each node can be on at most one such list (see package Nlists for
+ -- further details). Note that the special value Error_List is a subscript
+ -- in this table, but the value No_List is *not* a valid subscript, and any
+ -- attempt to apply list operations to No_List will cause a (detected)
+ -- error.
type List_Id is range List_Low_Bound .. List_High_Bound;
-- Type used to identify a node list
-- Types for Elists Package --
------------------------------
- -- Element list Id values are used to identify element lists stored in the
- -- tree (see package Atree for further details). They are formed by adding
- -- a bias (Element_List_Bias) to subscript values in the same array that is
- -- used for node list headers.
+ -- Element list Id values are used to identify element lists stored outside
+ -- of the tree, allowing nodes to be members of more than one such list
+ -- (see package Elists for further details).
type Elist_Id is range Elist_Low_Bound .. Elist_High_Bound;
-- Type used to identify an element list (Elist header table subscript)
No_Elist : constant Elist_Id := Elist_Low_Bound;
- -- Used to indicate absence of an element list. Note that this is not
- -- an actual Elist header, so element list operations on this value
- -- are not valid.
+ -- Used to indicate absence of an element list. Note that this is not an
+ -- actual Elist header, so element list operations on this value are not
+ -- valid.
First_Elist_Id : constant Elist_Id := No_Elist + 1;
-- Subscript of first allocated Elist header
- -- Element Id values are used to identify individual elements of an
- -- element list (see package Elists for further details).
+ -- Element Id values are used to identify individual elements of an element
+ -- list (see package Elists for further details).
type Elmt_Id is range Elmt_Low_Bound .. Elmt_High_Bound;
-- Type used to identify an element list
-------------------------------
-- String_Id values are used to identify entries in the strings table. They
- -- are subscripts into the strings table defined in package Strings.
+ -- are subscripts into the Strings table defined in package Stringt.
-- Note that with only a few exceptions, which are clearly documented, the
-- type String_Id should be regarded as a private type. In particular it is
-- never appropriate to perform arithmetic operations using this type.
+ -- Doesn't this also apply to all other *_Id types???
type String_Id is range Strings_Low_Bound .. Strings_High_Bound;
-- Type used to identify entries in the strings table
type Unit_Number_Type is new Int;
-- Unit number. The main source is unit 0, and subsidiary sources have
-- non-zero numbers starting with 1. Unit numbers are used to index the
- -- file table in Lib.
+ -- Units table in package Lib.
Main_Unit : constant Unit_Number_Type := 0;
-- Unit number value for main unit