aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/atree.ads
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2015-01-07 08:41:47 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2015-01-07 09:41:47 +0100
commit8636f52f7b50176948646cc151bfd514b8b71c03 (patch)
tree39cc0e2d60bd238be63e41b7c58c3559dddab13f /gcc/ada/atree.ads
parent4a9a42abc4f30bd63ef666e972dcbce0f05f0d0d (diff)
downloadgcc-8636f52f7b50176948646cc151bfd514b8b71c03.zip
gcc-8636f52f7b50176948646cc151bfd514b8b71c03.tar.gz
gcc-8636f52f7b50176948646cc151bfd514b8b71c03.tar.bz2
2015-01-07 Hristian Kirtchev <kirtchev@adacore.com>
* alloc.ads Alphabetize several declarations. Add constants Ignored_Ghost_Units_Initial and Ignored_Ghost_Units_Increment. * atree.adb Add with and use clauses for Opt. (Allocate_Initialize_Node): Mark a node as ignored Ghost if it is created in an ignored Ghost region. (Ekind_In): New variant. (Is_Ignored_Ghost_Node): New routine. (Set_Is_Ignored_Ghost_Node): New routine. * atree.adb Aplhabetize several subprograms declarations. Flag Spare0 is now known as Is_Ignored_Ghost_Node. (Ekind_In): New variant. (Is_Ignored_Ghost_Node): New routine. (Set_Is_Ignored_Ghost_Node): New routine. * einfo.adb: Flag 279 is now known as Contains_Ignored_Ghost_Code. (Contains_Ignored_Ghost_Code): New routine. (Set_Contains_Ignored_Ghost_Code): New routine. (Set_Is_Checked_Ghost_Entity, Set_Is_Ignored_Ghost_Entity): It is now possible to set this property on an unanalyzed entity. (Write_Entity_Flags): Output the status of flag Contains_Ignored_Ghost_Code. * einfo.ads New attribute Contains_Ignored_Ghost_Code along with usage in nodes. (Contains_Ignored_Ghost_Code): New routine along with pragma Inline. (Set_Contains_Ignored_Ghost_Code): New routine along with pragma Inline. * exp_ch3.adb Add with and use clauses for Ghost. (Freeze_Type): Capture/restore the value of Ghost_Mode on entry/exit. Set the Ghost_Mode in effect. (Restore_Globals): New routine. * exp_ch7.adb (Process_Declarations): Do not process a context that invoves an ignored Ghost entity. * exp_dbug.adb (Qualify_All_Entity_Names): Skip an ignored Ghost construct that has been rewritten as a null statement. * exp_disp.adb Add with and use clauses for Ghost. (Make_DT): Capture/restore the value of Ghost_Mode on entry/exit. Set the Ghost_Mode in effect. (Restore_Globals): New routine. * exp_util.adb (Requires_Cleanup_Actions): An ignored Ghost entity does not require any clean up. Add two missing cases that deal with block statements. * freeze.adb Add with and use clauses for Ghost. (Freeze_Entity): Capture/restore the value of Ghost_Mode on entry/exit. Set the Ghost_Mode in effect. (Restore_Globals): New routine. * frontend.adb Add with and use clauses for Ghost. Remove any ignored Ghost code from all units that qualify. * ghost.adb New unit. * ghost.ads New unit. * gnat1drv.adb Add with clause for Ghost. Initialize and lock the table in package Ghost. * lib.ads: Alphabetize several subprogram declarations. * lib-xref.adb (Output_References): Do not generate reference information for ignored Ghost entities. * opt.ads Add new type Ghost_Mode_Type and new global variable Ghost_Mode. * rtsfind.adb (Load_RTU): Provide a clean environment when loading a runtime unit. * sem.adb (Analyze): Capture/restore the value of Ghost_Mode on entry/exit as the node may set a different mode. (Do_Analyze): Capture/restore the value of Ghost_Mode on entry/exit as the unit may be withed from a unit with a different Ghost mode. * sem_ch3.adb Add with and use clauses for Ghost. (Analyze_Full_Type_Declaration, Analyze_Incomplete_Type_Decl, Analyze_Number_Declaration, Analyze_Private_Extension_Declaration, Analyze_Subtype_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. (Array_Type_Declaration): The implicit base type inherits the "ghostness" from the array type. (Derive_Subprogram): The alias inherits the "ghostness" from the parent subprogram. (Make_Implicit_Base): The implicit base type inherits the "ghostness" from the parent type. * sem_ch5.adb Add with and use clauses for Ghost. (Analyze_Assignment): Set the Ghost_Mode in effect. * sem_ch6.adb Add with and use clauses for Ghost. (Analyze_Abstract_Subprogram_Declaration, Analyze_Procedure_Call, Analyze_Subprogram_Body_Helper, Analyze_Subprogram_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_ch7.adb Add with and use clauses for Ghost. (Analyze_Package_Body_Helper, Analyze_Package_Declaration, Analyze_Private_Type_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_ch8.adb Add with and use clauses for Ghost. (Analyze_Exception_Renaming, Analyze_Generic_Renaming, Analyze_Object_Renaming, Analyze_Package_Renaming, Analyze_Subprogram_Renaming): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. (Find_Type): Check the Ghost context of a type. * sem_ch11.adb Add with and use clauses for Ghost. (Analyze_Exception_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_ch12.adb Add with and use clauses for Ghost. (Analyze_Generic_Package_Declaration, Analyze_Generic_Subprogram_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_prag.adb Add with and use clauses for Ghost. (Analyze_Pragma): Ghost-related checks are triggered when there is a Ghost mode in effect. (Create_Abstract_State): Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_res.adb Add with and use clauses for Ghost. (Check_Ghost_Context): Removed. * sem_util.adb (Check_Ghost_Completion): Removed. (Check_Ghost_Derivation): Removed. (Incomplete_Or_Partial_View): Add a guard in case the entity has not been analyzed yet and does carry a scope. (Is_Declaration): New routine. (Is_Ghost_Entity): Removed. (Is_Ghost_Statement_Or_Pragma): Removed. (Is_Subject_To_Ghost): Removed. (Set_Is_Ghost_Entity): Removed. (Within_Ghost_Scope): Removed. * sem_util.adb (Check_Ghost_Completion): Removed. (Check_Ghost_Derivation): Removed. (Is_Declaration): New routine. (Is_Ghost_Entity): Removed. (Is_Ghost_Statement_Or_Pragma): Removed. (Is_Subject_To_Ghost): Removed. (Set_Is_Ghost_Entity): Removed. (Within_Ghost_Scope): Removed. * sinfo.ads Add a section on Ghost mode. * treepr.adb (Print_Header_Flag): New routine. (Print_Node_Header): Factor out code. Output flag Is_Ignored_Ghost_Node. * gcc-interface/Make-lang.in: Add dependency for unit Ghost. From-SVN: r219280
Diffstat (limited to 'gcc/ada/atree.ads')
-rw-r--r--gcc/ada/atree.ads104
1 files changed, 70 insertions, 34 deletions
diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index 3bc71f5..7d2e64f 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -605,42 +605,46 @@ package Atree is
-- The following functions return the contents of the indicated field of
-- the node referenced by the argument, which is a Node_Id.
- function Nkind (N : Node_Id) return Node_Kind;
- pragma Inline (Nkind);
-
function Analyzed (N : Node_Id) return Boolean;
pragma Inline (Analyzed);
- function Has_Aspects (N : Node_Id) return Boolean;
- pragma Inline (Has_Aspects);
-
function Comes_From_Source (N : Node_Id) return Boolean;
pragma Inline (Comes_From_Source);
function Error_Posted (N : Node_Id) return Boolean;
pragma Inline (Error_Posted);
- function Sloc (N : Node_Id) return Source_Ptr;
- pragma Inline (Sloc);
+ function Has_Aspects (N : Node_Id) return Boolean;
+ pragma Inline (Has_Aspects);
- function Paren_Count (N : Node_Id) return Nat;
- pragma Inline (Paren_Count);
+ function Is_Ignored_Ghost_Node
+ (N : Node_Id) return Boolean;
+ pragma Inline (Is_Ignored_Ghost_Node);
- function Parent (N : Node_Id) return Node_Id;
- pragma Inline (Parent);
- -- Returns the parent of a node if the node is not a list member, or else
- -- the parent of the list containing the node if the node is a list member.
+ function Nkind (N : Node_Id) return Node_Kind;
+ pragma Inline (Nkind);
function No (N : Node_Id) return Boolean;
pragma Inline (No);
-- Tests given Id for equality with the Empty node. This allows notations
-- like "if No (Variant_Part)" as opposed to "if Variant_Part = Empty".
+ function Parent (N : Node_Id) return Node_Id;
+ pragma Inline (Parent);
+ -- Returns the parent of a node if the node is not a list member, or else
+ -- the parent of the list containing the node if the node is a list member.
+
+ function Paren_Count (N : Node_Id) return Nat;
+ pragma Inline (Paren_Count);
+
function Present (N : Node_Id) return Boolean;
pragma Inline (Present);
-- Tests given Id for inequality with the Empty node. This allows notations
-- like "if Present (Statement)" as opposed to "if Statement /= Empty".
+ function Sloc (N : Node_Id) return Source_Ptr;
+ pragma Inline (Sloc);
+
---------------------
-- Node_Kind Tests --
---------------------
@@ -785,6 +789,18 @@ package Atree is
V8 : Entity_Kind) return Boolean;
function Ekind_In
+ (E : Entity_Id;
+ V1 : Entity_Kind;
+ V2 : Entity_Kind;
+ V3 : Entity_Kind;
+ V4 : Entity_Kind;
+ V5 : Entity_Kind;
+ V6 : Entity_Kind;
+ V7 : Entity_Kind;
+ V8 : Entity_Kind;
+ V9 : Entity_Kind) return Boolean;
+
+ function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind) return Boolean;
@@ -840,6 +856,18 @@ package Atree is
V7 : Entity_Kind;
V8 : Entity_Kind) return Boolean;
+ function Ekind_In
+ (T : Entity_Kind;
+ V1 : Entity_Kind;
+ V2 : Entity_Kind;
+ V3 : Entity_Kind;
+ V4 : Entity_Kind;
+ V5 : Entity_Kind;
+ V6 : Entity_Kind;
+ V7 : Entity_Kind;
+ V8 : Entity_Kind;
+ V9 : Entity_Kind) return Boolean;
+
pragma Inline (Ekind_In);
-- Inline all above functions
@@ -865,39 +893,42 @@ package Atree is
-- to be set in the specified field. Note that Set_Nkind is in the next
-- section, since its use is restricted.
- procedure Set_Sloc (N : Node_Id; Val : Source_Ptr);
- pragma Inline (Set_Sloc);
-
- procedure Set_Paren_Count (N : Node_Id; Val : Nat);
- pragma Inline (Set_Paren_Count);
-
- procedure Set_Parent (N : Node_Id; Val : Node_Id);
- pragma Inline (Set_Parent);
-
- procedure Set_Analyzed (N : Node_Id; Val : Boolean := True);
+ procedure Set_Analyzed (N : Node_Id; Val : Boolean := True);
pragma Inline (Set_Analyzed);
- procedure Set_Error_Posted (N : Node_Id; Val : Boolean := True);
- pragma Inline (Set_Error_Posted);
-
procedure Set_Comes_From_Source (N : Node_Id; Val : Boolean);
pragma Inline (Set_Comes_From_Source);
- -- Note that this routine is very rarely used, since usually the
- -- default mechanism provided sets the right value, but in some
- -- unusual cases, the value needs to be reset (e.g. when a source
- -- node is copied, and the copy must not have Comes_From_Source set).
+ -- Note that this routine is very rarely used, since usually the default
+ -- mechanism provided sets the right value, but in some unusual cases, the
+ -- value needs to be reset (e.g. when a source node is copied, and the copy
+ -- must not have Comes_From_Source set).
+
+ procedure Set_Error_Posted (N : Node_Id; Val : Boolean := True);
+ pragma Inline (Set_Error_Posted);
procedure Set_Has_Aspects (N : Node_Id; Val : Boolean := True);
pragma Inline (Set_Has_Aspects);
+ procedure Set_Is_Ignored_Ghost_Node (N : Node_Id; Val : Boolean := True);
+ pragma Inline (Set_Is_Ignored_Ghost_Node);
+
procedure Set_Original_Node (N : Node_Id; Val : Node_Id);
pragma Inline (Set_Original_Node);
-- Note that this routine is used only in very peculiar cases. In normal
-- cases, the Original_Node link is set by calls to Rewrite. We currently
- -- use it in ASIS mode to manually set the link from pragma expressions
- -- to their aspect original source expressions, so that the original source
+ -- use it in ASIS mode to manually set the link from pragma expressions to
+ -- their aspect original source expressions, so that the original source
-- expressions accessed by ASIS are also semantically analyzed.
+ procedure Set_Parent (N : Node_Id; Val : Node_Id);
+ pragma Inline (Set_Parent);
+
+ procedure Set_Paren_Count (N : Node_Id; Val : Nat);
+ pragma Inline (Set_Paren_Count);
+
+ procedure Set_Sloc (N : Node_Id; Val : Source_Ptr);
+ pragma Inline (Set_Sloc);
+
------------------------------
-- Entity Update Procedures --
------------------------------
@@ -4007,7 +4038,12 @@ package Atree is
Flag1 : Boolean;
Flag2 : Boolean;
Flag3 : Boolean;
- Spare0 : Boolean;
+
+ Is_Ignored_Ghost_Node : Boolean;
+ -- Flag denothing whether the node is subject to pragma Ghost with
+ -- policy Ignore. The name of the flag should be Flag4, however this
+ -- requires changing the names of all remaining 300+ flags.
+
Spare1 : Boolean;
Spare2 : Boolean;
Spare3 : Boolean;