diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-10-15 13:23:36 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-10-15 13:23:36 +0200 |
commit | 0d82b72ca11cb249888356caec800ddd43a70c82 (patch) | |
tree | 32aff68491cf3ecf5b168736cb783f988af96ea1 /src/vhdl/translate/trans-chap12.adb | |
parent | 6130e048c1dc667684d16792e9439a95483cbeb3 (diff) | |
download | ghdl-0d82b72ca11cb249888356caec800ddd43a70c82.tar.gz ghdl-0d82b72ca11cb249888356caec800ddd43a70c82.tar.bz2 ghdl-0d82b72ca11cb249888356caec800ddd43a70c82.zip |
Finish_Compilation: factorize code, move to libraries.
Diffstat (limited to 'src/vhdl/translate/trans-chap12.adb')
-rw-r--r-- | src/vhdl/translate/trans-chap12.adb | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/vhdl/translate/trans-chap12.adb b/src/vhdl/translate/trans-chap12.adb index 931a34990..28883babb 100644 --- a/src/vhdl/translate/trans-chap12.adb +++ b/src/vhdl/translate/trans-chap12.adb @@ -243,24 +243,25 @@ package body Trans.Chap12 is end loop; -- Default config. - Config := Get_Library_Unit - (Get_Default_Configuration_Declaration (Arch)); - Config_Info := Get_Info (Config); - if Config_Info /= null then - -- Do not create a trampoline for the default_config if it is not - -- used. - Start_Procedure_Decl - (Inter_List, Create_Identifier ("DEFAULT_CONFIG"), - O_Storage_Public); - New_Interface_Decl (Inter_List, Instance, Wki_Instance, - Arch_Info.Block_Decls_Ptr_Type); - Finish_Subprogram_Decl (Inter_List, Subprg); - - Start_Subprogram_Body (Subprg); - Start_Association (Constr, Config_Info.Config_Subprg); - New_Association (Constr, New_Obj_Value (Instance)); - New_Procedure_Call (Constr); + Config := Get_Default_Configuration_Declaration (Arch); + if Is_Valid (Config) then + Config_Info := Get_Info (Get_Library_Unit (Config)); + if Config_Info /= null then + -- Do not create a trampoline for the default_config if it is not + -- used. + Start_Procedure_Decl + (Inter_List, Create_Identifier ("DEFAULT_CONFIG"), + O_Storage_Public); + New_Interface_Decl (Inter_List, Instance, Wki_Instance, + Arch_Info.Block_Decls_Ptr_Type); + Finish_Subprogram_Decl (Inter_List, Subprg); + + Start_Subprogram_Body (Subprg); + Start_Association (Constr, Config_Info.Config_Subprg); + New_Association (Constr, New_Obj_Value (Instance)); + New_Procedure_Call (Constr); Finish_Subprogram_Body; + end if; end if; Pop_Identifier_Prefix (Arch_Mark); |