OSDN Git Service

2007-04-20 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Jun 2007 10:42:10 +0000 (10:42 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Jun 2007 10:42:10 +0000 (10:42 +0000)
* sem.ads, sem.adb (Semantics): Save and restore Global_Discard_Names
Remove no longer used nodes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125446 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/sem.adb
gcc/ada/sem.ads

index 7967c36..34e0907 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -539,9 +539,6 @@ package body Sem is
          when N_With_Clause =>
             Analyze_With_Clause (N);
 
-         when N_With_Type_Clause =>
-            Analyze_With_Type_Clause (N);
-
          --  A call to analyze the Empty node is an error, but most likely
          --  it is an error caused by an attempt to analyze a malformed
          --  piece of tree caused by some other error, so if there have
@@ -558,6 +555,13 @@ package body Sem is
          when N_Error =>
             null;
 
+         --  Push/Pop nodes normally don't come through an analyze call. An
+         --  exception is the dummy ones bracketing a subprogram body. In any
+         --  case there is nothing to be done to analyze such nodes.
+
+         when N_Push_Pop_xxx_Label =>
+            null;
+
          --  For the remaining node types, we generate compiler abort, because
          --  these nodes are always analyzed within the Sem_Chn routines and
          --  there should never be a case of making a call to the main Analyze
@@ -610,12 +614,6 @@ package body Sem is
            N_Mod_Clause                             |
            N_Modular_Type_Definition                |
            N_Ordinary_Fixed_Point_Definition        |
-           N_Pop_Constraint_Error_Label             |
-           N_Pop_Program_Error_Label                |
-           N_Pop_Storage_Error_Label                |
-           N_Push_Constraint_Error_Label            |
-           N_Push_Program_Error_Label               |
-           N_Push_Storage_Error_Label               |
            N_Parameter_Specification                |
            N_Pragma_Argument_Association            |
            N_Procedure_Specification                |
@@ -1220,6 +1218,7 @@ package body Sem is
       S_Outer_Gen_Scope  : constant Entity_Id        := Outer_Generic_Scope;
       S_Sem_Unit         : constant Unit_Number_Type := Current_Sem_Unit;
       S_GNAT_Mode        : constant Boolean          := GNAT_Mode;
+      S_Discard_Names    : constant Boolean          := Global_Discard_Names;
       Generic_Main       : constant Boolean :=
                              Nkind (Unit (Cunit (Main_Unit)))
                                in N_Generic_Declaration;
@@ -1242,7 +1241,7 @@ package body Sem is
       procedure Do_Analyze is
       begin
          Save_Scope_Stack;
-         New_Scope (Standard_Standard);
+         Push_Scope (Standard_Standard);
          Scope_Suppress := Suppress_Options;
          Scope_Stack.Table
            (Scope_Stack.Last).Component_Alignment_Default := Calign_Default;
@@ -1333,6 +1332,7 @@ package body Sem is
       New_Nodes_OK           := S_New_Nodes_OK;
       Outer_Generic_Scope    := S_Outer_Gen_Scope;
       GNAT_Mode              := S_GNAT_Mode;
+      Global_Discard_Names   := S_Discard_Names;
 
       Restore_Opt_Config_Switches (Save_Config_Switches);
       Expander_Mode_Restore;
index 6a86aff..8b38c33 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -210,11 +210,6 @@ package Sem is
    -- Semantic Analysis Flags --
    -----------------------------
 
-   Explicit_Overriding : Boolean := False;
-   --  Switch to indicate whether checking mechanism described in AI-218
-   --  is enforced: subprograms that override inherited operations must be
-   --  be marked explicitly, to prevent accidental or omitted overriding.
-
    Full_Analysis : Boolean := True;
    --  Switch to indicate whether we are doing a full analysis or a
    --  pre-analysis. In normal analysis mode (Analysis-Expansion for
@@ -395,7 +390,7 @@ package Sem is
    --  There are two kinds of suppress checks: scope based suppress checks,
    --  and entity based suppress checks.
 
-   --  Scope based suppress chems (from initial command line arguments,
+   --  Scope based suppress checks (from initial command line arguments,
    --  or from Suppress pragmas not including an entity name) are recorded
    --  in the Sem.Supress variable, and all that is necessary is to save the
    --  state of this variable on scope entry, and restore it on scope exit.