diff options
author | Tristan Gingold | 2015-09-04 21:52:38 +0200 |
---|---|---|
committer | Tristan Gingold | 2015-09-04 21:52:38 +0200 |
commit | 8520993b4d1eadefa488dfc96dff25333f1b19db (patch) | |
tree | 818d4fe917d3e6b765932ed3d1ab1ee70dc3c508 /src/vhdl/translate/trans-chap3.adb | |
parent | 2d8f611cb63b72aa0373efe0ffa0df47e25519c9 (diff) | |
download | ghdl-8520993b4d1eadefa488dfc96dff25333f1b19db.tar.gz ghdl-8520993b4d1eadefa488dfc96dff25333f1b19db.tar.bz2 ghdl-8520993b4d1eadefa488dfc96dff25333f1b19db.zip |
Suppress stack switching; save process state in secondary stack.
Diffstat (limited to 'src/vhdl/translate/trans-chap3.adb')
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 6ab2802..fd946d1 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -2641,6 +2641,20 @@ package body Trans.Chap3 is end if; end Get_Object_Size; + procedure Copy_Bounds (Dest : O_Enode; Src : O_Enode; Obj_Type : Iir) + is + Tinfo : constant Type_Info_Acc := Get_Info (Obj_Type); + begin + Gen_Memcpy + (Dest, Src, + New_Lit (New_Sizeof (Tinfo.T.Bounds_Type, Ghdl_Index_Type))); + end Copy_Bounds; + + procedure Copy_Bounds (Dest : Mnode; Src : Mnode; Obj_Type : Iir) is + begin + Copy_Bounds (M2Addr (Dest), M2Addr (Src), Obj_Type); + end Copy_Bounds; + procedure Translate_Object_Allocation (Res : in out Mnode; Alloc_Kind : Allocation_Kind; @@ -2660,10 +2674,7 @@ package body Trans.Chap3 is Dinfo.T.Bounds_Ptr_Type)); -- Copy bounds to the allocated area. - Gen_Memcpy - (M2Addr (Chap3.Get_Array_Bounds (Res)), - M2Addr (Bounds), - New_Lit (New_Sizeof (Dinfo.T.Bounds_Type, Ghdl_Index_Type))); + Copy_Bounds (Chap3.Get_Array_Bounds (Res), Bounds, Obj_Type); -- Allocate base. Allocate_Fat_Array_Base (Alloc_Kind, Res, Obj_Type); |