diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-07-25 11:49:16 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-07-25 13:27:48 +0200 |
commit | 9019f5175b84151d6f1d964f641266411078aa71 (patch) | |
tree | 54579b668ed67243d685dd67e81ef9cf434f0e1d /src | |
parent | fdd0d00d1a028e515191a76bcc028acbfc200c56 (diff) | |
download | ghdl-9019f5175b84151d6f1d964f641266411078aa71.tar.gz ghdl-9019f5175b84151d6f1d964f641266411078aa71.tar.bz2 ghdl-9019f5175b84151d6f1d964f641266411078aa71.zip |
vhdl/translate: add comments.
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 3f2feaf12..4c7e5522b 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -2542,26 +2542,30 @@ package body Trans.Chap3 is Mark : Id_Mark_Type; Mark2 : Id_Mark_Type; begin - -- Note about subtype_indication and type in a declaration: + -- Notes about subtype_indication and type in a declaration: -- 1) The subtype_indication is owned by the first declared -- object when there is a list of identifiers. The following -- declarations are ref. - -- 2) Constants may have a type that is different from the subtype - -- indication, when the subtype indication is not fully constrained. - -- TODO: explain why! + if Get_Is_Ref (Decl) then + return; + end if; + -- 3) An object alias always have a type but may have no subtype -- indication. Maybe this should be handled separately. -- 4) An anonymous_signal_declaration has no subtype indication. -- 5) It is not possible to translate the type when the subtype -- indication is a subtype_attribute. So this is an exception -- TODO: if there is a list of identifiers. - if Get_Is_Ref (Decl) then - return; - end if; Push_Identifier_Prefix (Mark, Get_Identifier (Decl)); Def := Get_Type (Decl); + + -- 2) Constants may have a type that is different from the subtype + -- indication, when the subtype indication is not fully constrained. + -- This is new with vhdl 2008, where the subtype indication may + -- add some constraints on the type mark and the initial value add + -- even more constraints. if Get_Kind (Decl) = Iir_Kind_Constant_Declaration then Ind := Get_Subtype_Indication (Decl); Ind := Get_Type_Of_Subtype_Indication (Ind); |