summaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-08 06:45:25 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-08 06:45:25 +0000
commitd55c93e01d022e1db25688345ef53ab282c1f1b1 (patch)
treee4cc7613e520d7e95dfe0fcf3b07c6eab2b5d99c /gcc/ada/sinfo.adb
parenta6e4c6b639d920aac5e2d48ff93a17f27a1f49d3 (diff)
downloadgcc-d55c93e01d022e1db25688345ef53ab282c1f1b1.tar.gz
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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134010 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sinfo.adb')
-rw-r--r--gcc/ada/sinfo.adb50
1 files changed, 50 insertions, 0 deletions
diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb
index 528d7f43a40..534023f1cab 100644
--- a/gcc/ada/sinfo.adb
+++ b/gcc/ada/sinfo.adb
@@ -1415,6 +1415,15 @@ package body Sinfo is
return Flag11 (N);
end Has_Private_View;
+ function Has_Relative_Deadline_Pragma
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Subprogram_Body
+ or else NT (N).Nkind = N_Task_Definition);
+ return Flag9 (N);
+ end Has_Relative_Deadline_Pragma;
+
function Has_Self_Reference
(N : Node_Id) return Boolean is
begin
@@ -1980,6 +1989,14 @@ package body Sinfo is
return Node4 (N);
end Next_Named_Actual;
+ function Next_Pragma
+ (N : Node_Id) return Node_Id is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Pragma);
+ return Node1 (N);
+ end Next_Pragma;
+
function Next_Rep_Item
(N : Node_Id) return Node_Id is
begin
@@ -2184,6 +2201,14 @@ package body Sinfo is
return Node4 (N);
end Parent_Spec;
+ function PPC_Enabled
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Pragma);
+ return Flag5 (N);
+ end PPC_Enabled;
+
function Position
(N : Node_Id) return Node_Id is
begin
@@ -4154,6 +4179,15 @@ package body Sinfo is
Set_Flag11 (N, Val);
end Set_Has_Private_View;
+ procedure Set_Has_Relative_Deadline_Pragma
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Subprogram_Body
+ or else NT (N).Nkind = N_Task_Definition);
+ Set_Flag9 (N, Val);
+ end Set_Has_Relative_Deadline_Pragma;
+
procedure Set_Has_Self_Reference
(N : Node_Id; Val : Boolean := True) is
begin
@@ -4719,6 +4753,14 @@ package body Sinfo is
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Next_Named_Actual;
+ procedure Set_Next_Pragma
+ (N : Node_Id; Val : Node_Id) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Pragma);
+ Set_Node1 (N, Val); -- semantic field, no parent set
+ end Set_Next_Pragma;
+
procedure Set_Next_Rep_Item
(N : Node_Id; Val : Node_Id) is
begin
@@ -4923,6 +4965,14 @@ package body Sinfo is
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Parent_Spec;
+ procedure Set_PPC_Enabled
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Pragma);
+ Set_Flag5 (N, Val);
+ end Set_PPC_Enabled;
+
procedure Set_Position
(N : Node_Id; Val : Node_Id) is
begin