aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/binde.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-01-12 14:30:20 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-12 14:30:20 +0100
commit5f325af2606476be7ef1db50b1a46ab842901bb9 (patch)
tree1eb80eba1ca449f68eb93ecacde316fd096aa023 /gcc/ada/binde.adb
parent10c2c151f1204439e8b2698bf3369b8d2c29efbf (diff)
downloadgcc-5f325af2606476be7ef1db50b1a46ab842901bb9.zip
gcc-5f325af2606476be7ef1db50b1a46ab842901bb9.tar.gz
gcc-5f325af2606476be7ef1db50b1a46ab842901bb9.tar.bz2
[multiple changes]
2017-01-12 Yannick Moy <moy@adacore.com> * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied subtree. 2017-01-12 Justin Squirek <squirek@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference): Fix Finalization_Size case by properly resolving the type after rewritting the node. 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into the tree. (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree. * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb, exp_sel.ads: Minor reformatting. 2017-01-12 Justin Squirek <squirek@adacore.com> * exp_ch6.adb (Expand_Call): Add guard to prevent invariant checks from being created for internally generated subprograms. 2017-01-12 Bob Duff <duff@adacore.com> * lib-writ.ads: Remove incorrect comment. 2017-01-12 Javier Miranda <miranda@adacore.com> * debug.adb (-gnatd.K): Enable generation of contract-only procedures in CodePeer mode. * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms): New subprogram. (Analyze_Contracts): Generate contract-only procedures if -gnatdK is set. * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New subprogram. (Get_Contract_Only_Missing_Body_Name): New subprogram. (Get_Contract_Only_Body): New subprogram. (Set_Contract_Only_Body): New subprogram. (Is_Contract_Only_Body): New subprogram. (Set_Is_Contract_Only_Body): New subprogram. (SCIL_Nodes): Replace table by hash-table. From-SVN: r244356
Diffstat (limited to 'gcc/ada/binde.adb')
-rw-r--r--gcc/ada/binde.adb49
1 files changed, 34 insertions, 15 deletions
diff --git a/gcc/ada/binde.adb b/gcc/ada/binde.adb
index 7baf685..f655bf2 100644
--- a/gcc/ada/binde.adb
+++ b/gcc/ada/binde.adb
@@ -1211,14 +1211,18 @@ package body Binde is
-- There is a lot of fiddly string manipulation below, because we don't
-- want to depend on misc utility packages like Ada.Characters.Handling.
- function Read_File (Name : String) return String_Ptr;
- -- Read the entire contents of the named file
-
function Get_Line return String;
-- Read the next line from the file content read by Read_File. Strip
-- leading and trailing blanks. Convert "(spec)" or "(body)" to
-- "%s"/"%b". Remove comments (Ada style; "--" to end of line).
+ function Read_File (Name : String) return String_Ptr;
+ -- Read the entire contents of the named file
+
+ ---------------
+ -- Read_File --
+ ---------------
+
function Read_File (Name : String) return String_Ptr is
-- All of the following calls should succeed, because we checked the
-- file in Switch.B, but we double check and raise Program_Error on
@@ -1232,9 +1236,11 @@ package body Binde is
end if;
declare
- Len : constant Natural := Natural (File_Length (F));
- Result : constant String_Ptr := new String (1 .. Len);
- Len_Read : constant Natural := Read (F, Result (1)'Address, Len);
+ Len : constant Natural := Natural (File_Length (F));
+ Result : constant String_Ptr := new String (1 .. Len);
+ Len_Read : constant Natural :=
+ Read (F, Result (1)'Address, Len);
+
Status : Boolean;
begin
@@ -1252,12 +1258,17 @@ package body Binde is
end;
end Read_File;
- S : String_Ptr := Read_File (Force_Elab_Order_File.all);
- Cur : Positive := 1;
+ Cur : Positive := 1;
+ S : String_Ptr := Read_File (Force_Elab_Order_File.all);
+
+ --------------
+ -- Get_Line --
+ --------------
function Get_Line return String is
First : Positive := Cur;
- Last : Natural;
+ Last : Natural;
+
begin
-- Skip to end of line
@@ -1293,12 +1304,16 @@ package body Binde is
-- again.
declare
+ Body_String : constant String := "(body)";
+ BL : constant Positive := Body_String'Length;
+ Spec_String : constant String := "(spec)";
+ SL : constant Positive := Spec_String'Length;
+
Line : String renames S (First .. Last);
- Spec_String : constant String := "(spec)";
- SL : constant Positive := Spec_String'Length;
- Body_String : constant String := "(body)";
- BL : constant Positive := Body_String'Length;
- Is_Spec, Is_Body : Boolean := False;
+
+ Is_Body : Boolean := False;
+ Is_Spec : Boolean := False;
+
begin
if Line'Length >= SL
and then Line (Last - SL + 1 .. Last) = Spec_String
@@ -1336,8 +1351,12 @@ package body Binde is
end;
end Get_Line;
+ -- Local variables
+
Empty_Name : constant Unit_Name_Type := Name_Find ("");
- Prev_Unit : Unit_Id := No_Unit_Id;
+ Prev_Unit : Unit_Id := No_Unit_Id;
+
+ -- Start of processing for Force_Elab_Order
begin
-- Loop through the file content, and build a dependency link for each