File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -257,17 +257,22 @@ public final class JIT {
257257 try checkForJITError ( LLVMOrcRemoveModule ( self . llvm, handle. llvm) )
258258 }
259259
260- private func checkForJITError( _ orcError: LLVMOrcErrorCode ) throws {
261- switch orcError {
262- case LLVMOrcErrSuccess:
260+ private func checkForJITError( _ orcError: LLVMErrorRef ! ) throws {
261+ guard let err = orcError else {
263262 return
264- case LLVMOrcErrGeneric:
265- guard let msg = LLVMOrcGetErrorMsg ( self . llvm) else {
263+ }
264+
265+ switch LLVMGetErrorTypeId ( err) ! {
266+ case LLVMGetStringErrorTypeId ( ) :
267+ guard let msg = LLVMGetErrorMessage ( self . llvm) else {
266268 fatalError ( " Couldn't get the error message? " )
267269 }
268270 throw JITError . generic ( String ( cString: msg) )
269271 default :
270- fatalError ( " Uncategorized ORC error code! " )
272+ guard let msg = LLVMOrcGetErrorMsg ( self . llvm) else {
273+ fatalError ( " Couldn't get the error message? " )
274+ }
275+ throw JITError . generic ( String ( cString: msg) )
271276 }
272277 }
273278}
You can’t perform that action at this time.
0 commit comments