[multiple changes]
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. From-SVN: r160974
This commit is contained in:
parent
19d846a008
commit
6a497607af
@ -1,3 +1,27 @@
|
|||||||
|
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>
|
2010-06-18 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
* checks.adb (Safe_To_Capture_In_Parameter_Value): Deal with case
|
* checks.adb (Safe_To_Capture_In_Parameter_Value): Deal with case
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
-- --
|
-- --
|
||||||
-- B o d y --
|
-- 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 --
|
-- 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- --
|
||||||
@ -4192,9 +4192,9 @@ package body Exp_Ch5 is
|
|||||||
end;
|
end;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- If we are returning an object that may not be bit-aligned, then
|
-- If we are returning an object that may not be bit-aligned, then copy
|
||||||
-- copy the value into a temporary first. This copy may need to expand
|
-- the value into a temporary first. This copy may need to expand to a
|
||||||
-- to a loop of component operations..
|
-- loop of component operations.
|
||||||
|
|
||||||
if Is_Possibly_Unaligned_Slice (Exp)
|
if Is_Possibly_Unaligned_Slice (Exp)
|
||||||
or else Is_Possibly_Unaligned_Object (Exp)
|
or else Is_Possibly_Unaligned_Object (Exp)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
-- --
|
-- --
|
||||||
-- B o d y --
|
-- 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 --
|
-- 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- --
|
||||||
@ -1396,7 +1396,7 @@ package body Exp_Strm is
|
|||||||
-- If the enclosing record is an unchecked_union, we use the
|
-- If the enclosing record is an unchecked_union, we use the
|
||||||
-- default expressions for the discriminant (it must exist)
|
-- default expressions for the discriminant (it must exist)
|
||||||
-- because we cannot generate a reference to it, given that
|
-- 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
|
if Is_Unchecked_Union (Scope (Entity (Name (VP)))) then
|
||||||
D_Ref :=
|
D_Ref :=
|
||||||
|
@ -4684,14 +4684,15 @@ package body Exp_Util is
|
|||||||
Scope_Suppress := (others => True);
|
Scope_Suppress := (others => True);
|
||||||
|
|
||||||
-- If it is a scalar type and we need to capture the value, just make
|
-- 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
|
-- a copy. Likewise for a function call, an attribute reference, an
|
||||||
-- operator. And if we have a volatile reference and Name_Req is not
|
-- allocator or an operator. And if we have a volatile reference and
|
||||||
-- set (see comments above for Side_Effect_Free).
|
-- Name_Req is not set (see comments above for Side_Effect_Free).
|
||||||
|
|
||||||
if Is_Elementary_Type (Exp_Type)
|
if Is_Elementary_Type (Exp_Type)
|
||||||
and then (Variable_Ref
|
and then (Variable_Ref
|
||||||
or else Nkind (Exp) = N_Function_Call
|
or else Nkind (Exp) = N_Function_Call
|
||||||
or else Nkind (Exp) = N_Attribute_Reference
|
or else Nkind (Exp) = N_Attribute_Reference
|
||||||
|
or else Nkind (Exp) = N_Allocator
|
||||||
or else Nkind (Exp) in N_Op
|
or else Nkind (Exp) in N_Op
|
||||||
or else (not Name_Req and then Is_Volatile_Reference (Exp)))
|
or else (not Name_Req and then Is_Volatile_Reference (Exp)))
|
||||||
then
|
then
|
||||||
|
@ -25555,7 +25555,8 @@ Windows executables that run in Ring 3 to utilize memory protection
|
|||||||
@item
|
@item
|
||||||
Real-time subsystem (RTSS) executables that run in Ring 0, where
|
Real-time subsystem (RTSS) executables that run in Ring 0, where
|
||||||
performance can be optimized with RTSS applications taking precedent
|
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
|
@end itemize
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
-- --
|
-- --
|
||||||
-- B o d y --
|
-- 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 --
|
-- 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- --
|
||||||
@ -1333,8 +1333,8 @@ package body Rtsfind is
|
|||||||
-- The RT_Unit_Table entry that may need updating
|
-- The RT_Unit_Table entry that may need updating
|
||||||
|
|
||||||
begin
|
begin
|
||||||
-- If entry is not set, set it now, and indicate that it
|
-- If entry is not set, set it now, and indicate that it was
|
||||||
-- was loaded through an explicit context clause..
|
-- loaded through an explicit context clause.
|
||||||
|
|
||||||
if No (U.Entity) then
|
if No (U.Entity) then
|
||||||
U := (Entity => E,
|
U := (Entity => E,
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
-- --
|
-- --
|
||||||
-- B o d y --
|
-- 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 --
|
-- 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- --
|
||||||
-- ware Foundation; either version 3, or (at your option) any later ver- --
|
-- ware Foundation; either version 3, or (at your option) any later ver- --
|
||||||
@ -88,8 +88,8 @@ package body System.Shared_Storage is
|
|||||||
Item : AS.Stream_Element_Array);
|
Item : AS.Stream_Element_Array);
|
||||||
|
|
||||||
subtype Hash_Header is Natural range 0 .. 30;
|
subtype Hash_Header is Natural range 0 .. 30;
|
||||||
-- Number of hash headers, related (for efficiency purposes only)
|
-- Number of hash headers, related (for efficiency purposes only) to the
|
||||||
-- to the maximum number of lock files..
|
-- maximum number of lock files.
|
||||||
|
|
||||||
type Shared_Var_File_Entry;
|
type Shared_Var_File_Entry;
|
||||||
type Shared_Var_File_Entry_Ptr is access Shared_Var_File_Entry;
|
type Shared_Var_File_Entry_Ptr is access Shared_Var_File_Entry;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
-- --
|
-- --
|
||||||
-- S p e c --
|
-- 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 --
|
-- 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- --
|
||||||
@ -161,9 +161,9 @@ package SCOs is
|
|||||||
|
|
||||||
-- and is omitted for all other cases.
|
-- and is omitted for all other cases.
|
||||||
|
|
||||||
-- Note: up to 6 entries can appear on a single CS line. If more than 6
|
-- 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
|
-- entries appear in one logical statement sequence, continuation lines
|
||||||
-- marked by Cs and appear immediately after the CS line they continue.
|
-- are marked by Cs and appear immediately after the CS line.
|
||||||
|
|
||||||
-- Decisions
|
-- Decisions
|
||||||
|
|
||||||
@ -272,6 +272,23 @@ package SCOs is
|
|||||||
-- enclosing statement. The SCO line for a nested decision always occurs
|
-- enclosing statement. The SCO line for a nested decision always occurs
|
||||||
-- after the line for the enclosing decision.
|
-- 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) --
|
-- Internal table used to store Source Coverage Obligations (SCOs) --
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
-- --
|
-- --
|
||||||
-- B o d y --
|
-- 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 --
|
-- 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- --
|
||||||
@ -552,7 +552,8 @@ package body Sem_Ch10 is
|
|||||||
or else
|
or else
|
||||||
Used_In_Spec)
|
Used_In_Spec)
|
||||||
then
|
then
|
||||||
Error_Msg_N ("?redundant with clause in body", Clause);
|
Error_Msg_N -- CODEFIX
|
||||||
|
("?redundant with clause in body", Clause);
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
Used_In_Body := False;
|
Used_In_Body := False;
|
||||||
@ -580,7 +581,8 @@ package body Sem_Ch10 is
|
|||||||
Exit_On_Self => True);
|
Exit_On_Self => True);
|
||||||
|
|
||||||
if Withed then
|
if Withed then
|
||||||
Error_Msg_N ("?redundant with clause", Clause);
|
Error_Msg_N -- CODEFIX
|
||||||
|
("?redundant with clause", Clause);
|
||||||
end if;
|
end if;
|
||||||
end;
|
end;
|
||||||
end if;
|
end if;
|
||||||
@ -690,9 +692,9 @@ package body Sem_Ch10 is
|
|||||||
end if;
|
end if;
|
||||||
|
|
||||||
if Circularity then
|
if Circularity then
|
||||||
Error_Msg_N
|
Error_Msg_N -- CODEFIX???
|
||||||
("circular dependency caused by with_clauses", N);
|
("circular dependency caused by with_clauses", N);
|
||||||
Error_Msg_N
|
Error_Msg_N -- CODEFIX???
|
||||||
("\possibly missing limited_with clause"
|
("\possibly missing limited_with clause"
|
||||||
& " in one of the following", N);
|
& " in one of the following", N);
|
||||||
|
|
||||||
@ -1470,11 +1472,11 @@ package body Sem_Ch10 is
|
|||||||
Unit_Name)
|
Unit_Name)
|
||||||
then
|
then
|
||||||
Error_Msg_Sloc := Sloc (It);
|
Error_Msg_Sloc := Sloc (It);
|
||||||
Error_Msg_N
|
Error_Msg_N -- CODEFIX???
|
||||||
("simultaneous visibility of limited "
|
("simultaneous visibility of limited "
|
||||||
& "and unlimited views not allowed",
|
& "and unlimited views not allowed",
|
||||||
Item);
|
Item);
|
||||||
Error_Msg_NE
|
Error_Msg_NE -- CODEFIX???
|
||||||
("\unlimited view visible through "
|
("\unlimited view visible through "
|
||||||
& "context clause #",
|
& "context clause #",
|
||||||
Item, It);
|
Item, It);
|
||||||
@ -1853,7 +1855,8 @@ package body Sem_Ch10 is
|
|||||||
if No (Nam)
|
if No (Nam)
|
||||||
or else not Is_Protected_Type (Etype (Nam))
|
or else not Is_Protected_Type (Etype (Nam))
|
||||||
then
|
then
|
||||||
Error_Msg_N ("missing specification for Protected body", N);
|
Error_Msg_N -- CODEFIX???
|
||||||
|
("missing specification for Protected body", N);
|
||||||
else
|
else
|
||||||
Set_Scope (Defining_Entity (N), Current_Scope);
|
Set_Scope (Defining_Entity (N), Current_Scope);
|
||||||
Set_Has_Completion (Etype (Nam));
|
Set_Has_Completion (Etype (Nam));
|
||||||
@ -2252,7 +2255,8 @@ package body Sem_Ch10 is
|
|||||||
end if;
|
end if;
|
||||||
|
|
||||||
if No (Nam) or else not Is_Task_Type (Etype (Nam)) then
|
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
|
else
|
||||||
Set_Scope (Defining_Entity (N), Current_Scope);
|
Set_Scope (Defining_Entity (N), Current_Scope);
|
||||||
Generate_Reference (Nam, Defining_Identifier (N), 'b');
|
Generate_Reference (Nam, Defining_Identifier (N), 'b');
|
||||||
@ -2393,13 +2397,15 @@ package body Sem_Ch10 is
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if U_Kind = Implementation_Unit then
|
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
|
-- Add alternative name if available, otherwise issue a
|
||||||
-- general warning message.
|
-- general warning message.
|
||||||
|
|
||||||
if Error_Msg_Strlen /= 0 then
|
if Error_Msg_Strlen /= 0 then
|
||||||
Error_Msg_F ("\use ""~"" instead", Name (N));
|
Error_Msg_F -- CODEFIX???
|
||||||
|
("\use ""~"" instead", Name (N));
|
||||||
else
|
else
|
||||||
Error_Msg_F
|
Error_Msg_F
|
||||||
("\use of this unit is non-portable " &
|
("\use of this unit is non-portable " &
|
||||||
@ -3449,7 +3455,7 @@ package body Sem_Ch10 is
|
|||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
if E2 = WEnt then
|
if E2 = WEnt then
|
||||||
Error_Msg_N
|
Error_Msg_N -- CODEFIX???
|
||||||
("unlimited view visible through use clause ", W);
|
("unlimited view visible through use clause ", W);
|
||||||
return;
|
return;
|
||||||
end if;
|
end if;
|
||||||
@ -3799,7 +3805,7 @@ package body Sem_Ch10 is
|
|||||||
N_Generic_Package_Declaration)
|
N_Generic_Package_Declaration)
|
||||||
and then Nkind (Lib_Unit) not in N_Generic_Renaming_Declaration
|
and then Nkind (Lib_Unit) not in N_Generic_Renaming_Declaration
|
||||||
then
|
then
|
||||||
Error_Msg_N
|
Error_Msg_N -- CODEFIX???
|
||||||
("child of a generic package must be a generic unit", Lib_Unit);
|
("child of a generic package must be a generic unit", Lib_Unit);
|
||||||
|
|
||||||
elsif not Is_Package_Or_Generic_Package (P_Name) then
|
elsif not Is_Package_Or_Generic_Package (P_Name) then
|
||||||
@ -4491,11 +4497,11 @@ package body Sem_Ch10 is
|
|||||||
-- installed.
|
-- installed.
|
||||||
|
|
||||||
if Kind = N_Package_Declaration then
|
if Kind = N_Package_Declaration then
|
||||||
Error_Msg_N
|
Error_Msg_N -- CODEFIX???
|
||||||
("simultaneous visibility of the limited and " &
|
("simultaneous visibility of the limited and " &
|
||||||
"unlimited views not allowed", N);
|
"unlimited views not allowed", N);
|
||||||
Error_Msg_Sloc := Sloc (Item);
|
Error_Msg_Sloc := Sloc (Item);
|
||||||
Error_Msg_NE
|
Error_Msg_NE -- CODEFIX???
|
||||||
("\\ unlimited view of & visible through the " &
|
("\\ unlimited view of & visible through the " &
|
||||||
"context clause #", N, P);
|
"context clause #", N, P);
|
||||||
Error_Msg_Sloc := Sloc (Decl);
|
Error_Msg_Sloc := Sloc (Decl);
|
||||||
@ -5948,9 +5954,9 @@ package body Sem_Ch10 is
|
|||||||
if Nkind (Item) = N_With_Clause
|
if Nkind (Item) = N_With_Clause
|
||||||
and then Private_Present (Item)
|
and then Private_Present (Item)
|
||||||
then
|
then
|
||||||
-- If private_with_clause is redundant, remove it from
|
-- If private_with_clause is redundant, remove it from context,
|
||||||
-- context, as a small optimization to subsequent handling
|
-- as a small optimization to subsequent handling of private_with
|
||||||
-- of private_with clauses in other nested packages..
|
-- clauses in other nested packages.
|
||||||
|
|
||||||
if In_Regular_With_Clause (Entity (Name (Item))) then
|
if In_Regular_With_Clause (Entity (Name (Item))) then
|
||||||
declare
|
declare
|
||||||
|
@ -53,8 +53,8 @@ package body Sem_Intr is
|
|||||||
-- returns type String.
|
-- returns type String.
|
||||||
|
|
||||||
procedure Check_Intrinsic_Operator (E : Entity_Id; N : Node_Id);
|
procedure Check_Intrinsic_Operator (E : Entity_Id; N : Node_Id);
|
||||||
-- Check that operator is one of the binary arithmetic operators, and
|
-- Check that operator is one of the binary arithmetic operators, and that
|
||||||
-- that the types involved both have underlying integer types.
|
-- the types involved both have underlying integer types.
|
||||||
|
|
||||||
procedure Check_Shift (E : Entity_Id; N : Node_Id);
|
procedure Check_Shift (E : Entity_Id; N : Node_Id);
|
||||||
-- Check intrinsic shift subprogram, the two arguments are the same
|
-- Check intrinsic shift subprogram, the two arguments are the same
|
||||||
|
@ -130,10 +130,14 @@ package body Sem_Res is
|
|||||||
-- declaration, and not an (anonymous) allocator type.
|
-- declaration, and not an (anonymous) allocator type.
|
||||||
|
|
||||||
function Is_Predefined_Op (Nam : Entity_Id) return Boolean;
|
function Is_Predefined_Op (Nam : Entity_Id) return Boolean;
|
||||||
-- Utility to check whether the name in the call is a predefined
|
-- Utility to check whether the entity for an operator is a predefined
|
||||||
-- operator, in which case the call is made into an operator node.
|
-- operator, in which case the expression is left as an operator in the
|
||||||
-- An instance of an intrinsic conversion operation may be given
|
-- tree (else it is rewritten into a call). An instance of an intrinsic
|
||||||
-- an operator name, but is not treated like an operator.
|
-- 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);
|
procedure Replace_Actual_Discriminants (N : Node_Id; Default : Node_Id);
|
||||||
-- If a default expression in entry call N depends on the discriminants
|
-- If a default expression in entry call N depends on the discriminants
|
||||||
@ -213,6 +217,9 @@ package body Sem_Res is
|
|||||||
procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id);
|
procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id);
|
||||||
-- A call to a user-defined intrinsic operator is rewritten as a call
|
-- A call to a user-defined intrinsic operator is rewritten as a call
|
||||||
-- to the corresponding predefined operator, with suitable conversions.
|
-- 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);
|
procedure Resolve_Intrinsic_Unary_Operator (N : Node_Id; Typ : Entity_Id);
|
||||||
-- Ditto, for unary operators (arithmetic ones and "not" on signed
|
-- Ditto, for unary operators (arithmetic ones and "not" on signed
|
||||||
@ -1108,11 +1115,21 @@ package body Sem_Res is
|
|||||||
|
|
||||||
function Is_Predefined_Op (Nam : Entity_Id) return Boolean is
|
function Is_Predefined_Op (Nam : Entity_Id) return Boolean is
|
||||||
begin
|
begin
|
||||||
return Is_Intrinsic_Subprogram (Nam)
|
-- Predefined operators are intrinsic subprograms
|
||||||
and then not Is_Generic_Instance (Nam)
|
|
||||||
|
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 Chars (Nam) in Any_Operator_Name
|
||||||
and then (No (Alias (Nam))
|
and then (No (Alias (Nam)) or else Is_Predefined_Op (Alias (Nam)));
|
||||||
or else Is_Predefined_Op (Alias (Nam)));
|
|
||||||
end Is_Predefined_Op;
|
end Is_Predefined_Op;
|
||||||
|
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
-- --
|
-- --
|
||||||
-- B o d y --
|
-- 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 --
|
-- 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- --
|
||||||
@ -659,7 +659,7 @@ package body Tbuild is
|
|||||||
|
|
||||||
-- We don't really need these shift operators, since they never
|
-- We don't really need these shift operators, since they never
|
||||||
-- appear as operators in the source, but the path of least
|
-- 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_Left => Name_Rotate_Left,
|
||||||
N_Op_Rotate_Right => Name_Rotate_Right,
|
N_Op_Rotate_Right => Name_Rotate_Right,
|
||||||
|
@ -348,16 +348,16 @@ package Types is
|
|||||||
-- lie in. Such tests appear only in the lowest level packages.
|
-- lie in. Such tests appear only in the lowest level packages.
|
||||||
|
|
||||||
subtype List_Range is Union_Id
|
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
|
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
|
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
|
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
|
subtype Names_Range is Union_Id
|
||||||
range Names_Low_Bound .. Names_High_Bound;
|
range Names_Low_Bound .. Names_High_Bound;
|
||||||
@ -369,23 +369,23 @@ package Types is
|
|||||||
range Uint_Low_Bound .. Uint_High_Bound;
|
range Uint_Low_Bound .. Uint_High_Bound;
|
||||||
|
|
||||||
subtype Ureal_Range is Union_Id
|
subtype Ureal_Range is Union_Id
|
||||||
range Ureal_Low_Bound .. Ureal_High_Bound;
|
range Ureal_Low_Bound .. Ureal_High_Bound;
|
||||||
|
|
||||||
----------------------------
|
-----------------------------
|
||||||
-- Types for Atree Package --
|
-- Types for Atree Package --
|
||||||
----------------------------
|
-----------------------------
|
||||||
|
|
||||||
-- Node_Id values are used to identify nodes in the tree. They are
|
-- Node_Id values are used to identify nodes in the tree. They are
|
||||||
-- subscripts into the Node table declared in package Tree. Note that
|
-- subscripts into the Nodes table declared in package Atree. Note that
|
||||||
-- the special values Empty and Error are subscripts into this table,
|
-- the special values Empty and Error are subscripts into this table.
|
||||||
-- See package Atree for further details.
|
-- See package Atree for further details.
|
||||||
|
|
||||||
type Node_Id is range Node_Low_Bound .. Node_High_Bound;
|
type Node_Id is range Node_Low_Bound .. Node_High_Bound;
|
||||||
-- Type used to identify nodes in the tree
|
-- Type used to identify nodes in the tree
|
||||||
|
|
||||||
subtype Entity_Id is Node_Id;
|
subtype Entity_Id is Node_Id;
|
||||||
-- A synonym for node types, used in the entity package to refer to nodes
|
-- 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
|
-- 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
|
-- nodes are extended nodes and these are the only extended nodes, so that
|
||||||
-- in practice entity and extended nodes are synonymous.
|
-- in practice entity and extended nodes are synonymous.
|
||||||
|
|
||||||
@ -402,12 +402,12 @@ package Types is
|
|||||||
|
|
||||||
Empty_List_Or_Node : constant := 0;
|
Empty_List_Or_Node : constant := 0;
|
||||||
-- This constant is used in situations (e.g. initializing empty fields)
|
-- This constant is used in situations (e.g. initializing empty fields)
|
||||||
-- where the value set will be used to represent either an empty node
|
-- where the value set will be used to represent either an empty node or
|
||||||
-- or a non-existent list, depending on the context.
|
-- a non-existent list, depending on the context.
|
||||||
|
|
||||||
Error : constant Node_Id := Node_Low_Bound + 1;
|
Error : constant Node_Id := Node_Low_Bound + 1;
|
||||||
-- Used to indicate that there was an error in the source program. A node
|
-- Used to indicate an error in the source program. A node is actually
|
||||||
-- is actually allocated at this address, so that Nkind (Error) = N_Error.
|
-- allocated with this Id value, so that Nkind (Error) = N_Error.
|
||||||
|
|
||||||
Empty_Or_Error : constant Node_Id := Error;
|
Empty_Or_Error : constant Node_Id := Error;
|
||||||
-- Since Empty and Error are the first two Node_Id values, the test for
|
-- Since Empty and Error are the first two Node_Id values, the test for
|
||||||
@ -422,11 +422,12 @@ package Types is
|
|||||||
-- Types for Nlists Package --
|
-- Types for Nlists Package --
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
-- List_Id values are used to identify node lists in the tree. They are
|
-- List_Id values are used to identify node lists stored in the tree, so
|
||||||
-- subscripts into the Lists table declared in package Tree. Note that the
|
-- that each node can be on at most one such list (see package Nlists for
|
||||||
-- special value Error_List is a subscript in this table, but the value
|
-- further details). Note that the special value Error_List is a subscript
|
||||||
-- No_List is *not* a valid subscript, and any attempt to apply list
|
-- in this table, but the value No_List is *not* a valid subscript, and any
|
||||||
-- operations to No_List will cause a (detected) error.
|
-- 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 List_Id is range List_Low_Bound .. List_High_Bound;
|
||||||
-- Type used to identify a node list
|
-- Type used to identify a node list
|
||||||
@ -449,24 +450,23 @@ package Types is
|
|||||||
-- Types for Elists Package --
|
-- Types for Elists Package --
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
-- Element list Id values are used to identify element lists stored in the
|
-- Element list Id values are used to identify element lists stored outside
|
||||||
-- tree (see package Atree for further details). They are formed by adding
|
-- of the tree, allowing nodes to be members of more than one such list
|
||||||
-- a bias (Element_List_Bias) to subscript values in the same array that is
|
-- (see package Elists for further details).
|
||||||
-- used for node list headers.
|
|
||||||
|
|
||||||
type Elist_Id is range Elist_Low_Bound .. Elist_High_Bound;
|
type Elist_Id is range Elist_Low_Bound .. Elist_High_Bound;
|
||||||
-- Type used to identify an element list (Elist header table subscript)
|
-- Type used to identify an element list (Elist header table subscript)
|
||||||
|
|
||||||
No_Elist : constant Elist_Id := Elist_Low_Bound;
|
No_Elist : constant Elist_Id := Elist_Low_Bound;
|
||||||
-- Used to indicate absence of an element list. Note that this is not
|
-- Used to indicate absence of an element list. Note that this is not an
|
||||||
-- an actual Elist header, so element list operations on this value
|
-- actual Elist header, so element list operations on this value are not
|
||||||
-- are not valid.
|
-- valid.
|
||||||
|
|
||||||
First_Elist_Id : constant Elist_Id := No_Elist + 1;
|
First_Elist_Id : constant Elist_Id := No_Elist + 1;
|
||||||
-- Subscript of first allocated Elist header
|
-- Subscript of first allocated Elist header
|
||||||
|
|
||||||
-- Element Id values are used to identify individual elements of an
|
-- Element Id values are used to identify individual elements of an element
|
||||||
-- element list (see package Elists for further details).
|
-- list (see package Elists for further details).
|
||||||
|
|
||||||
type Elmt_Id is range Elmt_Low_Bound .. Elmt_High_Bound;
|
type Elmt_Id is range Elmt_Low_Bound .. Elmt_High_Bound;
|
||||||
-- Type used to identify an element list
|
-- Type used to identify an element list
|
||||||
@ -482,11 +482,12 @@ package Types is
|
|||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
-- String_Id values are used to identify entries in the strings table. They
|
-- 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
|
-- 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
|
-- type String_Id should be regarded as a private type. In particular it is
|
||||||
-- never appropriate to perform arithmetic operations using this type.
|
-- 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 String_Id is range Strings_Low_Bound .. Strings_High_Bound;
|
||||||
-- Type used to identify entries in the strings table
|
-- Type used to identify entries in the strings table
|
||||||
@ -554,7 +555,7 @@ package Types is
|
|||||||
type Unit_Number_Type is new Int;
|
type Unit_Number_Type is new Int;
|
||||||
-- Unit number. The main source is unit 0, and subsidiary sources have
|
-- 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
|
-- 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;
|
Main_Unit : constant Unit_Number_Type := 0;
|
||||||
-- Unit number value for main unit
|
-- Unit number value for main unit
|
||||||
|
Loading…
Reference in New Issue
Block a user