aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch6.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-04-27 14:37:55 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-27 14:37:55 +0200
commit888be6b18a697c7f57f2f74fa8dbab058bb819ef (patch)
treed648d4e011ee94742841faaa4b264c82163554e4 /gcc/ada/exp_ch6.adb
parentc7518e6f52aad178875818666fcfc92ff4e08e8f (diff)
downloadgcc-888be6b18a697c7f57f2f74fa8dbab058bb819ef.zip
gcc-888be6b18a697c7f57f2f74fa8dbab058bb819ef.tar.gz
gcc-888be6b18a697c7f57f2f74fa8dbab058bb819ef.tar.bz2
[multiple changes]
2016-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sem_res.adb (Flag_Effectively_Volatile_Objects): New routine. (Resolve_Actuals): Flag effectively volatile objects with enabled property Async_Writers or Effective_Reads as illegal. * sem_util.adb (Is_OK_Volatile_Context): Comment reformatting. 2016-04-27 Javier Miranda <miranda@adacore.com> * exp_ch3.adb (Make_Predefined_Primitive_Specs): Do not generate the profile of the equality operator if it has been explicitly defined as abstract in the parent type. Required to avoid reporting an spurious error. 2016-04-27 Ed Schonberg <schonberg@adacore.com> * sem_dim.ads, sem_dim.adb (Check_Expression_Dimensions): New procedure to compute the dimension vector of a scalar expression and compare it with the dimensions if its expected subtype. Used for the ultimate components of a multidimensional aggregate, whose components typically are themselves aggregates that are expanded separately. Previous to this patch, dimensionality checking on such aggregates generated spurious errors. * sem_aggr.adb (Resolve_Array_Aggregate): Use Check_Expression_Dimensions when needed. 2016-04-27 Javier Miranda <miranda@adacore.com> * einfo.ads, einfo.adb (Corresponding_Function): New attribute (applicable to E_Procedure). (Corresponding_Procedure): New attribute (applicable to E_Function). * exp_util.adb (Build_Procedure_Form): Link the function with its internally built proc and viceversa. * sem_ch6.adb (Build_Subprogram_Declaration): Propagate the attribute Rewritten_For_C and Corresponding_Procedure to the body. * exp_ch6.adb (Rewritten_For_C_Func_Id): Removed. (Rewritten_For_C_Proc_Id): Removed. * exp_unst.adb (Note_Uplevel_Ref): Use the new attribute to locate the corresponding procedure. From-SVN: r235493
Diffstat (limited to 'gcc/ada/exp_ch6.adb')
-rw-r--r--gcc/ada/exp_ch6.adb82
1 files changed, 5 insertions, 77 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 60c2ce0..1d3ab7d 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -2502,47 +2502,9 @@ package body Exp_Ch6 is
end if;
end New_Value;
- function Rewritten_For_C_Func_Id (Proc_Id : Entity_Id) return Entity_Id;
- -- Given the Id of the procedure with an extra out parameter internally
- -- built to handle functions that return a constrained array type return
- -- the Id of the corresponding function.
-
- -----------------------------
- -- Rewritten_For_C_Func_Id --
- -----------------------------
-
- function Rewritten_For_C_Func_Id (Proc_Id : Entity_Id) return Entity_Id
- is
- Decl : constant Node_Id := Unit_Declaration_Node (Proc_Id);
- Func_Decl : Node_Id;
- Func_Id : Entity_Id;
-
- begin
- pragma Assert (Rewritten_For_C (Proc_Id));
- pragma Assert (Nkind (Decl) = N_Subprogram_Body);
-
- Func_Decl := Nlists.Prev (Decl);
-
- while Present (Func_Decl)
- and then
- (Nkind (Func_Decl) = N_Freeze_Entity
- or else
- Nkind (Func_Decl) /= N_Subprogram_Declaration
- or else
- Nkind (Specification (Func_Decl)) /= N_Function_Specification)
- loop
- Func_Decl := Nlists.Prev (Func_Decl);
- end loop;
-
- pragma Assert (Present (Func_Decl));
- Func_Id := Defining_Entity (Specification (Func_Decl));
- pragma Assert (Chars (Proc_Id) = Chars (Func_Id));
- return Func_Id;
- end Rewritten_For_C_Func_Id;
-
-- Local variables
- Remote : constant Boolean := Is_Remote_Call (Call_Node);
+ Remote : constant Boolean := Is_Remote_Call (Call_Node);
Actual : Node_Id;
Formal : Entity_Id;
Orig_Subp : Entity_Id := Empty;
@@ -2706,8 +2668,9 @@ package body Exp_Ch6 is
N_Subprogram_Body
then
Set_Entity (Name (Call_Node),
- Rewritten_For_C_Func_Id
- (Ultimate_Alias (Entity (Name (Call_Node)))));
+ Corresponding_Function
+ (Corresponding_Procedure
+ (Ultimate_Alias (Entity (Name (Call_Node))))));
end if;
Rewrite_Function_Call_For_C (Call_Node);
@@ -8405,45 +8368,10 @@ package body Exp_Ch6 is
---------------------------------
procedure Rewrite_Function_Call_For_C (N : Node_Id) is
- function Rewritten_For_C_Proc_Id (Func_Id : Entity_Id) return Entity_Id;
- -- Given the Id of the function that returns a constrained array type
- -- return the Id of its internally built procedure with an extra out
- -- parameter.
-
- -----------------------------
- -- Rewritten_For_C_Proc_Id --
- -----------------------------
-
- function Rewritten_For_C_Proc_Id (Func_Id : Entity_Id) return Entity_Id
- is
- Func_Decl : constant Node_Id := Unit_Declaration_Node (Func_Id);
- Proc_Decl : Node_Id;
- Proc_Id : Entity_Id;
-
- begin
- Proc_Decl := Next (Func_Decl);
-
- while Present (Proc_Decl)
- and then
- (Nkind (Proc_Decl) = N_Freeze_Entity
- or else
- Nkind (Proc_Decl) /= N_Subprogram_Declaration)
- loop
- Proc_Decl := Next (Proc_Decl);
- end loop;
-
- pragma Assert (Present (Proc_Decl));
- Proc_Id := Defining_Entity (Proc_Decl);
- pragma Assert (Chars (Proc_Id) = Chars (Func_Id));
- return Proc_Id;
- end Rewritten_For_C_Proc_Id;
-
- -- Local variables
-
Orig_Func : constant Entity_Id := Entity (Name (N));
Func_Id : constant Entity_Id := Ultimate_Alias (Orig_Func);
Par : constant Node_Id := Parent (N);
- Proc_Id : constant Entity_Id := Rewritten_For_C_Proc_Id (Func_Id);
+ Proc_Id : constant Entity_Id := Corresponding_Procedure (Func_Id);
Loc : constant Source_Ptr := Sloc (Par);
Actuals : List_Id;
Last_Actual : Node_Id;