aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2010-10-21 10:30:24 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-21 12:30:24 +0200
commitfd0ff1cf7e35b91797be21997ab3d75f3b980873 (patch)
tree82e1e9c9a50526d9512c41952beb3d596c952bb7 /gcc/ada/sem_ch6.adb
parent04cbd48e9ed3fbd4c66f7ebc829276b5b83932a5 (diff)
downloadgcc-fd0ff1cf7e35b91797be21997ab3d75f3b980873.zip
gcc-fd0ff1cf7e35b91797be21997ab3d75f3b980873.tar.gz
gcc-fd0ff1cf7e35b91797be21997ab3d75f3b980873.tar.bz2
einfo.ads, einfo.adb: Add handling of predicates.
2010-10-21 Robert Dewar <dewar@adacore.com> * einfo.ads, einfo.adb: Add handling of predicates. Rework handling of invariants. * exp_ch3.adb, exp_ch4.adb, exp_util.adb, sem_ch6.adb: Minor changes to handing of invariants. * par-prag.adb: Add dummy entry for pragma Predicate * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for Predicate aspects. * sem_prag.adb: Add implementation of pragma Predicate. * snames.ads-tmpl: Add entries for pragma Predicate. 2010-10-21 Robert Dewar <dewar@adacore.com> * elists.adb: Minor reformatting. From-SVN: r165763
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r--gcc/ada/sem_ch6.adb5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 0f2fce8..fe2e197 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -9099,7 +9099,9 @@ package body Sem_Ch6 is
-- Add invariant call if returning type with invariants
- if Present (Invariant_Procedure (Etype (Rent))) then
+ if Has_Invariants (Etype (Rent))
+ and then Present (Invariant_Procedure (Etype (Rent)))
+ then
Append_To (Plist,
Make_Invariant_Call (New_Occurrence_Of (Rent, Loc)));
end if;
@@ -9121,6 +9123,7 @@ package body Sem_Ch6 is
Formal := First_Formal (Designator);
while Present (Formal) loop
if Ekind (Formal) /= E_In_Parameter
+ and then Has_Invariants (Etype (Formal))
and then Present (Invariant_Procedure (Etype (Formal)))
then
Append_To (Plist,