diff options
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 10 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap3.ads | 4 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap5.adb | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 861ba894a..8f383a099 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -68,6 +68,16 @@ package body Trans.Chap3 is Info.B.Layout_Ptr_Type); end Get_Composite_Type_Layout; + function Get_Composite_Type_Layout_Alloc (Info : Type_Info_Acc) + return Allocation_Kind is + begin + if Info.S.Subtype_Owner /= null then + return Get_Composite_Type_Layout_Alloc (Info.S.Subtype_Owner); + else + return Get_Alloc_Kind_For_Var (Info.S.Composite_Layout); + end if; + end Get_Composite_Type_Layout_Alloc; + function Layout_To_Bounds (B : Mnode) return Mnode is Info : constant Type_Info_Acc := Get_Type_Info (B); diff --git a/src/vhdl/translate/trans-chap3.ads b/src/vhdl/translate/trans-chap3.ads index e9375fcf8..4701dcf81 100644 --- a/src/vhdl/translate/trans-chap3.ads +++ b/src/vhdl/translate/trans-chap3.ads @@ -171,6 +171,10 @@ package Trans.Chap3 is -- Get the number of elements in array ATYPE. function Get_Array_Type_Length (Atype : Iir) return O_Enode; + -- Return the allocation kind used for layout variable of type INFO. + function Get_Composite_Type_Layout_Alloc (Info : Type_Info_Acc) + return Allocation_Kind; + -- Get the base of array or record OBJ. If OBJ is already constrained, -- return it. function Get_Composite_Base (Obj : Mnode) return Mnode; diff --git a/src/vhdl/translate/trans-chap5.adb b/src/vhdl/translate/trans-chap5.adb index 9a596ecde..4b1fcfc7e 100644 --- a/src/vhdl/translate/trans-chap5.adb +++ b/src/vhdl/translate/trans-chap5.adb @@ -561,7 +561,7 @@ package body Trans.Chap5 is Tinfo := Get_Info (Actual_Type); if Save and then - Get_Alloc_Kind_For_Var (Tinfo.S.Composite_Layout) = Alloc_Stack + Chap3.Get_Composite_Type_Layout_Alloc (Tinfo) = Alloc_Stack then -- We need a copy. Bounds_Copy := Alloc_Bounds (Actual_Type, Alloc_System); |