diff options
-rw-r--r-- | src/vhdl/vhdl-configuration.adb | 5 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes_walk.adb | 35 |
2 files changed, 27 insertions, 13 deletions
diff --git a/src/vhdl/vhdl-configuration.adb b/src/vhdl/vhdl-configuration.adb index 25e29b305..8911c93dd 100644 --- a/src/vhdl/vhdl-configuration.adb +++ b/src/vhdl/vhdl-configuration.adb @@ -814,7 +814,10 @@ package body Vhdl.Configuration is case Iir_Kinds_Entity_Aspect (Get_Kind (Aspect)) is when Iir_Kind_Entity_Aspect_Entity => Unit := Get_Entity (Aspect); - Set_Elab_Flag (Get_Parent (Unit), True); + if Unit /= Null_Node then + -- There may be an error (unit not found). + Set_Elab_Flag (Get_Parent (Unit), True); + end if; when Iir_Kind_Entity_Aspect_Configuration | Iir_Kind_Entity_Aspect_Open => null; diff --git a/src/vhdl/vhdl-nodes_walk.adb b/src/vhdl/vhdl-nodes_walk.adb index e9ae956a7..0bbddef3b 100644 --- a/src/vhdl/vhdl-nodes_walk.adb +++ b/src/vhdl/vhdl-nodes_walk.adb @@ -159,27 +159,38 @@ package body Vhdl.Nodes_Walk is when Iir_Kinds_Simple_Concurrent_Statement | Iir_Kind_Component_Instantiation_Statement => Status := Cb.all (El); - if Status /= Walk_Continue then - return Status; - end if; when Iir_Kind_Block_Statement => Status := Cb.all (El); - if Status /= Walk_Continue then - return Status; + if Status = Walk_Continue then + Status := Walk_Concurrent_Statements_Chain + (Get_Concurrent_Statement_Chain (El), Cb); end if; - return Walk_Concurrent_Statements_Chain - (Get_Concurrent_Statement_Chain (El), Cb); when Iir_Kind_For_Generate_Statement => Status := Cb.all (El); - if Status /= Walk_Continue then - return Status; + if Status = Walk_Continue then + Status := Walk_Concurrent_Statements_Chain + (Get_Concurrent_Statement_Chain + (Get_Generate_Statement_Body (El)), Cb); end if; - return Walk_Concurrent_Statements_Chain - (Get_Concurrent_Statement_Chain - (Get_Generate_Statement_Body (El)), Cb); + when Iir_Kind_If_Generate_Statement => + declare + Cl : Node; + begin + Status := Cb.all (El); + Cl := El; + while Status = Walk_Continue and then Cl /= Null_Node loop + Status := Walk_Concurrent_Statements_Chain + (Get_Concurrent_Statement_Chain + (Get_Generate_Statement_Body (Cl)), Cb); + Cl := Get_Generate_Else_Clause (Cl); + end loop; + end; when others => Error_Kind ("walk_concurrent_statements_chain", El); end case; + if Status /= Walk_Continue then + return Status; + end if; El := Get_Chain (El); end loop; |