[multiple changes]

2009-07-10  Arnaud Charlet  <charlet@adacore.com>

	* i-cexten.ads (bool): New type.

2009-07-10  Robert Dewar  <dewar@adacore.com>

	* 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)

From-SVN: r149467
This commit is contained in:
Arnaud Charlet 2009-07-10 11:36:00 +02:00
parent 7b4db06cee
commit 514d0fc530
8 changed files with 32 additions and 14 deletions

View File

@ -1,3 +1,14 @@
2009-07-10 Arnaud Charlet <charlet@adacore.com>
* i-cexten.ads (bool): New type.
2009-07-10 Robert Dewar <dewar@adacore.com>
* 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 <miranda@adacore.com>
* exp_ch3.adb (Expand_Freeze_Record_Type): Handle constructors of

View File

@ -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;

View File

@ -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));

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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