Make an Error.h that declares the public ABI for errors.

NFC except that I added swift_errorRetain and swift_errorRelease
functions on non-ObjC targets so that we have consistent
functions to call in the runtime.  I have not changed everywhere
in the runtime to use these, nor have I changed the compiler to
call them.
This commit is contained in:
John McCall
2021-02-21 23:42:47 -05:00
parent 8e9823c369
commit 1c82c71486
3 changed files with 104 additions and 57 deletions

View File

@@ -106,4 +106,12 @@ swift::swift_getErrorValue(const SwiftError *errorObject,
out->errorConformance = errorObject->errorConformance;
}
SwiftError *swift::swift_errorRetain(SwiftError *error) {
return static_cast<SwiftError*>(swift_retain(error));
}
void swift::swift_errorRelease(SwiftError *error) {
swift_release(error);
}
#endif