aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-06-19 20:44:22 +0200
committerTristan Gingold <tgingold@free.fr>2017-06-19 20:44:22 +0200
commit620ddf92b9d72e9dc39e03ea0f6b3b33cf75363f (patch)
treea44b580eb2c745be5c739f4a0e8be4192b80c6db
parent7b2da98caf3c389c4bd29df887050414597aeb7f (diff)
downloadghdl-620ddf92b9d72e9dc39e03ea0f6b3b33cf75363f.tar.gz
ghdl-620ddf92b9d72e9dc39e03ea0f6b3b33cf75363f.tar.bz2
ghdl-620ddf92b9d72e9dc39e03ea0f6b3b33cf75363f.zip
Translate: use create_temp for create_record_type_builder.
Fix #370
-rw-r--r--src/vhdl/translate/trans-chap3.adb8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb
index 4457403ec..b18ca4515 100644
--- a/src/vhdl/translate/trans-chap3.adb
+++ b/src/vhdl/translate/trans-chap3.adb
@@ -1350,10 +1350,8 @@ package body Trans.Chap3 is
and then El_Tinfo.C (Kind).Builder_Need_Func
then
-- This type needs a builder, call it.
- Start_Declare_Stmt;
- New_Var_Decl
- (Ptr_Var, Get_Identifier ("var_ptr"),
- O_Storage_Local, El_Tinfo.Ortho_Ptr_Type (Kind));
+ Open_Temp;
+ Ptr_Var := Create_Temp (El_Tinfo.Ortho_Ptr_Type (Kind));
New_Assign_Stmt
(New_Obj (Ptr_Var),
@@ -1367,7 +1365,7 @@ package body Trans.Chap3 is
Gen_Call_Type_Builder
(Dp2M (Ptr_Var, El_Tinfo, Kind), El_Type)));
- Finish_Declare_Stmt;
+ Close_Temp;
else
if Is_Unbounded_Type (El_Tinfo) then
Sub_Bound := Bounds_To_Element_Bounds