mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[serialization] Reject modules with a different version number.
From now on, /any/ changes to SIL or AST serialization must increment VERSION_MINOR in ModuleFormat.h. The original intent of VERSION_MAJOR/VERSION_MINOR was that VERSION_MAJOR would only increment when backwards-incompatible changes are introduced, and VERSION_MINOR merely indicates whether to expect additional information. However, the module infrastructure currently isn't forgiving enough to accept even backwards-compatible changes to the record schemas, and the SIL serialization design might not be compatible with that at all. So for now, treat any version number 0.x as incompatible with any other 0.y. We can bump to 1 when we hit stability. <rdar://problem/15494343> Swift SVN r13841
This commit is contained in:
@@ -31,15 +31,13 @@ const unsigned char SIGNATURE[] = { 0xE2, 0x9C, 0xA8, 0x0E };
|
||||
|
||||
/// Serialized module format major version number.
|
||||
///
|
||||
/// When the format changes in such a way that older compilers will not be
|
||||
/// able to read the file at all, this number should be incremented.
|
||||
const unsigned VERSION_MAJOR = 1;
|
||||
/// Always 0 for Swift 1.0.
|
||||
const uint16_t VERSION_MAJOR = 0;
|
||||
|
||||
/// Serialized module format minor version number.
|
||||
///
|
||||
/// When the format changes in a backwards-compatible way, this number should
|
||||
/// be incremented.
|
||||
const unsigned VERSION_MINOR = 0;
|
||||
/// When the format changes IN ANY WAY, this number should be incremented.
|
||||
const uint16_t VERSION_MINOR = 1;
|
||||
|
||||
using DeclID = Fixnum<31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
|
||||
Reference in New Issue
Block a user