aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap9.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-01-17 06:34:47 +0100
committerTristan Gingold <tgingold@free.fr>2018-01-17 06:34:47 +0100
commit6487c7008b36ed7a94a59b3b02bb7e7b28fe4ac8 (patch)
treea6fa300d314644069585852959c571345b9b7491 /src/vhdl/translate/trans-chap9.adb
parent4d52610e330ab24aea76eaae8295fd7771beedda (diff)
downloadghdl-6487c7008b36ed7a94a59b3b02bb7e7b28fe4ac8.tar.gz
ghdl-6487c7008b36ed7a94a59b3b02bb7e7b28fe4ac8.tar.bz2
ghdl-6487c7008b36ed7a94a59b3b02bb7e7b28fe4ac8.zip
Translate; properly separates translation of types from translation of subtypes.
Diffstat (limited to 'src/vhdl/translate/trans-chap9.adb')
-rw-r--r--src/vhdl/translate/trans-chap9.adb42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/vhdl/translate/trans-chap9.adb b/src/vhdl/translate/trans-chap9.adb
index 4c6904fea..43cef0f1c 100644
--- a/src/vhdl/translate/trans-chap9.adb
+++ b/src/vhdl/translate/trans-chap9.adb
@@ -164,7 +164,7 @@ package body Trans.Chap9 is
Ports : Iir;
Mark, Mark2 : Id_Mark_Type;
- Assoc, Inter, Conv, In_Type : Iir;
+ Assoc, Inter : Iir;
Has_Conv_Record : Boolean := False;
begin
Info := Add_Info (Inst, Kind_Block);
@@ -200,25 +200,29 @@ package body Trans.Chap9 is
while Assoc /= Null_Iir loop
if Get_Kind (Assoc) = Iir_Kind_Association_Element_By_Expression
then
- Conv := Get_Actual_Conversion (Assoc);
- In_Type := Get_Type (Get_Actual (Assoc));
- if Conv /= Null_Iir
- and then Is_Anonymous_Type_Definition (In_Type)
- then
- -- Lazy creation of the record.
- if not Has_Conv_Record then
- Has_Conv_Record := True;
- Push_Instance_Factory (Info.Block_Scope'Access);
- end if;
+ declare
+ Conv : constant Iir := Get_Actual_Conversion (Assoc);
+ In_Type : constant Iir := Get_Type (Get_Actual (Assoc));
+ begin
+ if Conv /= Null_Iir
+ and then Is_Anonymous_Type_Definition (In_Type)
+ then
+ -- Lazy creation of the record.
+ if not Has_Conv_Record then
+ Has_Conv_Record := True;
+ Push_Instance_Factory (Info.Block_Scope'Access);
+ end if;
- -- FIXME: handle with overload multiple case on the same
- -- formal.
- Push_Identifier_Prefix
- (Mark2,
- Get_Identifier (Get_Association_Interface (Assoc, Inter)));
- Chap3.Translate_Type_Definition (In_Type, True);
- Pop_Identifier_Prefix (Mark2);
- end if;
+ -- FIXME: handle with overload multiple case on the same
+ -- formal.
+ Push_Identifier_Prefix
+ (Mark2,
+ Get_Identifier
+ (Get_Association_Interface (Assoc, Inter)));
+ Chap3.Translate_Anonymous_Subtype_Definition (In_Type, True);
+ Pop_Identifier_Prefix (Mark2);
+ end if;
+ end;
end if;
Next_Association_Interface (Assoc, Inter);
end loop;