aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-12-06 23:37:15 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-01-09 14:13:30 +0100
commite3da93d988c0bb5da0eb4f6cdb75a63983ea2b33 (patch)
tree3210ae07fe2307133558236bdedbaa0c255077a1 /gcc/ada
parent3b9d4258ea755c04f7a7ac1c5e054c098f4bbc93 (diff)
downloadgcc-e3da93d988c0bb5da0eb4f6cdb75a63983ea2b33.zip
gcc-e3da93d988c0bb5da0eb4f6cdb75a63983ea2b33.tar.gz
gcc-e3da93d988c0bb5da0eb4f6cdb75a63983ea2b33.tar.bz2
ada: Remove unreachable code in Resolve_Extension_Aggregate
The only functions using the BIP protocol are now those returning a limited type: Is_Build_In_Place_Result_Type => Is_Inherently_Limited_Type. gcc/ada/ * sem_aggr.adb (Resolve_Extension_Aggregate): Remove the unreachable call to Transform_BIP_Assignment as well as the procedure.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_aggr.adb39
1 files changed, 1 insertions, 38 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 1027acf..f586c18 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -31,7 +31,6 @@ with Einfo.Utils; use Einfo.Utils;
with Elists; use Elists;
with Errout; use Errout;
with Expander; use Expander;
-with Exp_Ch6; use Exp_Ch6;
with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
with Freeze; use Freeze;
@@ -4232,11 +4231,6 @@ package body Sem_Aggr is
-- Verify that the type of the ancestor part is a non-private ancestor
-- of the expected type, which must be a type extension.
- procedure Transform_BIP_Assignment (Typ : Entity_Id);
- -- For an extension aggregate whose ancestor part is a build-in-place
- -- call returning a nonlimited type, this is used to transform the
- -- assignment to the ancestor part to use a temp.
-
----------------------------
-- Valid_Limited_Ancestor --
----------------------------
@@ -4328,26 +4322,6 @@ package body Sem_Aggr is
return False;
end Valid_Ancestor_Type;
- ------------------------------
- -- Transform_BIP_Assignment --
- ------------------------------
-
- procedure Transform_BIP_Assignment (Typ : Entity_Id) is
- Loc : constant Source_Ptr := Sloc (N);
- Def_Id : constant Entity_Id := Make_Temporary (Loc, 'Y', A);
- Obj_Decl : constant Node_Id :=
- Make_Object_Declaration (Loc,
- Defining_Identifier => Def_Id,
- Constant_Present => True,
- Object_Definition => New_Occurrence_Of (Typ, Loc),
- Expression => A,
- Has_Init_Expression => True);
- begin
- Set_Etype (Def_Id, Typ);
- Set_Ancestor_Part (N, New_Occurrence_Of (Def_Id, Loc));
- Insert_Action (N, Obj_Decl);
- end Transform_BIP_Assignment;
-
-- Start of processing for Resolve_Extension_Aggregate
begin
@@ -4521,19 +4495,8 @@ package body Sem_Aggr is
-- an AdaCore query to the ARG after this test was added.
Error_Msg_N ("ancestor part must be statically tagged", A);
- else
- -- We are using the build-in-place protocol, but we can't build
- -- in place, because we need to call the function before
- -- allocating the aggregate. Could do better for null
- -- extensions, and maybe for nondiscriminated types.
- -- This is wrong for limited, but those were wrong already.
-
- if not Is_Inherently_Limited_Type (A_Type)
- and then Is_Build_In_Place_Function_Call (A)
- then
- Transform_BIP_Assignment (A_Type);
- end if;
+ else
Resolve_Record_Aggregate (N, Typ);
end if;
end if;