aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-utils.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-02-01 21:10:17 +0100
committerTristan Gingold <tgingold@free.fr>2023-02-02 07:38:14 +0100
commitb2cab4a6f6457f5c2662c0219753b96cae6c0237 (patch)
tree7bc002278de0e85ef11d96c1d19abc016aa38321 /src/vhdl/vhdl-utils.adb
parent3fd41d16549e0ff43e52f45da9509969b7adea18 (diff)
downloadghdl-b2cab4a6f6457f5c2662c0219753b96cae6c0237.tar.gz
ghdl-b2cab4a6f6457f5c2662c0219753b96cae6c0237.tar.bz2
ghdl-b2cab4a6f6457f5c2662c0219753b96cae6c0237.zip
translate: rework translate_object_subtype_indication.
Fix #2337
Diffstat (limited to 'src/vhdl/vhdl-utils.adb')
-rw-r--r--src/vhdl/vhdl-utils.adb29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb
index 04fab38a9..fa5f31ee8 100644
--- a/src/vhdl/vhdl-utils.adb
+++ b/src/vhdl/vhdl-utils.adb
@@ -1323,7 +1323,21 @@ package body Vhdl.Utils is
end case;
end Get_Nature_Of_Subnature_Indication;
- function Is_Owned_Subtype_Indication (Decl : Iir) return Boolean
+ function Is_Proper_Subtype_Indication (Def : Iir) return Boolean is
+ begin
+ case Get_Kind (Def) is
+ when Iir_Kinds_Subtype_Definition =>
+ return True;
+ when Iir_Kinds_Denoting_Name
+ | Iir_Kind_Element_Attribute
+ | Iir_Kind_Subtype_Attribute =>
+ return False;
+ when others =>
+ Error_Kind ("is_proper_subtype_indication", Def);
+ end case;
+ end Is_Proper_Subtype_Indication;
+
+ function Has_Owned_Subtype_Indication (Decl : Iir) return Boolean
is
Def : Iir;
begin
@@ -1341,17 +1355,8 @@ package body Vhdl.Utils is
return False;
end if;
- case Get_Kind (Def) is
- when Iir_Kinds_Subtype_Definition =>
- return True;
- when Iir_Kinds_Denoting_Name
- | Iir_Kind_Element_Attribute
- | Iir_Kind_Subtype_Attribute =>
- return False;
- when others =>
- Error_Kind ("is_owned_subtype_indication", Def);
- end case;
- end Is_Owned_Subtype_Indication;
+ return Is_Proper_Subtype_Indication (Def);
+ end Has_Owned_Subtype_Indication;
function Get_Index_Type (Indexes : Iir_Flist; Idx : Natural) return Iir
is