aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-08-01 15:47:34 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-08-01 15:47:34 +0200
commitbf0b0e5ee1c756b593f8e8d0456504575ac63218 (patch)
treee8a236c8e7a4c783a814ba81952ae78a2118a9b8 /gcc/ada/sem_res.adb
parent1eb5852081801218c02c934db5aa9852fc284645 (diff)
downloadgcc-bf0b0e5ee1c756b593f8e8d0456504575ac63218.zip
gcc-bf0b0e5ee1c756b593f8e8d0456504575ac63218.tar.gz
gcc-bf0b0e5ee1c756b593f8e8d0456504575ac63218.tar.bz2
[multiple changes]
2014-08-01 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb (Analyze_Attribute): Preanalyze and resolve the prefix of attribute Loop_Entry. * sem_prag.adb (Analyze_Pragma): Verify the placement of pragma Loop_Variant with respect to an enclosing loop (if any). (Contains_Loop_Entry): Update the parameter profile and all calls to this routine. * sem_res.adb (Resolve_Call): Code reformatting. Do not ask for the corresponding body before determining the nature of the ultimate alias's declarative node. 2014-08-01 Robert Dewar <dewar@adacore.com> * gnat1drv.adb, sem_ch4.adb: Minor reformatting. 2014-08-01 Robert Dewar <dewar@adacore.com> * sem_eval.adb (Rewrite_In_Raise_CE): Don't try to reuse inner constraint error node since it is a list member. 2014-08-01 Robert Dewar <dewar@adacore.com> * sem_warn.adb: Minor reformatting. 2014-08-01 Eric Botcazou <ebotcazou@adacore.com> * einfo.adb (Underlying_Type): Return the underlying full view of a private type if present. * freeze.adb (Freeze_Entity): Build a single freeze node for partial, full and underlying full views, if any. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Private_Type>: Add a missing guard before the access to the Underlying_Full_View. * gcc-interface/trans.c (process_freeze_entity): Deal with underlying full view if present. * gcc-interface/utils.c (make_dummy_type): Avoid superfluous work. From-SVN: r213463
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb46
1 files changed, 23 insertions, 23 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 92c8bfa..9509b23 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -5371,15 +5371,6 @@ package body Sem_Res is
------------------
procedure Resolve_Call (N : Node_Id; Typ : Entity_Id) is
- Loc : constant Source_Ptr := Sloc (N);
- Subp : constant Node_Id := Name (N);
- Nam : Entity_Id;
- I : Interp_Index;
- It : Interp;
- Norm_OK : Boolean;
- Scop : Entity_Id;
- Rtype : Entity_Id;
-
function Same_Or_Aliased_Subprograms
(S : Entity_Id;
E : Entity_Id) return Boolean;
@@ -5399,6 +5390,20 @@ package body Sem_Res is
return S = E or else (Present (Subp_Alias) and then Subp_Alias = E);
end Same_Or_Aliased_Subprograms;
+ -- Local variables
+
+ Loc : constant Source_Ptr := Sloc (N);
+ Subp : constant Node_Id := Name (N);
+ Body_Id : Entity_Id;
+ I : Interp_Index;
+ It : Interp;
+ Nam : Entity_Id;
+ Nam_Decl : Node_Id;
+ Nam_UA : Entity_Id;
+ Norm_OK : Boolean;
+ Rtype : Entity_Id;
+ Scop : Entity_Id;
+
-- Start of processing for Resolve_Call
begin
@@ -6218,21 +6223,16 @@ package body Sem_Res is
and then Is_Overloadable (Nam)
and then not Inside_A_Generic
then
- -- Retrieve the body to inline from the ultimate alias of Nam, if
- -- there is one, otherwise calls that should be inlined end up not
- -- being inlined.
+ Nam_UA := Ultimate_Alias (Nam);
+ Nam_Decl := Unit_Declaration_Node (Nam_UA);
- declare
- Nam_UA : constant Entity_Id := Ultimate_Alias (Nam);
- Decl : constant Node_Id := Unit_Declaration_Node (Nam_UA);
- Body_Id : constant Entity_Id := Corresponding_Body (Decl);
+ if Nkind (Nam_Decl) = N_Subprogram_Declaration then
+ Body_Id := Corresponding_Body (Nam_Decl);
- begin
- -- If the subprogram is not eligible for inlining in GNATprove
- -- mode, do nothing.
+ -- Nothing to do if the subprogram is not eligible for inlining in
+ -- GNATprove mode.
- if Nkind (Decl) /= N_Subprogram_Declaration
- or else not Is_Inlined_Always (Nam_UA)
+ if not Is_Inlined_Always (Nam_UA)
or else not Can_Be_Inlined_In_GNATprove_Mode (Nam_UA, Body_Id)
then
null;
@@ -6262,7 +6262,7 @@ package body Sem_Res is
-- the subprogram is not suitable for inlining in GNATprove
-- mode.
- elsif No (Body_To_Inline (Decl)) then
+ elsif No (Body_To_Inline (Nam_Decl)) then
null;
-- Calls cannot be inlined inside potentially unevaluated
@@ -6281,7 +6281,7 @@ package body Sem_Res is
Expand_Inlined_Call (N, Nam_UA, Nam);
end if;
end if;
- end;
+ end if;
end if;
Warn_On_Overlapping_Actuals (Nam, N);