mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last major piece to be implemented.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This implements the object representation of the standard ErrorProtocol
|
||||
// This implements the object representation of the standard Error
|
||||
// protocol type, which represents recoverable errors in the language. This
|
||||
// implementation is used when ObjC interop is disabled; the ObjC-interoperable
|
||||
// version is implemented in ErrorObject.mm.
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
using namespace swift;
|
||||
|
||||
/// Determine the size and alignment of an ErrorProtocol box containing the given
|
||||
/// Determine the size and alignment of an Error box containing the given
|
||||
/// type.
|
||||
static std::pair<size_t, size_t>
|
||||
_getErrorAllocatedSizeAndAlignmentMask(const Metadata *type) {
|
||||
@@ -43,7 +43,7 @@ _getErrorAllocatedSizeAndAlignmentMask(const Metadata *type) {
|
||||
return {size, alignMask};
|
||||
}
|
||||
|
||||
/// Destructor for an ErrorProtocol box.
|
||||
/// Destructor for an Error box.
|
||||
static void _destroyErrorObject(HeapObject *obj) {
|
||||
auto error = static_cast<SwiftError *>(obj);
|
||||
|
||||
@@ -56,8 +56,8 @@ static void _destroyErrorObject(HeapObject *obj) {
|
||||
swift_deallocObject(obj, sizeAndAlign.first, sizeAndAlign.second);
|
||||
}
|
||||
|
||||
/// Heap metadata for ErrorProtocol boxes.
|
||||
static const FullMetadata<HeapMetadata> ErrorProtocolMetadata{
|
||||
/// Heap metadata for Error boxes.
|
||||
static const FullMetadata<HeapMetadata> ErrorMetadata{
|
||||
HeapMetadataHeader{{_destroyErrorObject}, {&_TWVBo}},
|
||||
Metadata{MetadataKind::ErrorObject},
|
||||
};
|
||||
@@ -71,7 +71,7 @@ swift::swift_allocError(const swift::Metadata *type,
|
||||
bool isTake) {
|
||||
auto sizeAndAlign = _getErrorAllocatedSizeAndAlignmentMask(type);
|
||||
|
||||
auto allocated = swift_allocObject(&ErrorProtocolMetadata,
|
||||
auto allocated = swift_allocObject(&ErrorMetadata,
|
||||
sizeAndAlign.first, sizeAndAlign.second);
|
||||
|
||||
auto error = reinterpret_cast<SwiftError*>(allocated);
|
||||
|
||||
Reference in New Issue
Block a user