aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch6.adb
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2017-01-19 11:37:39 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-19 12:37:39 +0100
commitd6e1090ae6b767f5ce0f0237a9763bed24545dd1 (patch)
treec902415ecc44040cdfb956d141e9bbc066273bbe /gcc/ada/exp_ch6.adb
parentde01377ca91e88226f919c84677d82c65dec6adf (diff)
downloadgcc-d6e1090ae6b767f5ce0f0237a9763bed24545dd1.zip
gcc-d6e1090ae6b767f5ce0f0237a9763bed24545dd1.tar.gz
gcc-d6e1090ae6b767f5ce0f0237a9763bed24545dd1.tar.bz2
exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as returning by reference not just for subprogram body stubs...
2017-01-19 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as returning by reference not just for subprogram body stubs, but for all subprogram cases. * sem_util.adb: Code reformatting. (Requires_Transient_Scope): Update the call to Results_Differ. (Results_Differ): Update the parameter profile and the associated comment on usage. From-SVN: r244616
Diffstat (limited to 'gcc/ada/exp_ch6.adb')
-rw-r--r--gcc/ada/exp_ch6.adb10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index b9840e2..4e03bd1 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -5542,13 +5542,7 @@ package body Exp_Ch6 is
Utyp : constant Entity_Id := Underlying_Type (Typ);
begin
- if not Acts_As_Spec (N)
- and then Nkind (Parent (Parent (Spec_Id))) /=
- N_Subprogram_Body_Stub
- then
- null;
-
- elsif Is_Limited_View (Typ) then
+ if Is_Limited_View (Typ) then
Set_Returns_By_Ref (Spec_Id);
elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then
@@ -7306,9 +7300,11 @@ package body Exp_Ch6 is
declare
Typ : constant Entity_Id := Etype (Subp);
Utyp : constant Entity_Id := Underlying_Type (Typ);
+
begin
if Is_Limited_View (Typ) then
Set_Returns_By_Ref (Subp);
+
elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then
Set_Returns_By_Ref (Subp);
end if;