From a548f9ffabe114aa611bf69c6dfdb5afce20bbd1 Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Mon, 21 Jun 2010 13:38:58 +0000 Subject: checks.adb: Add comments. 2010-06-21 Thomas Quinot * checks.adb: Add comments. * prj-nmsc.adb: Minor reformatting. From-SVN: r161077 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/checks.adb | 7 ++++++- gcc/ada/prj-nmsc.adb | 22 ++++++++++++---------- 3 files changed, 23 insertions(+), 11 deletions(-) (limited to 'gcc/ada') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 30a6f60..7652484 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2010-06-21 Thomas Quinot + * checks.adb: Add comments. + * prj-nmsc.adb: Minor reformatting. + +2010-06-21 Thomas Quinot + * sem_ch9.adb, checks.adb, sem_util.adb, sem_util.ads, sem_res.adb, sem_attr.adb (Get_E_First_Or_Last): Use attribute references on E to extract bounds, to ensure that we get the proper captured values, diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index ebe6e5a..f4a339f 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6253,8 +6253,13 @@ package body Checks is E : Entity_Id; Indx : Nat; Nam : Name_Id) return Node_Id; - -- Returns expression to compute: + -- Returns an attribute reference -- E'First or E'Last + -- with a source location of Loc. + -- Nam is Name_First or Name_Last, according to which attribute is + -- desired. If Indx is non-zero, it is passed as a literal in the + -- Expressions of the attribute reference (identifying the desired + -- array dimension). function Get_N_First (N : Node_Id; Indx : Nat) return Node_Id; function Get_N_Last (N : Node_Id; Indx : Nat) return Node_Id; diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 9e114f6..ecfa4ce 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -6835,22 +6835,24 @@ package body Prj.Nmsc is Num_Nod := Data.Tree.Number_Lists.Table (Src_Dir_Rank); Element := Data.Tree.String_Elements.Table (Source_Dir); + -- Use Element.Value in this test, not Display_Value, because we + -- want the symbolic links to be resolved when appropriate. + if Element.Value /= No_Name then declare - -- We use Element.Value, not Display_Value, because we want - -- the symbolic links to be resolved when appropriate. - Source_Directory : constant String := - Get_Name_String (Element.Value) - & Directory_Separator; - Dir_Last : constant Natural := - Compute_Directory_Last - (Source_Directory); - -- The Display_Source_Directory is to be able to open an - -- UTF-8 encoded directory on Windows. + Source_Directory : constant String := + Get_Name_String (Element.Value) + & Directory_Separator; + + Dir_Last : constant Natural := + Compute_Directory_Last (Source_Directory); + Display_Source_Directory : constant String := Get_Name_String (Element.Display_Value) & Directory_Separator; + -- Display_Source_Directory is to allow us to open a UTF-8 + -- encoded directory on Windows. begin if Current_Verbosity = High then -- cgit v1.1