aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/iirs_utils.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl/iirs_utils.adb')
-rw-r--r--src/vhdl/iirs_utils.adb21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/vhdl/iirs_utils.adb b/src/vhdl/iirs_utils.adb
index 19966f306..cf1ecee5b 100644
--- a/src/vhdl/iirs_utils.adb
+++ b/src/vhdl/iirs_utils.adb
@@ -461,17 +461,24 @@ package body Iirs_Utils is
return;
end if;
- case Get_Kind (Unit) is
- when Iir_Kind_Design_Unit
- | Iir_Kind_Entity_Aspect_Entity =>
- null;
- when others =>
- Error_Kind ("add_dependence", Unit);
- end case;
+ pragma Assert (Kind_In (Unit, Iir_Kind_Design_Unit,
+ Iir_Kind_Entity_Aspect_Entity));
Add_Element (Get_Dependence_List (Target), Unit);
end Add_Dependence;
+ function Get_Unit_From_Dependence (Dep : Iir) return Iir is
+ begin
+ case Get_Kind (Dep) is
+ when Iir_Kind_Design_Unit =>
+ return Dep;
+ when Iir_Kind_Entity_Aspect_Entity =>
+ return Get_Design_Unit (Get_Entity (Dep));
+ when others =>
+ Error_Kind ("get_unit_from_dependence", Dep);
+ end case;
+ end Get_Unit_From_Dependence;
+
procedure Clear_Instantiation_Configuration_Vhdl87
(Parent : Iir; In_Generate : Boolean; Full : Boolean)
is