diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index bdcea2315918..fa118449c015 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2009-07-10 Arnaud Charlet + + * i-cexten.ads (bool): New type. + +2009-07-10 Robert Dewar + + * sinfo.ads (N_Short_Circuit): New definition + + * sem_ch13.adb, sem_ch6.adb, sem_eval.adb, sem_res.adb, + treepr.adb: Minor code reorganization (use N_Short_Circuit) + 2009-07-10 Javier Miranda * exp_ch3.adb (Expand_Freeze_Record_Type): Handle constructors of diff --git a/gcc/ada/i-cexten.ads b/gcc/ada/i-cexten.ads index 9f95e9f3a82c..93f8dc68b515 100644 --- a/gcc/ada/i-cexten.ads +++ b/gcc/ada/i-cexten.ads @@ -36,6 +36,8 @@ with System; package Interfaces.C.Extensions is + -- Following 7 declarations need comments ??? + subtype void is System.Address; subtype void_ptr is System.Address; @@ -45,16 +47,14 @@ package Interfaces.C.Extensions is subtype incomplete_class_def is System.Address; type incomplete_class_def_ptr is access incomplete_class_def; - -- + subtype bool is plain_char; + -- 64bit integer types - -- subtype long_long is Long_Long_Integer; type unsigned_long_long is mod 2 ** 64; - -- -- Types for bitfields - -- type Unsigned_1 is mod 2 ** 1; for Unsigned_1'Size use 1; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index c61421dbcc60..8f4d6eeb1ec0 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -3225,7 +3225,7 @@ package body Sem_Ch13 is when N_Null => return; - when N_Binary_Op | N_And_Then | N_Or_Else | N_Membership_Test => + when N_Binary_Op | N_Short_Circuit | N_Membership_Test => Check_Expr_Constants (Left_Opnd (Nod)); Check_Expr_Constants (Right_Opnd (Nod)); diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 2fa6cf819187..29dd6e5ed6d1 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -6083,7 +6083,7 @@ package body Sem_Ch6 is and then FCE (Left_Opnd (E1), Left_Opnd (E2)) and then FCE (Right_Opnd (E1), Right_Opnd (E2)); - when N_And_Then | N_Or_Else | N_Membership_Test => + when N_Short_Circuit | N_Membership_Test => return FCE (Left_Opnd (E1), Left_Opnd (E2)) and then diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 1e948f09566b..d06d1d081fcb 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -2905,7 +2905,8 @@ package body Sem_Eval is Left_Int := Expr_Value (Left); if (Kind = N_And_Then and then Is_False (Left_Int)) - or else (Kind = N_Or_Else and Is_True (Left_Int)) + or else + (Kind = N_Or_Else and then Is_True (Left_Int)) then Fold_Uint (N, Left_Int, Rstat); return; @@ -4955,7 +4956,7 @@ package body Sem_Eval is "(RM 4.9(5))!", N, E); end if; - when N_Binary_Op | N_And_Then | N_Or_Else | N_Membership_Test => + when N_Binary_Op | N_Short_Circuit | N_Membership_Test => if Nkind (N) in N_Op_Shift then Error_Msg_N ("shift functions are never static (RM 4.9(6,18))!", N); diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 14ec28d4bc84..7c3eff5a9ac7 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -2492,7 +2492,7 @@ package body Sem_Res is when N_Allocator => Resolve_Allocator (N, Ctx_Type); - when N_And_Then | N_Or_Else + when N_Short_Circuit => Resolve_Short_Circuit (N, Ctx_Type); when N_Attribute_Reference diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index ad96467e61b3..4aafa5959d40 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -7044,16 +7044,19 @@ package Sinfo is N_In, N_Not_In, - -- N_Subexpr, N_Has_Etype + -- N_Subexpr, N_Has_Etype, N_Short_Circuit N_And_Then, + N_Or_Else, + + -- N_Subexpr, N_Has_Etype + N_Conditional_Expression, N_Explicit_Dereference, N_Function_Call, N_Indexed_Component, N_Integer_Literal, N_Null, - N_Or_Else, N_Procedure_Call_Statement, N_Qualified_Expression, @@ -7438,6 +7441,10 @@ package Sinfo is N_At_Clause .. N_Attribute_Definition_Clause; + subtype N_Short_Circuit is Node_Kind range + N_And_Then .. + N_Or_Else; + subtype N_Statement_Other_Than_Procedure_Call is Node_Kind range N_Abort_Statement .. N_If_Statement; diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb index 5fb53ae339ea..c2f0770f29e5 100644 --- a/gcc/ada/treepr.adb +++ b/gcc/ada/treepr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2009, 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- -- @@ -949,8 +949,7 @@ package body Treepr is -- Deal with Left_Opnd and Right_Opnd fields if Nkind (N) in N_Op - or else Nkind (N) = N_And_Then - or else Nkind (N) = N_Or_Else + or else Nkind (N) in N_Short_Circuit or else Nkind (N) in N_Membership_Test then -- Print Left_Opnd if present