diff options
Diffstat (limited to 'src/vhdl/libghdl')
-rw-r--r-- | src/vhdl/libghdl/libghdl.adb | 33 | ||||
-rw-r--r-- | src/vhdl/libghdl/libghdl.ads | 3 |
2 files changed, 31 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 diff --git a/src/vhdl/libghdl/libghdl.ads b/src/vhdl/libghdl/libghdl.ads index 7d69cde23..5326666b8 100644 --- a/src/vhdl/libghdl/libghdl.ads +++ b/src/vhdl/libghdl/libghdl.ads @@ -34,6 +34,9 @@ package Libghdl is procedure Set_Exec_Prefix (Prefix : Thin_String_Ptr; Len : Natural); -- To be called before Analyze_File to initialize analysis. + function Analyze_Init_Status return Integer; + + -- Deprecated. Raise an exception in case of error. procedure Analyze_Init; -- Analyze one file. |