From 9bdc432ac2147536e4b0a59892002f1e5a4380cb Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 26 Oct 2015 14:01:25 +0100 Subject: [multiple changes] 2015-10-26 Javier Miranda * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Return False when generating C code. * sem_ch3.adb: Fix typos. 2015-10-26 Bob Duff * sem_ch13.adb (Build_Predicate_Functions): Change the structure of the predicate functions to reflect the requirements of AI12-0071. (Add_Condition): New procedure to do the "and-then-ing" in Add_Call and Add_Predicates. * einfo.ads (Static_Real_Or_String_Predicate): Change the documentation to reflect the new structure. * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Change the walking of the predicate expression to reflect the new structure. * exp_util.adb: Minor comment fix. From-SVN: r229352 --- gcc/ada/sem_eval.adb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gcc/ada/sem_eval.adb') diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index c4fe768..5110f16 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -5408,13 +5408,14 @@ package body Sem_Eval is -- First deal with special case of inherited predicate, where the -- predicate expression looks like: - -- Expr and then xxPredicate (typ (Ent)) + -- xxPredicate (typ (Ent)) and then Expr -- where Expr is the predicate expression for this level, and the - -- right operand is the call to evaluate the inherited predicate. + -- left operand is the call to evaluate the inherited predicate. if Nkind (Expr) = N_And_Then - and then Nkind (Right_Opnd (Expr)) = N_Function_Call + and then Nkind (Left_Opnd (Expr)) = N_Function_Call + and then Is_Predicate_Function (Entity (Name (Left_Opnd (Expr)))) then -- OK we have the inherited case, so make a call to evaluate the -- inherited predicate. If that fails, so do we! @@ -5422,14 +5423,14 @@ package body Sem_Eval is if not Real_Or_String_Static_Predicate_Matches (Val => Val, - Typ => Etype (First_Formal (Entity (Name (Right_Opnd (Expr)))))) + Typ => Etype (First_Formal (Entity (Name (Left_Opnd (Expr)))))) then return False; end if; - -- Use the left operand for the continued processing + -- Use the right operand for the continued processing - Copy := Copy_Separate_Tree (Left_Opnd (Expr)); + Copy := Copy_Separate_Tree (Right_Opnd (Expr)); -- Case where call to predicate function appears on its own (this means -- that the predicate at this level is just inherited from the parent). -- cgit v1.1