aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/einfo.adb
diff options
context:
space:
mode:
authorGeert Bosch <bosch@gcc.gnu.org>2001-12-04 17:55:48 +0100
committerGeert Bosch <bosch@gcc.gnu.org>2001-12-04 17:55:48 +0100
commit0839863cfad677645b112db8c6bdc4153768412d (patch)
treedcfc83ee806b8d2ab5b64ddf5adb4fb3ee1d6b89 /gcc/ada/einfo.adb
parent9678de4977f3ea4a80bd40e05d62ce6b7d7ead23 (diff)
downloadgcc-0839863cfad677645b112db8c6bdc4153768412d.zip
gcc-0839863cfad677645b112db8c6bdc4153768412d.tar.gz
gcc-0839863cfad677645b112db8c6bdc4153768412d.tar.bz2
einfo.adb (Has_Pragma_Pure_Function): New flag.
* einfo.adb (Has_Pragma_Pure_Function): New flag. Fix problem that stopped ceinfo from working * einfo.ads (Has_Pragma_Pure_Function): New flag. * sem_prag.adb (Pure_Function): Set new flag Has_Pragma_Pure_Function. From-SVN: r47614
Diffstat (limited to 'gcc/ada/einfo.adb')
-rw-r--r--gcc/ada/einfo.adb26
1 files changed, 18 insertions, 8 deletions
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index b81df9b..eaa362e 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -58,23 +58,20 @@ package body Einfo is
-- Four of these fields are defined in Sinfo, since they in are the
-- base part of the node. The access routines for these fields and
-- the corresponding set procedures are defined in Sinfo. These fields
- -- are present in all entities.
+ -- are present in all entities. Note that Homonym is also in the base
+ -- part of the node, but has access routines that are more properly
+ -- part of Einfo, which is why they are defined here.
-- Chars Name1
-- Next_Entity Node2
-- Scope Node3
-- Etype Node5
- -- The fifth field is also in the base part of the node, but it
- -- carries some additional semantic checks and its subprograms are
- -- more properly defined in Einfo.
-
- -- Homonym Node4
-
-- Remaining fields are present only in extended nodes (i.e. entities)
-- The following fields are present in all entities
+ -- Homonym Node4
-- First_Rep_Item Node6
-- Freeze_Node Node7
@@ -397,8 +394,8 @@ package body Einfo is
-- Is_Discrim_SO_Function Flag176
-- Size_Depends_On_Discriminant Flag177
-- Is_Null_Init_Proc Flag178
+ -- Has_Pragma_Pure_Function Flag179
- -- (unused) Flag179
-- (unused) Flag180
-- (unused) Flag181
-- (unused) Flag182
@@ -1087,6 +1084,12 @@ package body Einfo is
return Flag121 (Implementation_Base_Type (Id));
end Has_Pragma_Pack;
+ function Has_Pragma_Pure_Function (Id : E) return B is
+ begin
+ pragma Assert (Is_Subprogram (Id));
+ return Flag179 (Id);
+ end Has_Pragma_Pure_Function;
+
function Has_Primitive_Operations (Id : E) return B is
begin
pragma Assert (Is_Type (Id));
@@ -2924,6 +2927,12 @@ package body Einfo is
Set_Flag121 (Implementation_Base_Type (Id), V);
end Set_Has_Pragma_Pack;
+ procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
+ begin
+ pragma Assert (Is_Subprogram (Id));
+ Set_Flag179 (Id, V);
+ end Set_Has_Pragma_Pure_Function;
+
procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
begin
pragma Assert (Is_Type (Id));
@@ -5835,6 +5844,7 @@ package body Einfo is
W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
W ("Has_Pragma_Inline", Flag157 (Id));
W ("Has_Pragma_Pack", Flag121 (Id));
+ W ("Has_Pragma_Pure_Function", Flag179 (Id));
W ("Has_Primitive_Operations", Flag120 (Id));
W ("Has_Private_Declaration", Flag155 (Id));
W ("Has_Qualified_Name", Flag161 (Id));