mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
(De-)serialization for foreign error conventions.
Printing a module as Objective-C turns out to be a fantastic way to verify the (de-)serialization of foreign error conventions, so collapse the parsing-driving Objective-C printing test of throwing methods into the general test for methods. Swift SVN r27870
This commit is contained in:
@@ -51,7 +51,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// To ensure that two separate changes don't silently get merged into one
|
||||
/// in source control, you should also update the comment to briefly
|
||||
/// describe what change you made.
|
||||
const uint16_t VERSION_MINOR = 196; // Last change: constrained extension xref
|
||||
const uint16_t VERSION_MINOR = 197; // Last change: foreign error convention
|
||||
|
||||
using DeclID = Fixnum<31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
@@ -115,6 +115,15 @@ enum class FunctionTypeRepresentation : uint8_t {
|
||||
};
|
||||
using FunctionTypeRepresentationField = BCFixed<4>;
|
||||
|
||||
enum class ForeignErrorConventionKind : uint8_t {
|
||||
ZeroResult,
|
||||
NonZeroResult,
|
||||
NilResult,
|
||||
NonNilError,
|
||||
};
|
||||
|
||||
using ForeignErrorConventionKindField = BCFixed<2>;
|
||||
|
||||
// These IDs must \em not be renumbered or reordered without incrementing
|
||||
// VERSION_MAJOR.
|
||||
enum class SILFunctionTypeRepresentation : uint8_t {
|
||||
@@ -1209,6 +1218,15 @@ namespace decls_block {
|
||||
BCFixed<1> // is a decl
|
||||
>;
|
||||
|
||||
using ForeignErrorConventionLayout = BCRecordLayout<
|
||||
FOREIGN_ERROR_CONVENTION,
|
||||
ForeignErrorConventionKindField, // kind
|
||||
BCFixed<1>, // owned
|
||||
BCVBR<4>, // error parameter index
|
||||
TypeIDField, // error parameter type
|
||||
TypeIDField // result type
|
||||
>;
|
||||
|
||||
using AbstractClosureExprLayout = BCRecordLayout<
|
||||
ABSTRACT_CLOSURE_EXPR_CONTEXT,
|
||||
TypeIDField, // type
|
||||
|
||||
Reference in New Issue
Block a user