diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-01-17 06:43:15 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-01-17 06:43:15 +0100 |
commit | fd92bd29c1f66db122a3de5dc31d3147ae4fe652 (patch) | |
tree | 59c4ca5969a500df4bf758ae5abd9f334addbd02 /src | |
parent | 955bfac884bfe67a2e065abc299e471d98ec8db9 (diff) | |
download | ghdl-fd92bd29c1f66db122a3de5dc31d3147ae4fe652.tar.gz ghdl-fd92bd29c1f66db122a3de5dc31d3147ae4fe652.tar.bz2 ghdl-fd92bd29c1f66db122a3de5dc31d3147ae4fe652.zip |
translation: minor refactoring.
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/translate/trans-chap7.adb | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb index 0b1888d31..726aed475 100644 --- a/src/vhdl/translate/trans-chap7.adb +++ b/src/vhdl/translate/trans-chap7.adb @@ -3499,20 +3499,21 @@ package body Trans.Chap7 is end Translate_Array_Aggregate; procedure Translate_Aggregate - (Target : Mnode; Target_Type : Iir; Aggr : Iir) - is - Aggr_Type : constant Iir := Get_Type (Aggr); - El : Iir; + (Target : Mnode; Target_Type : Iir; Aggr : Iir) is begin - case Iir_Kinds_Composite_Type_Definition (Get_Kind (Aggr_Type)) is + case Iir_Kinds_Composite_Type_Definition (Get_Kind (Target_Type)) is when Iir_Kind_Array_Subtype_Definition - | Iir_Kind_Array_Type_Definition => - El := Is_Aggregate_Others (Aggr); - if El /= Null_Iir then - Translate_Aggregate_Others (Target, Target_Type, El); - else - Translate_Array_Aggregate (Target, Target_Type, Aggr); - end if; + | Iir_Kind_Array_Type_Definition => + declare + El : Iir; + begin + El := Is_Aggregate_Others (Aggr); + if El /= Null_Iir then + Translate_Aggregate_Others (Target, Target_Type, El); + else + Translate_Array_Aggregate (Target, Target_Type, Aggr); + end if; + end; when Iir_Kind_Record_Type_Definition | Iir_Kind_Record_Subtype_Definition => Translate_Record_Aggregate (Target, Aggr); |