[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 2 Aug 2011 07:48:59 +0000 (09:48 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 2 Aug 2011 07:48:59 +0000 (09:48 +0200)
2011-08-02  Robert Dewar  <dewar@adacore.com>

* par-ch10.adb: Minor code reorganization (use Nkind_In).

2011-08-02  Ed Schonberg  <schonberg@adacore.com>

* par-ch9.adb: save location of entry for proper error message.

From-SVN: r177088

gcc/ada/ChangeLog
gcc/ada/par-ch10.adb
gcc/ada/par-ch9.adb

index 8a82c4515151c5b62835876bce1bc70846ec6661..e9e0cce10befb540ae2cb32bd25510039c2e410e 100644 (file)
@@ -1,3 +1,11 @@
+2011-08-02  Robert Dewar  <dewar@adacore.com>
+
+       * par-ch10.adb: Minor code reorganization (use Nkind_In).
+
+2011-08-02  Ed Schonberg  <schonberg@adacore.com>
+
+       * par-ch9.adb: save location of entry for proper error message.
+
 2011-08-02  Javier Miranda  <miranda@adacore.com>
 
        * sem_type.ads, sem_type.adb (Is_Ancestor): Addition of a new formal
index 47e4fdb7d7e59b76c8312f9ae7d34ab334a81e01..6958209305c317ed46580dccc8b4e02e4c99b486 100644 (file)
@@ -508,9 +508,7 @@ package body Ch10 is
 
       --  Another error from which it is hard to recover
 
-      if Nkind (Unit_Node) = N_Subprogram_Body_Stub
-        or else Nkind (Unit_Node) = N_Package_Body_Stub
-      then
+      if Nkind_In (Unit_Node, N_Subprogram_Body_Stub, N_Package_Body_Stub) then
          Cunit_Error_Flag := True;
          return Error;
       end if;
@@ -526,10 +524,10 @@ package body Ch10 is
             Unit_Node := Specification (Unit_Node);
          end if;
 
-         if Nkind (Unit_Node) = N_Package_Declaration
-           or else Nkind (Unit_Node) = N_Subprogram_Declaration
-           or else Nkind (Unit_Node) = N_Subprogram_Body
-           or else Nkind (Unit_Node) = N_Subprogram_Renaming_Declaration
+         if Nkind_In (Unit_Node, N_Package_Declaration,
+                                 N_Subprogram_Declaration,
+                                 N_Subprogram_Body,
+                                 N_Subprogram_Renaming_Declaration)
          then
             Unit_Node := Specification (Unit_Node);
 
@@ -540,26 +538,27 @@ package body Ch10 is
             end if;
          end if;
 
-         if Nkind (Unit_Node) = N_Task_Body
-           or else Nkind (Unit_Node) = N_Protected_Body
-           or else Nkind (Unit_Node) = N_Task_Type_Declaration
-           or else Nkind (Unit_Node) = N_Protected_Type_Declaration
-           or else Nkind (Unit_Node) = N_Single_Task_Declaration
-           or else Nkind (Unit_Node) = N_Single_Protected_Declaration
+         if Nkind_In (Unit_Node, N_Task_Body,
+                                 N_Protected_Body,
+                                 N_Task_Type_Declaration,
+                                 N_Protected_Type_Declaration,
+                                 N_Single_Task_Declaration,
+                                 N_Single_Protected_Declaration)
          then
             Name_Node := Defining_Identifier (Unit_Node);
 
-         elsif Nkind (Unit_Node) = N_Function_Instantiation
-           or else Nkind (Unit_Node) = N_Function_Specification
-           or else Nkind (Unit_Node) = N_Generic_Function_Renaming_Declaration
-           or else Nkind (Unit_Node) = N_Generic_Package_Renaming_Declaration
-           or else Nkind (Unit_Node) = N_Generic_Procedure_Renaming_Declaration
-           or else Nkind (Unit_Node) = N_Package_Body
-           or else Nkind (Unit_Node) = N_Package_Instantiation
-           or else Nkind (Unit_Node) = N_Package_Renaming_Declaration
-           or else Nkind (Unit_Node) = N_Package_Specification
-           or else Nkind (Unit_Node) = N_Procedure_Instantiation
-           or else Nkind (Unit_Node) = N_Procedure_Specification
+         elsif Nkind_In (Unit_Node, N_Function_Instantiation,
+                                    N_Function_Specification,
+                                    N_Generic_Function_Renaming_Declaration,
+                                    N_Generic_Package_Renaming_Declaration,
+                                    N_Generic_Procedure_Renaming_Declaration)
+          or else
+               Nkind_In (Unit_Node, N_Package_Body,
+                                    N_Package_Instantiation,
+                                    N_Package_Renaming_Declaration,
+                                    N_Package_Specification,
+                                    N_Procedure_Instantiation,
+                                    N_Procedure_Specification)
          then
             Name_Node := Defining_Unit_Name (Unit_Node);
 
index 83233b6ff9fe0be619cb4c902565d514c6ff2541..82907746fa21035aee10b62610ed68103b9c4571 100644 (file)
@@ -1063,6 +1063,7 @@ package body Ch9 is
       Scope.Table (Scope.Last).Ecol := Start_Column;
       Scope.Table (Scope.Last).Lreq := False;
       Scope.Table (Scope.Last).Etyp := E_Name;
+      Scope.Table (Scope.Last).Sloc := Token_Ptr;
 
       Name_Node := P_Defining_Identifier;
       Set_Defining_Identifier (Entry_Node, Name_Node);