Commit 82e5c243 by Arnaud Charlet

[multiple changes]

2017-01-13  Gary Dismukes  <dismukes@adacore.com>

	* checks.adb: Minor typo fix and reformatting.

2017-01-13  Javier Miranda  <miranda@adacore.com>

	* contracts.adb (Contract_Only_Subprograms): Remove formal.
	(Copy_Original_Specification): Removed.
	(Skip_Contract_Only_Subprogram): Move here checks previously
	located in the caller of this routine (to leave the code more clean).
	(Build_Contract_Only_Subprogram): Code cleanup.
	* scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
	(Get_Contract_Only_Missing_Body_Name): Removed.

From-SVN: r244424
parent f8981f19
2017-01-13 Gary Dismukes <dismukes@adacore.com>
* checks.adb: Minor typo fix and reformatting.
2017-01-13 Javier Miranda <miranda@adacore.com>
* contracts.adb (Contract_Only_Subprograms): Remove formal.
(Copy_Original_Specification): Removed.
(Skip_Contract_Only_Subprogram): Move here checks previously
located in the caller of this routine (to leave the code more clean).
(Build_Contract_Only_Subprogram): Code cleanup.
* scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
(Get_Contract_Only_Missing_Body_Name): Removed.
2017-01-13 Javier Miranda <miranda@adacore.com>
* sem_ch6.adb (Cloned_Expression): New subprogram.
......
......@@ -3390,10 +3390,10 @@ package body Checks is
In_Subrange_Of (Expr_Type, Target_Base, Fixed_Int => Conv_OK)
and then not Float_To_Int
then
-- A small optimization : the attribute 'Pos applied to an
-- A small optimization: the attribute 'Pos applied to an
-- enumeration type has a known range, even though its type
-- is Universal_Integer. so in numeric conversions it is
-- usually within range of of the target integer type. Use the
-- is Universal_Integer. So in numeric conversions it is
-- usually within range of the target integer type. Use the
-- static bounds of the base types to check.
if Nkind (Expr) = N_Attribute_Reference
......@@ -3402,15 +3402,15 @@ package body Checks is
and then Is_Integer_Type (Target_Type)
then
declare
Enum_T : constant Entity_Id :=
Root_Type (Etype (Prefix (Expr)));
Int_T : constant Entity_Id := Base_Type (Target_Type);
Last_I : constant Uint :=
Intval (High_Bound (Scalar_Range (Int_T)));
Last_E : Uint;
Enum_T : constant Entity_Id :=
Root_Type (Etype (Prefix (Expr)));
Int_T : constant Entity_Id := Base_Type (Target_Type);
Last_I : constant Uint :=
Intval (High_Bound (Scalar_Range (Int_T)));
Last_E : Uint;
begin
-- Character types have no explicit literals, we use
-- Character types have no explicit literals, so we use
-- the known number of characters in the type.
if Root_Type (Enum_T) = Standard_Character then
......@@ -3422,7 +3422,8 @@ package body Checks is
Last_E := UI_From_Int (65535);
else
Last_E := Enumeration_Pos
Last_E :=
Enumeration_Pos
(Entity (High_Bound (Scalar_Range (Enum_T))));
end if;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -35,13 +35,6 @@ with Sinfo; use Sinfo;
with System.HTable; use System.HTable;
package body SCIL_LL is
Contract_Only_Body_Suffix : constant String := "__contract_only";
-- Suffix of Contract_Only_Body subprograms internally built only under
-- CodePeer mode
Contract_Only_Missing_Body_Suffix : constant String := "__missing_body";
-- Suffix of Contract_Only_Missing_Body subprograms internally built only
-- under CodePeer mode
procedure Copy_SCIL_Node (Target : Node_Id; Source : Node_Id);
-- Copy the SCIL field from Source to Target (it is used as the argument
......@@ -108,27 +101,6 @@ package body SCIL_LL is
end if;
end Get_Contract_Only_Body;
---------------------------------
-- Get_Contract_Only_Body_Name --
---------------------------------
function Get_Contract_Only_Body_Name (E : Entity_Id) return Name_Id is
begin
return Name_Find (Get_Name_String (Chars (E)) &
Contract_Only_Body_Suffix);
end Get_Contract_Only_Body_Name;
-----------------------------------------
-- Get_Contract_Only_Missing_Body_Name --
-----------------------------------------
function Get_Contract_Only_Missing_Body_Name (E : Entity_Id)
return Name_Id is
begin
return Name_Find (Get_Name_String (Chars (E)) &
Contract_Only_Missing_Body_Suffix);
end Get_Contract_Only_Missing_Body_Name;
-------------------
-- Get_SCIL_Node --
-------------------
......
......@@ -32,17 +32,10 @@
-- This package extends the tree nodes with fields that are used to reference
-- the SCIL node and the Contract_Only_Body of a subprogram with aspects.
with Namet; use Namet;
with Types; use Types;
package SCIL_LL is
function Get_Contract_Only_Body_Name (E : Entity_Id) return Name_Id;
-- Return the name of the Contract_Only_Body subprogram of E
function Get_Contract_Only_Missing_Body_Name (E : Entity_Id) return Name_Id;
-- Return the name of the Contract_Only_Missing_Body subprogram of E
function Get_Contract_Only_Body (N : Node_Id) return Node_Id;
-- Read the value of attribute Contract_Only_Body
......
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