summaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-06 10:28:07 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-06 10:28:07 +0000
commit378089464983e017bc55756470c487ac25fa4c55 (patch)
tree2aac9a39bc29def98b761c1e19d629191da83b42 /gcc/ada/sinfo.adb
parente0ec9373d584331140a7f3189857b94dacd76487 (diff)
downloadgcc-378089464983e017bc55756470c487ac25fa4c55.tar.gz
2007-04-20 Ed Schonberg <schonberg@adacore.com>
* exp_util.ads, exp_util.adb (Expand_Subtype_From_Expr): In Ada2005, an object of a limited type can be initialized with a call to a function that returns in place. If the limited type has unknown discriminants, and the underlying type is a constrained composite type, build an actual subtype from the function call, as is done for private types. (Side_Effect_Free): An expression that is the renaming of an object or whose prefix is the renaming of a object, is not side-effect free because it may be assigned through the renaming and its value must be captured in a temporary. (Has_Controlled_Coextensions): New routine. (Expand_Subtype_From_Expr): Do nothing if type is a limited interface, as is done for other limited types. (Non_Limited_Designated_Type): new predicate. (Make_CW_Equivalent_Type): Modified to handle class-wide interface objects. Remove all handling of with_type clauses. * par-ch10.adb: Remove all handling of with_type clauses. * lib-load.ads, lib-load.adb (Load_Main_Source): Do not get the checksum if the main source could not be parsed. (Loat_Unit): When processing a child unit, determine properly whether the parent unit is a renaming when the parent is itself a child unit. Remove handling of with_type clauses. * sinfo.ads, sinfo.adb (Is_Static_Coextension): New function. (Set_Is_Static_Coextension): New procedure. (Has_Local_Raise): New function (Set_Has_Local_Raise): New procedure (Renaming_Exception): New field (Has_Init_Expression): New flag (Delay_Finalize_Attach): Remove because flag is obsolete. (Set_Delay_Finalize_Attach): Remove because flag is obsolete. Remove all handling of with_type clauses. (Exception_Junk): Can now be set in N_Block_Statement git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125410 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sinfo.adb')
-rw-r--r--gcc/ada/sinfo.adb100
1 files changed, 73 insertions, 27 deletions
diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb
index 6d0f28917bf..58ae0456f3c 100644
--- a/gcc/ada/sinfo.adb
+++ b/gcc/ada/sinfo.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- --
@@ -727,14 +727,6 @@ package body Sinfo is
return Node4 (N);
end Delay_Alternative;
- function Delay_Finalize_Attach
- (N : Node_Id) return Boolean is
- begin
- pragma Assert (False
- or else NT (N).Nkind = N_Object_Declaration);
- return Flag14 (N);
- end Delay_Finalize_Attach;
-
function Delay_Statement
(N : Node_Id) return Node_Id is
begin
@@ -1101,11 +1093,12 @@ package body Sinfo is
(N : Node_Id) return Boolean is
begin
pragma Assert (False
+ or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Goto_Statement
or else NT (N).Nkind = N_Label
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Subtype_Declaration);
- return Flag7 (N);
+ return Flag8 (N);
end Exception_Junk;
function Exception_Label
@@ -1360,6 +1353,22 @@ package body Sinfo is
return Flag12 (N);
end Has_Dynamic_Range_Check;
+ function Has_Init_Expression
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Object_Declaration);
+ return Flag14 (N);
+ end Has_Init_Expression;
+
+ function Has_Local_Raise
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Exception_Handler);
+ return Flag8 (N);
+ end Has_Local_Raise;
+
function Has_No_Elaboration_Code
(N : Node_Id) return Boolean is
begin
@@ -1629,6 +1638,14 @@ package body Sinfo is
return Flag7 (N);
end Is_Protected_Subprogram_Body;
+ function Is_Static_Coextension
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Allocator);
+ return Flag14 (N);
+ end Is_Static_Coextension;
+
function Is_Static_Expression
(N : Node_Id) return Boolean is
begin
@@ -1900,8 +1917,7 @@ package body Sinfo is
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
or else NT (N).Nkind = N_Subunit
or else NT (N).Nkind = N_Variant_Part
- or else NT (N).Nkind = N_With_Clause
- or else NT (N).Nkind = N_With_Type_Clause);
+ or else NT (N).Nkind = N_With_Clause);
return Node2 (N);
end Name;
@@ -2348,6 +2364,14 @@ package body Sinfo is
return Flag13 (N);
end Redundant_Use;
+ function Renaming_Exception
+ (N : Node_Id) return Node_Id is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Exception_Declaration);
+ return Node2 (N);
+ end Renaming_Exception;
+
function Result_Definition
(N : Node_Id) return Node_Id is
begin
@@ -2576,8 +2600,7 @@ package body Sinfo is
or else NT (N).Nkind = N_Formal_Private_Type_Definition
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
- or else NT (N).Nkind = N_Record_Definition
- or else NT (N).Nkind = N_With_Type_Clause);
+ or else NT (N).Nkind = N_Record_Definition);
return Flag15 (N);
end Tagged_Present;
@@ -3412,14 +3435,6 @@ package body Sinfo is
Set_Node4_With_Parent (N, Val);
end Set_Delay_Alternative;
- procedure Set_Delay_Finalize_Attach
- (N : Node_Id; Val : Boolean := True) is
- begin
- pragma Assert (False
- or else NT (N).Nkind = N_Object_Declaration);
- Set_Flag14 (N, Val);
- end Set_Delay_Finalize_Attach;
-
procedure Set_Delay_Statement
(N : Node_Id; Val : Node_Id) is
begin
@@ -3777,11 +3792,12 @@ package body Sinfo is
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
+ or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Goto_Statement
or else NT (N).Nkind = N_Label
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Subtype_Declaration);
- Set_Flag7 (N, Val);
+ Set_Flag8 (N, Val);
end Set_Exception_Junk;
procedure Set_Exception_Label
@@ -4036,6 +4052,22 @@ package body Sinfo is
Set_Flag12 (N, Val);
end Set_Has_Dynamic_Range_Check;
+ procedure Set_Has_Init_Expression
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Object_Declaration);
+ Set_Flag14 (N, Val);
+ end Set_Has_Init_Expression;
+
+ procedure Set_Has_Local_Raise
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Exception_Handler);
+ Set_Flag8 (N, Val);
+ end Set_Has_Local_Raise;
+
procedure Set_Has_No_Elaboration_Code
(N : Node_Id; Val : Boolean := True) is
begin
@@ -4305,6 +4337,14 @@ package body Sinfo is
Set_Flag7 (N, Val);
end Set_Is_Protected_Subprogram_Body;
+ procedure Set_Is_Static_Coextension
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Allocator);
+ Set_Flag14 (N, Val);
+ end Set_Is_Static_Coextension;
+
procedure Set_Is_Static_Expression
(N : Node_Id; Val : Boolean := True) is
begin
@@ -4576,8 +4616,7 @@ package body Sinfo is
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
or else NT (N).Nkind = N_Subunit
or else NT (N).Nkind = N_Variant_Part
- or else NT (N).Nkind = N_With_Clause
- or else NT (N).Nkind = N_With_Type_Clause);
+ or else NT (N).Nkind = N_With_Clause);
Set_Node2_With_Parent (N, Val);
end Set_Name;
@@ -5024,6 +5063,14 @@ package body Sinfo is
Set_Flag13 (N, Val);
end Set_Redundant_Use;
+ procedure Set_Renaming_Exception
+ (N : Node_Id; Val : Node_Id) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Exception_Declaration);
+ Set_Node2 (N, Val);
+ end Set_Renaming_Exception;
+
procedure Set_Result_Definition
(N : Node_Id; Val : Node_Id) is
begin
@@ -5252,8 +5299,7 @@ package body Sinfo is
or else NT (N).Nkind = N_Formal_Private_Type_Definition
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
- or else NT (N).Nkind = N_Record_Definition
- or else NT (N).Nkind = N_With_Type_Clause);
+ or else NT (N).Nkind = N_Record_Definition);
Set_Flag15 (N, Val);
end Set_Tagged_Present;