diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-10-31 06:18:26 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-10-31 06:18:26 +0100 |
commit | 94b688c2323655338898bee15b99a0126c8af386 (patch) | |
tree | eaf1a1bd98e86ac93a2535b701d7509513a95b65 /src/vhdl | |
parent | 3f4ad3263f7e5294e20166c1396db48826a4bda5 (diff) | |
download | ghdl-94b688c2323655338898bee15b99a0126c8af386.tar.gz ghdl-94b688c2323655338898bee15b99a0126c8af386.tar.bz2 ghdl-94b688c2323655338898bee15b99a0126c8af386.zip |
nodes_gc: update for entity_aspect_entity.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/nodes_gc.adb | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/vhdl/nodes_gc.adb b/src/vhdl/nodes_gc.adb index fde394e4e..c32facef7 100644 --- a/src/vhdl/nodes_gc.adb +++ b/src/vhdl/nodes_gc.adb @@ -285,13 +285,26 @@ package body Nodes_GC is when Iir_Kind_Entity_Aspect_Entity => declare Ent : constant Iir := Get_Entity_Name (El); - Arch : constant Iir := Get_Architecture (El); + Arch_Name : constant Iir := Get_Architecture (El); + Arch : Iir; begin Mark_Unit (Get_Design_Unit (Get_Named_Entity (Ent))); - if Is_Valid (Arch) - and then Is_Valid (Get_Named_Entity (Arch)) - then - Mark_Unit (Get_Named_Entity (Arch)); + + -- Architecture is optional. + if Is_Valid (Arch_Name) then + Arch := Get_Named_Entity (Arch_Name); + -- There are many possibilities for the architecture. + if Is_Valid (Arch) then + case Get_Kind (Arch) is + when Iir_Kind_Design_Unit => + null; + when Iir_Kind_Architecture_Body => + Arch := Get_Design_Unit (Arch); + when others => + Error_Kind ("mark_unit", Arch); + end case; + Mark_Unit (Arch); + end if; end if; end; when others => |