aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2007-06-06 12:42:10 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-06-06 12:42:10 +0200
commit9f0d9574d38e48c0faaf4692fadfb203871f68e3 (patch)
tree5a674d5e70224ea846bbdc701aaeef2934b14dc9 /gcc
parent0e701488e1f731a529f6b391e538d369777c32c0 (diff)
downloadgcc-9f0d9574d38e48c0faaf4692fadfb203871f68e3.zip
gcc-9f0d9574d38e48c0faaf4692fadfb203871f68e3.tar.gz
gcc-9f0d9574d38e48c0faaf4692fadfb203871f68e3.tar.bz2
sem.ads, sem.adb (Semantics): Save and restore Global_Discard_Names Remove no longer used nodes.
2007-04-20 Robert Dewar <dewar@adacore.com> * sem.ads, sem.adb (Semantics): Save and restore Global_Discard_Names Remove no longer used nodes. From-SVN: r125446
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem.adb22
-rw-r--r--gcc/ada/sem.ads9
2 files changed, 13 insertions, 18 deletions
diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb
index 7967c36..34e0907 100644
--- a/gcc/ada/sem.adb
+++ b/gcc/ada/sem.adb
@@ -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;
diff --git a/gcc/ada/sem.ads b/gcc/ada/sem.ads
index 6a86aff..8b38c33 100644
--- a/gcc/ada/sem.ads
+++ b/gcc/ada/sem.ads
@@ -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.