diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-10-01 07:41:39 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-10-01 07:41:39 +0200 |
commit | 92616e09b4a050ee9ba4496a3f68b6db2cb2552a (patch) | |
tree | 26d8f65385af90110b25ed4a175224e74e8e761b /src/synth | |
parent | 4ae9ffbce09663402fdff2dbacf77151d0ad81b9 (diff) | |
download | ghdl-92616e09b4a050ee9ba4496a3f68b6db2cb2552a.tar.gz ghdl-92616e09b4a050ee9ba4496a3f68b6db2cb2552a.tar.bz2 ghdl-92616e09b4a050ee9ba4496a3f68b6db2cb2552a.zip |
synth: handle selected element of const record.
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-expr.adb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 9e5ccff6a..12579b1eb 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1574,11 +1574,14 @@ package body Synth.Expr is begin Res := Synth_Expression (Syn_Inst, Pfx); Res_Typ := Res.Typ.Rec.E (Idx + 1).Typ; - -- FIXME: handle const. - N := Build_Extract - (Build_Context, Get_Net (Res), - Res.Typ.Rec.E (Idx + 1).Off, Get_Type_Width (Res_Typ)); - return Create_Value_Net (N, Res_Typ); + if Res.Kind = Value_Const_Record then + return Res.Rec.V (Idx + 1); + else + N := Build_Extract + (Build_Context, Get_Net (Res), + Res.Typ.Rec.E (Idx + 1).Off, Get_Type_Width (Res_Typ)); + return Create_Value_Net (N, Res_Typ); + end if; end; when Iir_Kind_Character_Literal => return Synth_Expression_With_Type |