diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-04-27 05:15:26 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-05-08 21:16:23 +0200 |
commit | 47b7ace6a702830d33fb1a26bc49e9362147aa4b (patch) | |
tree | 237fede55777957f0fdb75162cf2c8d4bca12140 | |
parent | f250fb5c371ad8e286f4fe7c442ea7e7866f12a0 (diff) | |
download | ghdl-47b7ace6a702830d33fb1a26bc49e9362147aa4b.tar.gz ghdl-47b7ace6a702830d33fb1a26bc49e9362147aa4b.tar.bz2 ghdl-47b7ace6a702830d33fb1a26bc49e9362147aa4b.zip |
Minor optimization: avoid calls to Get_Association_Formal.
-rw-r--r-- | src/vhdl/translate/trans-chap4.adb | 8 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap4.ads | 6 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap5.adb | 13 |
3 files changed, 14 insertions, 13 deletions
diff --git a/src/vhdl/translate/trans-chap4.adb b/src/vhdl/translate/trans-chap4.adb index 5a50e677c..58bb614ce 100644 --- a/src/vhdl/translate/trans-chap4.adb +++ b/src/vhdl/translate/trans-chap4.adb @@ -3016,24 +3016,24 @@ package body Trans.Chap4 is end Elab_Conversion; -- In conversion: from actual to formal. - procedure Elab_In_Conversion (Assoc : Iir; Inter : Iir; Ndest : out Mnode) + procedure Elab_In_Conversion (Assoc : Iir; Formal : Iir; Ndest : out Mnode) is Assoc_Info : constant Assoc_Info_Acc := Get_Info (Assoc); begin Elab_Conversion - (Get_Actual (Assoc), Get_Association_Formal (Assoc, Inter), + (Get_Actual (Assoc), Formal, Ghdl_Signal_In_Conversion, Assoc_Info.Assoc_In, Ndest); end Elab_In_Conversion; -- Out conversion: from formal to actual. - procedure Elab_Out_Conversion (Assoc : Iir; Inter : Iir; Ndest : out Mnode) + procedure Elab_Out_Conversion (Assoc : Iir; Formal : Iir; Ndest : out Mnode) is -- Note: because it's an out conversion, the formal of ASSOC is set. -- Still pass INTER for coherence with Elab_In_Conversion. Assoc_Info : constant Assoc_Info_Acc := Get_Info (Assoc); begin Elab_Conversion - (Get_Association_Formal (Assoc, Inter), Get_Actual (Assoc), + (Formal, Get_Actual (Assoc), Ghdl_Signal_Out_Conversion, Assoc_Info.Assoc_Out, Ndest); end Elab_Out_Conversion; diff --git a/src/vhdl/translate/trans-chap4.ads b/src/vhdl/translate/trans-chap4.ads index 3505fac4e..50fe23e69 100644 --- a/src/vhdl/translate/trans-chap4.ads +++ b/src/vhdl/translate/trans-chap4.ads @@ -51,8 +51,10 @@ package Trans.Chap4 is -- Elaborate In/Out_Conversion for ASSOC (signals only). -- NDEST is the data structure to be registered. - procedure Elab_In_Conversion (Assoc : Iir; Inter : Iir; Ndest : out Mnode); - procedure Elab_Out_Conversion (Assoc : Iir; Inter : Iir; Ndest : out Mnode); + procedure Elab_In_Conversion + (Assoc : Iir; Formal : Iir; Ndest : out Mnode); + procedure Elab_Out_Conversion + (Assoc : Iir; Formal : Iir; Ndest : out Mnode); -- Create code to elaborate declarations. -- NEED_FINAL is set when at least one declaration needs to be diff --git a/src/vhdl/translate/trans-chap5.adb b/src/vhdl/translate/trans-chap5.adb index 44f31e9dd..cc068b754 100644 --- a/src/vhdl/translate/trans-chap5.adb +++ b/src/vhdl/translate/trans-chap5.adb @@ -368,12 +368,11 @@ package body Trans.Chap5 is Finish_Data_Record => Connect_Finish_Data_Composite); procedure Elab_Port_Map_Aspect_Assoc (Assoc : Iir; - Inter : Iir; + Formal : Iir; By_Copy : Boolean; Formal_Env : Map_Env; Actual_Env : Map_Env) is - Formal : constant Iir := Get_Association_Formal (Assoc, Inter); Actual : constant Iir := Get_Actual (Assoc); Formal_Type : constant Iir := Get_Type (Formal); Actual_Type : constant Iir := Get_Type (Actual); @@ -474,7 +473,7 @@ package body Trans.Chap5 is Connect (Formal_Sig, Formal_Type, Data); else if Get_In_Conversion (Assoc) /= Null_Iir then - Chap4.Elab_In_Conversion (Assoc, Inter, Actual_Sig); + Chap4.Elab_In_Conversion (Assoc, Formal, Actual_Sig); Set_Map_Env (Formal_Env); Formal_Sig := Chap6.Translate_Name (Formal, Mode_Signal); Data := (Actual_Sig => Actual_Sig, @@ -486,7 +485,7 @@ package body Trans.Chap5 is end if; if Get_Out_Conversion (Assoc) /= Null_Iir then -- flow: FORMAL to ACTUAL - Chap4.Elab_Out_Conversion (Assoc, Inter, Formal_Sig); + Chap4.Elab_Out_Conversion (Assoc, Formal, Formal_Sig); Set_Map_Env (Actual_Env); Actual_Sig := Chap6.Translate_Name (Actual, Mode_Signal); Data := (Actual_Sig => Actual_Sig, @@ -701,14 +700,14 @@ package body Trans.Chap5 is if Get_Collapse_Signal_Flag (Assoc) then -- For collapsed association, copy signals. Elab_Port_Map_Aspect_Assoc - (Assoc, Inter, True, Formal_Env, Actual_Env); + (Assoc, Formal, True, Formal_Env, Actual_Env); else -- Create non-collapsed signals. Chap4.Elab_Signal_Declaration_Object (Formal, Block_Parent, False); -- And associate. Elab_Port_Map_Aspect_Assoc - (Assoc, Inter, False, Formal_Env, Actual_Env); + (Assoc, Formal, False, Formal_Env, Actual_Env); end if; else -- By sub-element. @@ -716,7 +715,7 @@ package body Trans.Chap5 is -- created. -- And associate. Elab_Port_Map_Aspect_Assoc - (Assoc, Inter, False, Formal_Env, Actual_Env); + (Assoc, Formal, False, Formal_Env, Actual_Env); end if; when Iir_Kind_Association_Element_Open | Iir_Kind_Association_Element_By_Individual => |