diff options
Diffstat (limited to 'src/vhdl/libghdl/libghdl.adb')
-rw-r--r-- | src/vhdl/libghdl/libghdl.adb | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/vhdl/libghdl/libghdl.adb b/src/vhdl/libghdl/libghdl.adb index 67de461cf..bd6d83c5a 100644 --- a/src/vhdl/libghdl/libghdl.adb +++ b/src/vhdl/libghdl/libghdl.adb @@ -39,13 +39,24 @@ package body Libghdl is end if; end Set_Option; - procedure Compile_Init (Analyze_Only : Boolean) is + function Compile_Init_Status (Analyze_Only : Boolean) return Integer is begin if Analyze_Only then - return; + return 0; + end if; + + if not Ghdllocal.Setup_Libraries (True) then + return -1; end if; - Ghdllocal.Setup_Libraries (True); + return 0; + end Compile_Init_Status; + + procedure Compile_Init (Analyze_Only : Boolean) is + begin + if Compile_Init_Status (Analyze_Only) /= 0 then + raise Option_Error; + end if; end Compile_Init; procedure Compile_Elab @@ -87,10 +98,22 @@ package body Libghdl is Disp_Long_Help'Access); end Set_Hooks; - procedure Analyze_Init is + function Analyze_Init_Status return Integer is begin -- Load libraries... - Compile_Init (False); + if Compile_Init_Status (False) /= 0 then + return -1; + end if; + + return 0; + end Analyze_Init_Status; + + procedure Analyze_Init is + begin + -- Deprecated + if Analyze_Init_Status /= 0 then + raise Option_Error; + end if; end Analyze_Init; function Analyze_File (File : Thin_String_Ptr; Len : Natural) return Iir is |