diff options
author | gingold | 2005-12-18 14:46:45 +0000 |
---|---|---|
committer | gingold | 2005-12-18 14:46:45 +0000 |
commit | cb45d7c240f4aabbd1dd716dd8bf7ab5b2107ff2 (patch) | |
tree | a5162922d12f8508b931c31014370056c35682b3 /libraries.adb | |
parent | 4ed054ad8c1877c1bd620014cfe8a36979c5aa54 (diff) | |
download | ghdl-cb45d7c240f4aabbd1dd716dd8bf7ab5b2107ff2.tar.gz ghdl-cb45d7c240f4aabbd1dd716dd8bf7ab5b2107ff2.tar.bz2 ghdl-cb45d7c240f4aabbd1dd716dd8bf7ab5b2107ff2.zip |
ghdl 0.21 is out
Diffstat (limited to 'libraries.adb')
-rw-r--r-- | libraries.adb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libraries.adb b/libraries.adb index c82bc78..f06bd16 100644 --- a/libraries.adb +++ b/libraries.adb @@ -1631,4 +1631,28 @@ package body Libraries is return Design_Unit; end Load_Secondary_Unit; + function Find_Entity_For_Component (Name: Name_Id) return Iir_Design_Unit + is + Res : Iir_Design_Unit := Null_Iir; + Unit : Iir_Design_Unit; + begin + Unit := Unit_Hash_Table (Name mod Unit_Hash_Length); + while Unit /= Null_Iir loop + if Get_Identifier (Unit) = Name + and then (Get_Kind (Get_Library_Unit (Unit)) + = Iir_Kind_Entity_Declaration) + then + if Res = Null_Iir then + Res := Unit; + else + -- Many entities. + return Null_Iir; + end if; + end if; + Unit := Get_Hash_Chain (Unit); + end loop; + + return Res; + end Find_Entity_For_Component; + end Libraries; |