aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_aux.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2008-04-08 08:45:25 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-04-08 08:45:25 +0200
commit21d279972261484650109d662caf32b73a91bf1d (patch)
treee4cc7613e520d7e95dfe0fcf3b07c6eab2b5d99c /gcc/ada/sem_aux.adb
parent1ed69f611a49303c68258905e067c1c5888b9248 (diff)
downloadgcc-21d279972261484650109d662caf32b73a91bf1d.zip
gcc-21d279972261484650109d662caf32b73a91bf1d.tar.gz
gcc-21d279972261484650109d662caf32b73a91bf1d.tar.bz2
alloc.ads: Add entries for Obsolescent_Warnings table
2008-04-08 Robert Dewar <dewar@adacore.com> Bob Duff <duff@adacore.com> Gary Dismukes <dismukes@adacore.com> Ed Schonberg <schonberg@adacore.com> * alloc.ads: Add entries for Obsolescent_Warnings table * einfo.ads, einfo.adb: Minor reformatting. (Is_Discriminal): New subprogram. (Is_Prival): New subprogram. (Is_Protected_Component): New subprogram. (Is_Protected_Private): Removed. (Object_Ref, Set_Object_Ref): Removed. (Prival, Set_Prival): Change assertion. (Privals_Chain, Set_Privals_Chain): Removed. (Prival_Link, Set_Prival_Link): New subprogram. (Protected_Operation, Set_Protected_Operation): Removed. (Protection_Object, Set_Protection_Object): New subprogram. (Write_Field17_Name): Remove case for Object_Ref. (Write_Field20_Name): Add case for Prival_Link. (Write_Field22_Name): Remove case for Protected_Operation, Privals_Chain. Add case for Protection_Object. (Can_Use_Internal_Rep): Make this into a [base type only] attribute, so clients (Overlays_Constant): New flag (Is_Constant_Object): New predicate (Is_Standard_Character_Type): New predicate (Optimize_Alignment_Space): New flag (Optimize_Alignment_Time): New flag (Has_Postconditions): New flag (Obsolescent_Warrning): Field removed (Spec_PPC_List): New field (Relative_Deadline_Variable, Set_Relative_Deadline_Variable): Add subprograms to get and set the relative deadline associated to a task. * exp_attr.adb (May_Be_External_Call): Account for the case where the Access attribute is part of a named parameter association. (Expand_Access_To_Protected_Op): Test for the attribute occurring within an init proc and use that directly as the scope rather than traversing up to the protected operation's enclosing scope. Only apply assertion on Is_Open_Scopes in the case the scope traversal is done. For the init proc case use the address of the first formal (_init) as the protected object reference. Implement Invalid_Value attribute (Expand_N_Attribute_Reference): Case Attribute_Unrestricted_Access. contents of the dispatch table there is no need to duplicate the itypes associated with record types (i.e. the implicit full view of private types). Implement Enum_Val attribute (Expand_N_Attribute_Reference, case Old): Properly handle appearence within _Postconditions procedure (Expand_N_Attribute_Reference, case Result): Implement new attribute * exp_ch5.adb (Expand_N_Simple_Return_Statement): Handle case in which a return statement calls a function that is not available in configurable runtime. (Analyze_If_Statement): don't optimize simple True/False cases in -O0 (Expand_Non_Function_Return): Generate call to _Postconditions proc (Expand_Simple_Function_Return): Ditto * frontend.adb: Add call to Sem_Aux.Initialize * sem_aux.ads, sem_aux.adb: New file. * par-prag.adb: Add entries for pragmas Precondition/Postcondition Add new Pragma_Relative_Deadline. Add support for pragmas Check and Check_Policy * sem_attr.ads, sem_attr.adb (Check_Not_CPP_Type): New subprogram. (Check_Stream_Attribute): Add missing check (not allowed in CPP types) (Analyze_Attribute): In case of attributes 'Alignment and 'size add missing check because they are not allowed in CPP tagged types. Add Sure parameter to Note_Possible_Modification calls Add implementation of Invalid_Value attribute Implement new attribute Has_Tagged_Values Implement Enum_Val attribute (Analyze_Attribute, case Range): Set Name_Req True for prefix of generated attributes. (Analyze_Attribute, case Result): If prefix of the attribute is overloaded, it always resolves to the enclosing function. (Analyze_Attribute, case Result): Properly deal with analysis when Postconditions are not active. (Resolve_Attribute, case Result): Properly deal with appearence during preanalysis in spec. Add processing for attribute Result * sem_ch6.ads, sem_ch6.adb (Check_Overriding_Indicator): Code cleanup for operators. (Analyze_Subprogram_Body): Install private_with_clauses when the body acts as a spec. (Check_Inline_Pragma): recognize an inline pragma that appears within the subprogram body to which it applies. (Analyze_Function_Return): Check that type of the expression of a return statement in a function with a class-wide result is not declared at a deeper level than the function. (Process_PPCs): Deal with enabling/disabling, using PPC_Enabled flag (Verify_Overriding_Indicator): Handle properly subprogram bodies for user- defined operators. (Install_Formals): Moved to spec to allow use from Sem_Prag for analysis of precondition/postcondition pragmas. (Analyze_Subprogram_Body.Last_Real_Spec_Entity): New name for Last_Formal, along with lots of comments on what this is about (Analyze_Subprogram_Body): Fix case where we move entities from the spec to the body when there are no body entities (now possible with precondition and postcondition pragmas). (Process_PPCs): New procedure (Analyze_Subprogram_Body): Add call to Process_PPCs * sem_ch8.adb (Use_One_Type): refine warning on a redundant use_type clause. (Pop_Scope): Restore Check_Policy_List on scope exit (Push_Scope): Save Check_Policy_List on scope entry Change name In_Default_Expression => In_Spec_Expression Change name Analyze_Per_Use_Expression => Preanalyze_Spec_Expression Change name Pre_Analyze_And_Resolve => Preanalyze_And_Resolve (Analyze_Object_Renaming): Allow 'Reference as object (Analyze_Pragma, case Restriction_Warnings): Call GNAT_Pragma (Process_Restrictions_Or_Restriction_Warnings): Check for bad spelling of restriction identifier. Add Sure parameter to Note_Possible_Modication calls * sem_prag.ads, sem_prag.adb (Analyze_Pragma, case Stream_Convert): Don't check for primitive operations when calling Rep_Item_Too_Late. (Process_Import_Or_Interface): Do not place flag on formal subprograms. (Analyze_Pragma, case Export): If the entity is a deferred constant, propagate information to full view, which is the one elaborated by the back-end. (Make_Inline): the pragma is effective if it applies to an internally generated subprogram declaration for a body that carries the pragma. (Analyze_Pragma, case Optimize_Alignment): Set new flag Optimize_Alignment_Local. (Analyze_PPC_In_Decl_Part): New procedure (Get_Pragma_Arg): Moved to outer level (Check_Precondition_Postcondition): Change to allow new visibility rules for package spec (Analyze_Pragma, case Check_Policy): Change placement rules to be same as pragma Suppress/Unsuppress. Change name In_Default_Expression => In_Spec_Expression Change name Analyze_Per_Use_Expression => Preanalyze_Spec_Expression Change name Pre_Analyze_And_Resolve => Preanalyze_And_Resolve (Check_Precondition_Postcondition): Do proper visibility preanalysis for the case of these pragmas appearing in the spec. (Check_Enabled): New function (Initialize): New procedure (Tree_Read): New procedure (Tree_Write): New procedure (Check_Precondition_Postcondition): New procedure Implement pragmas Check and Check_Policy Merge Assert processing with Check * sem_warn.adb (Warn_On_Known_Condition): Handle pragma Check New warning flag -gnatw.e * sinfo.ads, sinfo.adb (Has_Relative_Deadline_Pragma): New function returning whether a task (or main procedure) has a pragma Relative_Deadline. (Set_Has_Relative_Deadline_Pragma): Procedure to indicate that a task (or main procedure) has a pragma Relative_Deadline. Add Next_Pragma field to N_Pragma node (PPC_Enabled): New flag (Next_Pragma): Now used for Pre/Postcondition processing * snames.h, snames.ads, snames.adb: New standard name Inherit_Source_Path Add entry for 'Invalid_Value attribute Add entry for new attribute Has_Tagged_Values Add entry for Enum_Val attribute Add new standard names Aggregate, Configuration and Library. Add _Postconditions Add _Result Add Pragma_Precondition Add Pragma_Postcondition Add Attribute_Result New standard name Archive_Builder_Append_Option (Preset_Names): Add _relative_deadline and relative_deadline definitions There was also a missing non_preemptive_within_priorities. (Get_Pragma_Id, Is_Pragma_Name): Add support for pragma Relative_Deadline. Add support for pragmas Check and Check_Policy * tree_gen.adb: Call Sem_Aux.Tree_Write * tree_in.adb: Call Sem_Aux.Tree_Read * exp_ch11.adb (Expand_N_Raise_Statement): New Build_Location calling sequence * exp_intr.adb (Expand_Source_Info): New Build_Location calling sequence * exp_prag.adb (Expand_Pragma_Relative_Deadline): New procedure. (Expand_N_Pragma): Call the appropriate procedure for expanding pragma Relative_Deadline. (Expand_Pragma_Check): New procedure * sinput.ads, sinput.adb (Build_Location_String): Now appends to name buffer. * sinfo.adb (PPC_Enabled): New flag From-SVN: r134010
Diffstat (limited to 'gcc/ada/sem_aux.adb')
-rwxr-xr-xgcc/ada/sem_aux.adb62
1 files changed, 62 insertions, 0 deletions
diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb
new file mode 100755
index 0000000..58b5b5c
--- /dev/null
+++ b/gcc/ada/sem_aux.adb
@@ -0,0 +1,62 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- S E M _ A U X --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 1992-2008, 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- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+package body Sem_Aux is
+
+ ----------------
+ -- Initialize --
+ ----------------
+
+ procedure Initialize is
+ begin
+ Obsolescent_Warnings.Init;
+ end Initialize;
+
+ ---------------
+ -- Tree_Read --
+ ---------------
+
+ procedure Tree_Read is
+ begin
+ Obsolescent_Warnings.Tree_Read;
+ end Tree_Read;
+
+ ----------------
+ -- Tree_Write --
+ ----------------
+
+ procedure Tree_Write is
+ begin
+ Obsolescent_Warnings.Tree_Write;
+ end Tree_Write;
+
+end Sem_Aux;