diff options
author | Tristan Gingold <gingold@adacore.com> | 2015-12-20 21:14:59 +0100 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2015-12-20 21:14:59 +0100 |
commit | 396eb91b6e6783cb78cb22fe0a1f26b178d695a1 (patch) | |
tree | e96f0c9dc9f337b8d9640abd4dc6ec643231165f /src/vhdl | |
parent | 92ac42fcf39d5dac4529d939a49437b2a7afe4c2 (diff) | |
download | ghdl-396eb91b6e6783cb78cb22fe0a1f26b178d695a1.tar.gz ghdl-396eb91b6e6783cb78cb22fe0a1f26b178d695a1.tar.bz2 ghdl-396eb91b6e6783cb78cb22fe0a1f26b178d695a1.zip |
Do not create signal type for scalar type.
Use ghdl_signal_ptr instead. Fallout of sigptr.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/translate/trans-chap14.adb | 9 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 12 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap7.adb | 2 | ||||
-rw-r--r-- | src/vhdl/translate/translation.adb | 13 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/vhdl/translate/trans-chap14.adb b/src/vhdl/translate/trans-chap14.adb index a737c6c24..eacbf759b 100644 --- a/src/vhdl/translate/trans-chap14.adb +++ b/src/vhdl/translate/trans-chap14.adb @@ -464,14 +464,13 @@ package body Trans.Chap14 is -- Read signal value FIELD of signal SIG. function Get_Signal_Value_Field - (Sig : O_Enode; Sig_Type : Iir; Field : O_Fnode) - return O_Lnode + (Sig : O_Enode; Sig_Type : Iir; Field : O_Fnode) return O_Lnode is - S_Type : O_Tnode; + Tinfo : constant Type_Info_Acc := Get_Info (Sig_Type); + S_Type : constant O_Tnode := Tinfo.Ortho_Ptr_Type (Mode_Value); T : O_Lnode; begin - S_Type := Get_Ortho_Type (Sig_Type, Mode_Signal); - T := New_Access_Element (New_Convert_Ov (Sig, Ghdl_Signal_Ptr)); + T := New_Access_Element (Sig); return New_Access_Element (New_Unchecked_Address (New_Selected_Element (T, Field), S_Type)); end Get_Signal_Value_Field; diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 9b67e467a..a01c4c088 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -60,12 +60,12 @@ package body Trans.Chap3 is -- Signal type. if Info.Type_Mode in Type_Mode_Scalar then - Info.Ortho_Type (Mode_Signal) := - New_Access_Type (Info.Ortho_Type (Mode_Value)); - end if; - if Info.Ortho_Type (Mode_Signal) /= O_Tnode_Null then - New_Type_Decl (Create_Identifier ("SIG"), - Info.Ortho_Type (Mode_Signal)); + Info.Ortho_Type (Mode_Signal) := Ghdl_Signal_Ptr; + else + if Info.Ortho_Type (Mode_Signal) /= O_Tnode_Null then + New_Type_Decl (Create_Identifier ("SIG"), + Info.Ortho_Type (Mode_Signal)); + end if; end if; -- Signal pointer type. diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb index 8ce2b8aca..25e9ed833 100644 --- a/src/vhdl/translate/trans-chap7.adb +++ b/src/vhdl/translate/trans-chap7.adb @@ -3616,7 +3616,7 @@ package body Trans.Chap7 is begin New_Assign_Stmt (Chap14.Get_Signal_Value_Field (M2E (Targ), Targ_Type, - Ghdl_Signal_Driving_Value_Field), + Ghdl_Signal_Driving_Value_Field), M2E (Data)); end Translate_Signal_Assign_Driving_Non_Composite; diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb index b593f475b..cfc15902c 100644 --- a/src/vhdl/translate/translation.adb +++ b/src/vhdl/translate/translation.adb @@ -542,6 +542,13 @@ package body Translation is Ghdl_Dir_Type_Node); end; + -- Create __ghdl_signal_ptr (incomplete type). + New_Uncomplete_Record_Type (Ghdl_Signal_Type); + New_Type_Decl (Get_Identifier ("__ghdl_signal"), Ghdl_Signal_Type); + + Ghdl_Signal_Ptr := New_Access_Type (Ghdl_Signal_Type); + New_Type_Decl (Get_Identifier ("__ghdl_signal_ptr"), Ghdl_Signal_Ptr); + -- Create void* __ghdl_alloc (unsigned size); Start_Function_Decl (Interfaces, Get_Identifier ("__ghdl_alloc"), O_Storage_External, Ghdl_Ptr_Type); @@ -1241,12 +1248,6 @@ package body Translation is New_Type_Decl (Get_Identifier ("__ghdl_scalar_bytes"), Ghdl_Scalar_Bytes); - New_Uncomplete_Record_Type (Ghdl_Signal_Type); - New_Type_Decl (Get_Identifier ("__ghdl_signal"), Ghdl_Signal_Type); - - Ghdl_Signal_Ptr := New_Access_Type (Ghdl_Signal_Type); - New_Type_Decl (Get_Identifier ("__ghdl_signal_ptr"), Ghdl_Signal_Ptr); - -- Type __signal_signal is record Start_Uncomplete_Record_Type (Ghdl_Signal_Type, Rec); New_Record_Field (Rec, Ghdl_Signal_Value_Field, |