summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-10 09:36:00 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-10 09:36:00 +0000
commite777155693d6c822bf12ef4958b3c4ab1fea9ec6 (patch)
tree2e90045d7a29dd6aff6b7a5001210cf52503c6d9
parent2f82b41a94d8ff46b3a9ef7fc11e6f49bd890dae (diff)
downloadgcc-e777155693d6c822bf12ef4958b3c4ab1fea9ec6.tar.gz
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) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149467 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/i-cexten.ads8
-rw-r--r--gcc/ada/sem_ch13.adb2
-rw-r--r--gcc/ada/sem_ch6.adb2
-rw-r--r--gcc/ada/sem_eval.adb5
-rw-r--r--gcc/ada/sem_res.adb2
-rw-r--r--gcc/ada/sinfo.ads11
-rw-r--r--gcc/ada/treepr.adb5
8 files changed, 32 insertions, 14 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index bdcea231591..fa118449c01 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/i-cexten.ads b/gcc/ada/i-cexten.ads
index 9f95e9f3a82..93f8dc68b51 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 c61421dbcc6..8f4d6eeb1ec 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 2fa6cf81918..29dd6e5ed6d 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 1e948f09566..d06d1d081fc 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 14ec28d4bc8..7c3eff5a9ac 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 ad96467e61b..4aafa5959d4 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 5fb53ae339e..c2f0770f29e 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