Commit e96b7045 by Arnaud Charlet

[multiple changes]

2015-10-26  Gary Dismukes  <dismukes@adacore.com>
        
        * a-reatim.adb, contracts.adb, contracts.ads: Minor reformatting and
        typo corrections.

2015-10-26  Ed Schonberg  <schonberg@adacore.com>
        
        * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
        recheck the consistency betwen the freeze point and the end of
        declarations for the expression in an aspect specification,
        because it was done already in the analysis of the generic.
        Furthermore, the delayed analysis of an aspect of the instance
        may produce spurious errors when the generic is a child unit
        that references entities in the parent (which might not be in
        scope at the freeze point of the instance).

2015-10-26  Yannick Moy  <moy@adacore.com>
        
        * sem_res.adb (Resolve_Call): Issue info message
        instead of warning when call cannot be inlined in GNATprove mode.

2015-10-26  Arnaud Charlet  <charlet@adacore.com>
        
        * exp_ch6.adb (Build_Procedure_Form): Use _result as the
        name of the extra parameter, cleaner than a random temp name.
        * gnat1drv.adb (Gnat1drv): Code clean up.

From-SVN: r229314
parent c1fffdf1
2015-10-26 Gary Dismukes <dismukes@adacore.com>
* a-reatim.adb, contracts.adb, contracts.ads: Minor reformatting and
typo corrections.
2015-10-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
recheck the consistency betwen the freeze point and the end of
declarations for the expression in an aspect specification,
because it was done already in the analysis of the generic.
Furthermore, the delayed analysis of an aspect of the instance
may produce spurious errors when the generic is a child unit
that references entities in the parent (which might not be in
scope at the freeze point of the instance).
2015-10-26 Yannick Moy <moy@adacore.com>
* sem_res.adb (Resolve_Call): Issue info message
instead of warning when call cannot be inlined in GNATprove mode.
2015-10-26 Arnaud Charlet <charlet@adacore.com>
* exp_ch6.adb (Build_Procedure_Form): Use _result as the
name of the extra parameter, cleaner than a random temp name.
* gnat1drv.adb (Gnat1drv): Code clean up.
2015-10-24 Eric Botcazou <ebotcazou@adacore.com> 2015-10-24 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.c (build_binary_op): Tweak formatting. * gcc-interface/utils2.c (build_binary_op): Tweak formatting.
......
...@@ -123,7 +123,7 @@ is ...@@ -123,7 +123,7 @@ is
-- rounding of the division operator in particular, to be the same as -- rounding of the division operator in particular, to be the same as
-- effects on integer types. To get the correct rounding we first -- effects on integer types. To get the correct rounding we first
-- convert Time_Span to its root type Duration, which is represented as -- convert Time_Span to its root type Duration, which is represented as
-- an 64-bit signed integer, and then use integer division. -- a 64-bit signed integer, and then use integer division.
type Duration_Rep is range -(2 ** 63) .. +((2 ** 63 - 1)); type Duration_Rep is range -(2 ** 63) .. +((2 ** 63 - 1));
...@@ -131,7 +131,7 @@ is ...@@ -131,7 +131,7 @@ is
new Unchecked_Conversion (Duration, Duration_Rep); new Unchecked_Conversion (Duration, Duration_Rep);
begin begin
return Integer return Integer
(To_Integer (Duration (Left)) / To_Integer (Duration (Right))); (To_Integer (Duration (Left)) / To_Integer (Duration (Right)));
end "/"; end "/";
function "/" (Left : Time_Span; Right : Integer) return Time_Span is function "/" (Left : Time_Span; Right : Integer) return Time_Span is
......
...@@ -32,7 +32,7 @@ package Contracts is ...@@ -32,7 +32,7 @@ package Contracts is
procedure Add_Contract_Item (Prag : Node_Id; Id : Entity_Id); procedure Add_Contract_Item (Prag : Node_Id; Id : Entity_Id);
-- Add pragma Prag to the contract of a constant, entry, package [body], -- Add pragma Prag to the contract of a constant, entry, package [body],
-- subprogram [body] or variable denoted by Id. The following are valid -- subprogram [body], or variable denoted by Id. The following are valid
-- pragmas: -- pragmas:
-- Abstract_State -- Abstract_State
-- Async_Readers -- Async_Readers
...@@ -57,7 +57,7 @@ package Contracts is ...@@ -57,7 +57,7 @@ package Contracts is
-- Volatile_Function -- Volatile_Function
procedure Analyze_Enclosing_Package_Body_Contract (Body_Decl : Node_Id); procedure Analyze_Enclosing_Package_Body_Contract (Body_Decl : Node_Id);
-- Analyze the contract of the nearest package body (if any) which encloses -- Analyze the contract of the nearest package body (if any) enclosing
-- package or subprogram body Body_Decl. -- package or subprogram body Body_Decl.
procedure Analyze_Object_Contract (Obj_Id : Entity_Id); procedure Analyze_Object_Contract (Obj_Id : Entity_Id);
...@@ -79,7 +79,7 @@ package Contracts is ...@@ -79,7 +79,7 @@ package Contracts is
-- Refined_State -- Refined_State
-- --
-- Freeze_Id is the entity of a [generic] package body or a [generic] -- Freeze_Id is the entity of a [generic] package body or a [generic]
-- subprogram body which "feezes" the contract of Body_Id. -- subprogram body which "freezes" the contract of Body_Id.
procedure Analyze_Package_Contract (Pack_Id : Entity_Id); procedure Analyze_Package_Contract (Pack_Id : Entity_Id);
-- Analyze all delayed aspects chained on the contract of package Pack_Id -- Analyze all delayed aspects chained on the contract of package Pack_Id
...@@ -129,7 +129,7 @@ package Contracts is ...@@ -129,7 +129,7 @@ package Contracts is
-- Test_Case -- Test_Case
procedure Create_Generic_Contract (Unit : Node_Id); procedure Create_Generic_Contract (Unit : Node_Id);
-- Create a contract node for a generic package, generic subprogram or a -- Create a contract node for a generic package, generic subprogram, or a
-- generic body denoted by Unit by collecting all source contract-related -- generic body denoted by Unit by collecting all source contract-related
-- pragmas in the contract of the unit. -- pragmas in the contract of the unit.
......
...@@ -5495,7 +5495,7 @@ package body Exp_Ch6 is ...@@ -5495,7 +5495,7 @@ package body Exp_Ch6 is
procedure Build_Procedure_Form; procedure Build_Procedure_Form;
-- Create a procedure declaration which emulates the behavior of -- Create a procedure declaration which emulates the behavior of
-- function Subp, for SPARK_To_C. -- function Subp, for C-compatible generation.
-------------------------- --------------------------
-- Build_Procedure_Form -- -- Build_Procedure_Form --
...@@ -5525,9 +5525,12 @@ package body Exp_Ch6 is ...@@ -5525,9 +5525,12 @@ package body Exp_Ch6 is
-- Add an extra out parameter to carry the function result -- Add an extra out parameter to carry the function result
Name_Len := 7;
Name_Buffer (1 .. Name_Len) := "_result";
Append_To (Proc_Formals, Append_To (Proc_Formals,
Make_Parameter_Specification (Loc, Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Temporary (Loc, 'R'), Defining_Identifier =>
Make_Defining_Identifier (Loc, Chars => Name_Find),
Out_Present => True, Out_Present => True,
Parameter_Type => New_Occurrence_Of (Etype (Subp), Loc))); Parameter_Type => New_Occurrence_Of (Etype (Subp), Loc)));
......
...@@ -1180,8 +1180,9 @@ begin ...@@ -1180,8 +1180,9 @@ begin
-- It is not an error to analyze in CodePeer mode a spec which requires -- It is not an error to analyze in CodePeer mode a spec which requires
-- a body, in order to generate SCIL for this spec. -- a body, in order to generate SCIL for this spec.
-- Ditto for Generate_C_Code mode and generate a C header for a spec.
elsif CodePeer_Mode then elsif CodePeer_Mode or Generate_C_Code then
Back_End_Mode := Generate_Object; Back_End_Mode := Generate_Object;
-- It is not an error to analyze in GNATprove mode a spec which requires -- It is not an error to analyze in GNATprove mode a spec which requires
......
...@@ -9103,9 +9103,19 @@ package body Sem_Ch13 is ...@@ -9103,9 +9103,19 @@ package body Sem_Ch13 is
-- Start of processing for Check_Aspect_At_End_Of_Declarations -- Start of processing for Check_Aspect_At_End_Of_Declarations
begin begin
-- In an instance we do not perform the consistency check between freeze
-- point and end of declarations, because it was done already in the
-- analysis of the generic. Furthermore, the delayed analysis of an
-- aspect of the instance may produce spurious errors when the generic
-- is a child unit that references entities in the parent (which might
-- not be in scope at the freeze point of the instance).
if In_Instance then
return;
-- Case of aspects Dimension, Dimension_System and Synchronization -- Case of aspects Dimension, Dimension_System and Synchronization
if A_Id = Aspect_Synchronization then elsif A_Id = Aspect_Synchronization then
return; return;
-- Case of stream attributes, just have to compare entities. However, -- Case of stream attributes, just have to compare entities. However,
......
...@@ -6409,14 +6409,14 @@ package body Sem_Res is ...@@ -6409,14 +6409,14 @@ package body Sem_Res is
-- assertions as logic expressions. -- assertions as logic expressions.
elsif In_Assertion_Expr /= 0 then elsif In_Assertion_Expr /= 0 then
Error_Msg_NE ("?no contextual analysis of &", N, Nam); Error_Msg_NE ("info: no contextual analysis of &?", N, Nam);
Error_Msg_N ("\call appears in assertion expression", N); Error_Msg_N ("\call appears in assertion expression", N);
Set_Is_Inlined_Always (Nam_UA, False); Set_Is_Inlined_Always (Nam_UA, False);
-- Calls cannot be inlined inside default expressions -- Calls cannot be inlined inside default expressions
elsif In_Default_Expr then elsif In_Default_Expr then
Error_Msg_NE ("?no contextual analysis of &", N, Nam); Error_Msg_NE ("info: no contextual analysis of &?", N, Nam);
Error_Msg_N ("\call appears in default expression", N); Error_Msg_N ("\call appears in default expression", N);
Set_Is_Inlined_Always (Nam_UA, False); Set_Is_Inlined_Always (Nam_UA, False);
...@@ -6429,7 +6429,7 @@ package body Sem_Res is ...@@ -6429,7 +6429,7 @@ package body Sem_Res is
if No (Body_Id) then if No (Body_Id) then
Error_Msg_NE Error_Msg_NE
("?no contextual analysis of & (body not seen yet)", ("info: no contextual analysis of & (body not seen yet)?",
N, Nam); N, Nam);
Set_Is_Inlined_Always (Nam_UA, False); Set_Is_Inlined_Always (Nam_UA, False);
...@@ -6445,7 +6445,7 @@ package body Sem_Res is ...@@ -6445,7 +6445,7 @@ package body Sem_Res is
-- expressions, that are not handled by GNATprove. -- expressions, that are not handled by GNATprove.
elsif Is_Potentially_Unevaluated (N) then elsif Is_Potentially_Unevaluated (N) then
Error_Msg_NE ("?no contextual analysis of &", N, Nam); Error_Msg_NE ("info: no contextual analysis of &?", N, Nam);
Error_Msg_N Error_Msg_N
("\call appears in potentially unevaluated context", N); ("\call appears in potentially unevaluated context", N);
Set_Is_Inlined_Always (Nam_UA, False); Set_Is_Inlined_Always (Nam_UA, False);
......
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