OSDN Git Service

2009-07-10 Arnaud Charlet <charlet@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Jul 2009 09:36:00 +0000 (09:36 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Jul 2009 09:36:00 +0000 (09:36 +0000)
* 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

gcc/ada/ChangeLog
gcc/ada/i-cexten.ads
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_eval.adb
gcc/ada/sem_res.adb
gcc/ada/sinfo.ads
gcc/ada/treepr.adb

index bdcea23..fa11844 100644 (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
index 9f95e9f..93f8dc6 100644 (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;
index c61421d..8f4d6ee 100644 (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));
 
index 2fa6cf8..29dd6e5 100644 (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
index 1e948f0..d06d1d0 100644 (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);
index 14ec28d..7c3eff5 100644 (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
index ad96467..4aafa59 100644 (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;
index 5fb53ae..c2f0770 100644 (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