]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
exp_util.adb: Minor reformatting from last change
authorRobert Dewar <dewar@gnat.com>
Wed, 5 Dec 2001 01:06:25 +0000 (01:06 +0000)
committerGeert Bosch <bosch@gcc.gnu.org>
Wed, 5 Dec 2001 01:06:25 +0000 (02:06 +0100)
* exp_util.adb: Minor reformatting from last change

* errout.adb (Check_For_Warning): For a Raised_Constraint_Error node
which is a rewriting of an expression, traverse the original
expression to remove warnings that may have been posted on it.

From-SVN: r47639

gcc/ada/ChangeLog
gcc/ada/errout.adb
gcc/ada/exp_util.adb

index 0f72ac5f331f3e35f9e1b3b0c6431a019da4c84a..02bc72d4575624cc4a041afbcb1ac42af9ebda30 100644 (file)
@@ -1,3 +1,11 @@
+2001-12-04  Robert Dewar <dewar@gnat.com>
+
+       * exp_util.adb: Minor reformatting from last change
+       
+       * errout.adb (Check_For_Warning): For a Raised_Constraint_Error node 
+       which is a rewriting of an expression, traverse the original 
+       expression to remove warnings that may have been posted on it.
+
 2001-12-04  Ed Schonberg <schonber@gnat.com>
 
        * exp_util.adb (Must_Be_Aligned): Return false for a component of a 
index ad64a5fa30af78c27d1dff173d6c59d119bd4801..28b0c4c212ad953607b1ebdb729225655c16fc4d 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                            $Revision: 1.208 $
+--                            $Revision$
 --                                                                          --
 --          Copyright (C) 1992-2001 Free Software Foundation, Inc.          --
 --                                                                          --
@@ -1981,7 +1981,30 @@ package body Errout is
             E := Errors.Table (E).Next;
          end loop;
 
-         return OK;
+         if Nkind (N) = N_Raise_Constraint_Error
+           and then Original_Node (N) /= N
+         then
+
+            --  Warnings may have been posted on subexpressions of
+            --  the original tree. We temporarily replace the raise
+            --  statement with the original expression to remove
+            --  those warnings, whose sloc do not match those of
+            --  any node in the current tree.
+
+            declare
+               Old : Node_Id := N;
+               Status : Traverse_Result;
+
+            begin
+               Rewrite (N, Original_Node (N));
+               Status := Check_For_Warning (N);
+               Rewrite (N, Old);
+               return Status;
+            end;
+
+         else
+            return OK;
+         end if;
       end Check_For_Warning;
 
    --  Start of processing for Remove_Warning_Messages
index 4cdd988aeebf363036b06f94b5bdbab330bc1b80..a0a4d01b1ed85ef1745da2f714da27333ac39d3d 100644 (file)
@@ -2503,9 +2503,14 @@ package body Exp_Util is
       --  choose to pack the rest of the record. Lead to less efficient code,
       --  but safer vis-a-vis of back-end choices.
 
+      -----------------------------
+      -- Partially_Packed_Record --
+      -----------------------------
+
       function In_Partially_Packed_Record (Comp : Entity_Id) return Boolean is
-         Rec_Type : constant Entity_Id := Scope (Comp);
+         Rec_Type  : constant Entity_Id := Scope (Comp);
          Prev_Comp : Entity_Id;
+
       begin
          Prev_Comp := First_Entity (Rec_Type);
          while Present (Prev_Comp) loop
@@ -2521,6 +2526,9 @@ package body Exp_Util is
 
          return False;
       end  In_Partially_Packed_Record;
+
+   --  Start of processing for Must_Be_Aligned
+
    begin
       --  If object is strictly aligned, we can quit now