]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sem_res.adb (Within_Subprogram_Call): Detect also nodes that appear in entry calls.
authorArnaud Charlet <charlet@adacore.com>
Tue, 19 Apr 2016 13:06:01 +0000 (13:06 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 19 Apr 2016 13:06:01 +0000 (15:06 +0200)
2016-04-19  Arnaud Charlet  <charlet@adacore.com>

* sem_res.adb (Within_Subprogram_Call): Detect
also nodes that appear in entry calls.
(Resolve_Actuals, Insert_Default): Propagate
dimension information if any, from default expression to the
copy that appears in the list of actuals.
* uintp.ads: minor whitespace fix in comment.
* sem_prag.adb, stringt.adb, inline.adb, lib-xref-spark_specific.adb:
Minor code cleanup.
* set_targ.adb (Set_Targ): convert directly from
Natural to Pos, without intermediate conversion to Int.

From-SVN: r235197

gcc/ada/ChangeLog
gcc/ada/inline.adb
gcc/ada/lib-xref-spark_specific.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_res.adb
gcc/ada/set_targ.adb
gcc/ada/stringt.adb
gcc/ada/uintp.ads

index 5f3e5c9bbd34477f4f699558fa3a1d5d3c184556..5be755baf5a3eaa66ccbd60908f60c8062881e40 100644 (file)
@@ -1,3 +1,16 @@
+2016-04-19  Arnaud Charlet  <charlet@adacore.com>
+
+       * sem_res.adb (Within_Subprogram_Call): Detect
+       also nodes that appear in entry calls.
+       (Resolve_Actuals, Insert_Default): Propagate
+       dimension information if any, from default expression to the
+       copy that appears in the list of actuals.
+       * uintp.ads: minor whitespace fix in comment.
+       * sem_prag.adb, stringt.adb, inline.adb, lib-xref-spark_specific.adb:
+       Minor code cleanup.
+       * set_targ.adb (Set_Targ): convert directly from
+       Natural to Pos, without intermediate conversion to Int.
+
 2016-04-19  Arnaud Charlet  <charlet@adacore.com>
 
        * sem_ch6.adb (Process_Formals): Mark suspicious reference to
index b3b5aba21fedd599cab1edaee1cbd392c7e3452d..7944604ae61d4f80d9a1edeb5f0eb392e8b9fd97 100644 (file)
@@ -2242,7 +2242,7 @@ package body Inline is
       Lab_Decl : Node_Id;
       Lab_Id   : Node_Id;
       New_A    : Node_Id;
-      Num_Ret  : Int := 0;
+      Num_Ret  : Nat := 0;
       Ret_Type : Entity_Id;
 
       Targ : Node_Id;
index f7409d9a916183f3f6950a513642837ec64baf01..dcd5e5620a17a06ddcce41088e5213317a908d51 100644 (file)
@@ -870,8 +870,8 @@ package body SPARK_Specific is
                Line := 0;
                Col  := 0;
             else
-               Line := Int (Get_Logical_Line_Number (Ref_Entry.Def));
-               Col  := Int (Get_Column_Number (Ref_Entry.Def));
+               Line := Nat (Get_Logical_Line_Number (Ref_Entry.Def));
+               Col  := Nat (Get_Column_Number (Ref_Entry.Def));
             end if;
 
             --  References to constant objects without variable inputs (see
@@ -895,9 +895,9 @@ package body SPARK_Specific is
                Entity_Col  => Col,
                File_Num    => Dependency_Num (Ref.Lun),
                Scope_Num   => Get_Scope_Num (Ref.Ref_Scope),
-               Line        => Int (Get_Logical_Line_Number (Ref.Loc)),
+               Line        => Nat (Get_Logical_Line_Number (Ref.Loc)),
                Rtype       => Typ,
-               Col         => Int (Get_Column_Number (Ref.Loc))));
+               Col         => Nat (Get_Column_Number (Ref.Loc))));
          end;
       end loop;
 
index 74c691539e5154d7ab649a69eb640e847e2e6a1c..e965976a69135501df880ae86e9c2fae2503d4ff 100644 (file)
@@ -6698,7 +6698,7 @@ package body Sem_Prag is
                declare
                   Str   : constant String_Id :=
                             Strval (Get_Pragma_Arg (Arg2));
-                  Len   : constant Int := String_Length (Str);
+                  Len   : constant Nat := String_Length (Str);
                   Cont  : Boolean;
                   Ptr   : Nat;
                   CC    : Char_Code;
@@ -21237,7 +21237,7 @@ package body Sem_Prag is
                Check_Arg_Count (1);
 
                if Nkind (A) = N_String_Literal then
-                  S   := Strval (A);
+                  S := Strval (A);
 
                   declare
                      Slen    : constant Natural := Natural (String_Length (S));
@@ -28802,10 +28802,10 @@ package body Sem_Prag is
 
    procedure Set_Encoded_Interface_Name (E : Entity_Id; S : Node_Id) is
       Str : constant String_Id := Strval (S);
-      Len : constant Int       := String_Length (Str);
+      Len : constant Nat       := String_Length (Str);
       CC  : Char_Code;
       C   : Character;
-      J   : Int;
+      J   : Pos;
 
       Hex : constant array (0 .. 15) of Character := "0123456789abcdef";
 
index 3fa505168ce0f2312d6ce320f131773fbc514bdf..0bac1eb181656e972f5a3c9106b2af6c8fea8b81 100644 (file)
@@ -3379,6 +3379,10 @@ package body Sem_Res is
                  New_Scope => Current_Scope,
                  New_Sloc  => Loc);
 
+            --  Propagate dimension information, if any.
+
+            Copy_Dimensions (Default_Value (F), Actval);
+
             if Is_Concurrent_Type (Scope (Nam))
               and then Has_Discriminants (Scope (Nam))
             then
@@ -6882,7 +6886,7 @@ package body Sem_Res is
          --  Determine whether an arbitrary node appears in a check node
 
          function Within_Subprogram_Call (Nod : Node_Id) return Boolean;
-         --  Determine whether an arbitrary node appears in a procedure call
+         --  Determine whether an arbitrary node appears in a subprogram call
 
          function Within_Volatile_Function (Id : Entity_Id) return Boolean;
          --  Determine whether an arbitrary entity appears in a volatile
@@ -6960,7 +6964,8 @@ package body Sem_Res is
             Par := Nod;
             while Present (Par) loop
                if Nkind_In (Par, N_Function_Call,
-                                 N_Procedure_Call_Statement)
+                                 N_Procedure_Call_Statement,
+                                 N_Entry_Call_Statement)
                then
                   return True;
 
index 4dbd735e97f9bd268688fca047afabe218892149..e83ccb41c4ab8e6d39cb125b2d8c025ec8f141b4 100755 (executable)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2013-2014, Free Software Foundation, Inc.         --
+--          Copyright (C) 2013-2015, 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- --
@@ -946,21 +946,21 @@ begin
                T : FPT_Mode_Entry renames
                  FPT_Mode_Table (FPT_Mode_Index_For (S_Float));
             begin
-               Float_Size := Int (T.SIZE);
+               Float_Size := Pos (T.SIZE);
             end;
 
             declare
                T : FPT_Mode_Entry renames
                  FPT_Mode_Table (FPT_Mode_Index_For (S_Long_Float));
             begin
-               Double_Size := Int (T.SIZE);
+               Double_Size := Pos (T.SIZE);
             end;
 
             declare
                T : FPT_Mode_Entry renames
                  FPT_Mode_Table (FPT_Mode_Index_For (S_Long_Long_Float));
             begin
-               Long_Double_Size := Int (T.SIZE);
+               Long_Double_Size := Pos (T.SIZE);
             end;
 
          end if;
index 5be78732cae06356d340721567ff52016f6cdf65..175b80c257d1b45b890d21f8165c9c495ddf9581 100644 (file)
@@ -241,7 +241,7 @@ package body Stringt is
       --  String_Chars table all at once.
 
       S_First  : constant Int := Strings.Table (S).String_Index;
-      S_Len    : constant Int := String_Length (S);
+      S_Len    : constant Nat := String_Length (S);
       Old_Last : constant Int := String_Chars.Last;
       New_Last : constant Int := Old_Last + S_Len;
 
index 1d90524b9a2a5122a1ebea6bd0805e243c28c4ea..a07fa08303919656ae0ebb573dcac43e768fd98e 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2014, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2015, 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- --
@@ -431,7 +431,7 @@ private
 
    --  Base is defined to allow efficient execution of the primitive operations
    --  (a0, b0, c0) defined in the section "The Classical Algorithms"
-   --  (sec. 4.3.1) of Donald Knuth's "The Art of Computer  Programming",
+   --  (sec. 4.3.1) of Donald Knuth's "The Art of Computer Programming",
    --  Vol. 2. These algorithms are used in this package. In particular,
    --  the product of two single digits in this base fits in a 32-bit integer.