mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-21 18:22:53 +01:00
[Support] Add a C-API function to create a StringError instance.
This will allow C API clients to return errors from callbacks. This functionality will be used in upcoming Orc C-bindings functions.
This commit is contained in:
parent
dff52178bf
commit
3dc14bfbf7
@ -62,6 +62,11 @@ void LLVMDisposeErrorMessage(char *ErrMsg);
|
||||
*/
|
||||
LLVMErrorTypeId LLVMGetStringErrorTypeId(void);
|
||||
|
||||
/**
|
||||
* Create a StringError.
|
||||
*/
|
||||
LLVMErrorRef LLVMCreateStringError(const char *ErrMsg);
|
||||
|
||||
LLVM_C_EXTERN_C_END
|
||||
|
||||
#endif
|
||||
|
@ -168,3 +168,7 @@ void LLVMDisposeErrorMessage(char *ErrMsg) { delete[] ErrMsg; }
|
||||
LLVMErrorTypeId LLVMGetStringErrorTypeId() {
|
||||
return reinterpret_cast<void *>(&StringError::ID);
|
||||
}
|
||||
|
||||
LLVMErrorRef LLVMCreateStringError(const char *ErrMsg) {
|
||||
return wrap(make_error<StringError>(ErrMsg, inconvertibleErrorCode()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user