From ffd7808c74dd326f11c7373118ed85354076211e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 24 Oct 2018 05:15:40 +0200 Subject: translate chap8: layout base bounds for unbounded individual assoc. --- src/vhdl/translate/trans-chap3.ads | 3 +++ src/vhdl/translate/trans-chap8.adb | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'src/vhdl') diff --git a/src/vhdl/translate/trans-chap3.ads b/src/vhdl/translate/trans-chap3.ads index 2b9f37e6b..783e1ae90 100644 --- a/src/vhdl/translate/trans-chap3.ads +++ b/src/vhdl/translate/trans-chap3.ads @@ -126,6 +126,9 @@ package Trans.Chap3 is -- number of dimensions; these fields are a structure describing the -- range of the dimension. + procedure Gen_Call_Type_Builder + (Layout : Mnode; Var_Type : Iir; Kind : Object_Kind_Type); + -- If the element subtype of ARR_TYPE is unbounded, create a fat pointer, -- set the bounds of it (from ARR), and return it. -- Otherwise, return a null mnode. diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb index 318d0142f..4d608c839 100644 --- a/src/vhdl/translate/trans-chap8.adb +++ b/src/vhdl/translate/trans-chap8.adb @@ -2893,6 +2893,11 @@ package body Trans.Chap8 is or else (Get_Interface_Of_Formal (Get_Formal (Next_Assoc)) /= Base_Formal) then + -- * compute the size of the object + Chap3.Gen_Call_Type_Builder + (Chap3.Get_Composite_Bounds (Params (Last_Individual)), + Get_Type (Base_Formal), Formal_Object_Kind); + -- * allocate base Chap3.Allocate_Unbounded_Composite_Base (Alloc, Saved_Val (Last_Individual), -- cgit v1.2.3