aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2016-04-19 13:06:01 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-19 15:06:01 +0200
commite90e9503dff78ba8d3c31f01ef41ea8b75d953ee (patch)
tree444ab39e0c86868ee041112f28077983a34e4dd0 /gcc/ada
parentdb7e372172d0753acae272572f852eb6cd8135f4 (diff)
downloadgcc-e90e9503dff78ba8d3c31f01ef41ea8b75d953ee.zip
gcc-e90e9503dff78ba8d3c31f01ef41ea8b75d953ee.tar.gz
gcc-e90e9503dff78ba8d3c31f01ef41ea8b75d953ee.tar.bz2
sem_res.adb (Within_Subprogram_Call): Detect also nodes that appear in entry calls.
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
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog13
-rw-r--r--gcc/ada/inline.adb2
-rw-r--r--gcc/ada/lib-xref-spark_specific.adb8
-rw-r--r--gcc/ada/sem_prag.adb8
-rw-r--r--gcc/ada/sem_res.adb9
-rwxr-xr-xgcc/ada/set_targ.adb8
-rw-r--r--gcc/ada/stringt.adb2
-rw-r--r--gcc/ada/uintp.ads4
8 files changed, 36 insertions, 18 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5f3e5c9..5be755b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,18 @@
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
SPARK RM in comment.
* sem_prag.adb (Analyze_Global_Item): Fix reference to SPARK RM
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index b3b5aba..7944604 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -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;
diff --git a/gcc/ada/lib-xref-spark_specific.adb b/gcc/ada/lib-xref-spark_specific.adb
index f7409d9..dcd5e56 100644
--- a/gcc/ada/lib-xref-spark_specific.adb
+++ b/gcc/ada/lib-xref-spark_specific.adb
@@ -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;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 74c6915..e965976 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -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";
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 3fa5051..0bac1eb 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -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;
diff --git a/gcc/ada/set_targ.adb b/gcc/ada/set_targ.adb
index 4dbd735..e83ccb4 100755
--- a/gcc/ada/set_targ.adb
+++ b/gcc/ada/set_targ.adb
@@ -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;
diff --git a/gcc/ada/stringt.adb b/gcc/ada/stringt.adb
index 5be7873..175b80c 100644
--- a/gcc/ada/stringt.adb
+++ b/gcc/ada/stringt.adb
@@ -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;
diff --git a/gcc/ada/uintp.ads b/gcc/ada/uintp.ads
index 1d90524..a07fa08 100644
--- a/gcc/ada/uintp.ads
+++ b/gcc/ada/uintp.ads
@@ -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.