[multiple changes]

2013-01-02  Thomas Quinot  <quinot@adacore.com>

	* exp_prag.adb (Expand_Pragma_Check): The statements generated
	for the pragma must have the sloc of the pragma, not the
	sloc of the condition, otherwise this creates anomalies in the
	generated debug information that confuse coverage analysis tools.

2013-01-02  Thomas Quinot  <quinot@adacore.com>

	* sem_ch13.adb: Minor reformatting.

2013-01-02  Arnaud Charlet  <charlet@adacore.com>

	* g-excact.ads (Core_Dump): Clarify that this subprogram does
	not dump cores under Windows.

2013-01-02  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Analyze_Primitive_Renamed_Operation): The prefixed
	view of a subprogram has convention Intrnnsic, and a renaming
	of a prefixed view cannot be the prefix of an Access attribute.

2013-01-02  Robert Dewar  <dewar@adacore.com>

	* restrict.adb: Minor reformatting.

From-SVN: r194782
This commit is contained in:
Arnaud Charlet 2013-01-02 10:38:07 +01:00
parent 39ce760472
commit c5d00db06f
6 changed files with 71 additions and 19 deletions

View File

@ -1,3 +1,29 @@
2013-01-02 Thomas Quinot <quinot@adacore.com>
* exp_prag.adb (Expand_Pragma_Check): The statements generated
for the pragma must have the sloc of the pragma, not the
sloc of the condition, otherwise this creates anomalies in the
generated debug information that confuse coverage analysis tools.
2013-01-02 Thomas Quinot <quinot@adacore.com>
* sem_ch13.adb: Minor reformatting.
2013-01-02 Arnaud Charlet <charlet@adacore.com>
* g-excact.ads (Core_Dump): Clarify that this subprogram does
not dump cores under Windows.
2013-01-02 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Analyze_Primitive_Renamed_Operation): The prefixed
view of a subprogram has convention Intrnnsic, and a renaming
of a prefixed view cannot be the prefix of an Access attribute.
2013-01-02 Robert Dewar <dewar@adacore.com>
* restrict.adb: Minor reformatting.
2013-01-02 Thomas Quinot <quinot@adacore.com>
* exp_prag.adb: Minor reformatting.

View File

@ -274,18 +274,18 @@ package body Exp_Prag is
--------------------------
procedure Expand_Pragma_Check (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
-- Location of the pragma node. Note: it is important to use this
-- location (and not the location of the expression) for the generated
-- statements, otherwise the implicit return statement in the body
-- of a pre/postcondition subprogram may inherit the source location
-- of part of the expression, which causes confusing debug information
-- to be generated, which interferes with coverage analysis tools.
Cond : constant Node_Id := Arg2 (N);
Nam : constant Name_Id := Chars (Arg1 (N));
Msg : Node_Id;
Loc : constant Source_Ptr := Sloc (First_Node (Cond));
-- Source location used in the case of a failed assertion. Note that
-- the source location of the expression is not usually the best choice
-- here. For example, it gets located on the last AND keyword in a
-- chain of boolean expressiond AND'ed together. It is best to put the
-- message on the first character of the assertion, which is the effect
-- of the First_Node call here.
begin
-- We already know that this check is enabled, because otherwise the
-- semantic pass dealt with rewriting the assertion (see Sem_Prag)
@ -362,7 +362,15 @@ package body Exp_Prag is
else
declare
Msg_Loc : constant String := Build_Location_String (Loc);
Msg_Loc : constant String :=
Build_Location_String (Sloc (First_Node (Cond)));
-- Source location used in the case of a failed assertion:
-- point to the failing condition, not Loc. Note that the
-- source location of the expression is not usually the best
-- choice here. For example, it gets located on the last AND
-- keyword in a chain of boolean expressiond AND'ed together.
-- It is best to put the message on the first character of the
-- condition, which is the effect of the First_Node call here.
begin
Name_Len := 0;

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2002-2009, Free Software Foundation, Inc. --
-- Copyright (C) 2002-2012, 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- --
@ -110,7 +110,9 @@ package GNAT.Exception_Actions is
-- is compiled with pragma Restrictions (No_Exception_Registration);
procedure Core_Dump (Occurrence : Exception_Occurrence);
-- Dump memory (called a core dump in some systems), and abort execution
-- of the application.
-- Dump memory (called a core dump in some systems) if supported by the
-- OS (most unix systems and VMS), and abort execution of the application.
-- Under Windows this procedure will not dump the memory, it will only
-- abort execution.
end GNAT.Exception_Actions;

View File

@ -611,8 +611,8 @@ package body Restrict is
end if;
-- Ignore call if node N is not in the main source unit, since we only
-- give messages for . This avoids giving messages for aspects that are
-- specified in withed units.
-- give messages for the main unit. This avoids giving messages for
-- aspects that are specified in withed units.
if not In_Extended_Main_Source_Unit (N) then
return;

View File

@ -1886,7 +1886,7 @@ package body Sem_Ch13 is
-- In the context of a compilation unit, we directly put the
-- pragma in the Pragmas_After list of the
-- N_Compilation_Unit_Aux node (No delay is required here)
-- N_Compilation_Unit_Aux node (no delay is required here)
-- except for aspects on a subprogram body (see below).
if Nkind (Parent (N)) = N_Compilation_Unit
@ -2012,8 +2012,8 @@ package body Sem_Ch13 is
Rewrite (N,
Make_Attribute_Definition_Clause (Sloc (N),
Name => Identifier (N),
Chars => Name_Address,
Name => Identifier (N),
Chars => Name_Address,
Expression => Expression (N)));
-- We preserve Comes_From_Source, since logically the clause still comes

View File

@ -397,8 +397,10 @@ package body Sem_Ch8 is
New_S : Entity_Id;
Is_Body : Boolean);
-- If the renamed entity in a subprogram renaming is a primitive operation
-- or a class-wide operation in prefix form, save the target object, which
-- must be added to the list of actuals in any subsequent call.
-- or a class-wide operation in prefix form, save the target object,
-- which must be added to the list of actuals in any subsequent call.
-- The renaming operation is intrinsic because the compiler must in
-- fact generate a wrapper for it (6.3.1 (10 1/2)).
function Applicable_Use (Pack_Name : Node_Id) return Boolean;
-- Common code to Use_One_Package and Set_Use, to determine whether use
@ -1602,6 +1604,10 @@ package body Sem_Ch8 is
-- match. The first formal of the renamed entity is skipped because it
-- is the target object in any subsequent call.
--------------
-- Conforms --
--------------
function Conforms
(Subp : Entity_Id;
Ctyp : Conformance_Type) return Boolean
@ -1634,6 +1640,8 @@ package body Sem_Ch8 is
return True;
end Conforms;
-- Start of processing for Analyze_Renamed_Primitive_Operation
begin
if not Is_Overloaded (Selector_Name (Name (N))) then
Old_S := Entity (Selector_Name (Name (N)));
@ -1681,6 +1689,14 @@ package body Sem_Ch8 is
if not Conforms (Old_S, Mode_Conformant) then
Error_Msg_N ("mode conformance error in renaming", N);
end if;
-- Enforce the rule given in (RM 6.3.1 (10.1/2)): a prefixed
-- view of a subprogram is intrinsic, because the compiler has
-- to generate a wrapper for any call to it. If the name in a
-- subprogram renaming is a prefixed view, the entity is thus
-- intrinsic, and 'Access cannot be applied to it.
Set_Convention (New_S, Convention_Intrinsic);
end if;
-- Inherit_Renamed_Profile (New_S, Old_S);