File tree Expand file tree Collapse file tree 3 files changed +21
-16
lines changed Expand file tree Collapse file tree 3 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,12 @@ static ValidationInfo validateControlBlock(
334
334
LLVM_FALLTHROUGH;
335
335
case 3 :
336
336
result.shortVersion = blobData.slice (0 , scratch[2 ]);
337
+
338
+ // If the format version doesn't match, give up after also getting the
339
+ // compiler version. This provides better diagnostics.
340
+ if (result.status != Status::Valid)
341
+ return result;
342
+
337
343
LLVM_FALLTHROUGH;
338
344
case 2 :
339
345
case 1 :
Original file line number Diff line number Diff line change @@ -58,8 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
58
58
// / describe what change you made. The content of this comment isn't important;
59
59
// / it just ensures a conflict if two people change the module format.
60
60
// / Don't worry about adhering to the 80-column limit for this line.
61
- const uint16_t SWIFTMODULE_VERSION_MINOR =
62
- 875 ; // Add package field to SerializedKind_t
61
+ const uint16_t SWIFTMODULE_VERSION_MINOR = 876 ; // Reorder control block enum
63
62
64
63
// / A standard hash seed used for all string hashes in a serialized module.
65
64
// /
@@ -862,11 +861,11 @@ namespace control_block {
862
861
MODULE_NAME,
863
862
TARGET,
864
863
SDK_NAME,
865
- SDK_VERSION,
866
864
REVISION,
867
- CHANNEL,
868
865
IS_OSSA,
869
866
ALLOWABLE_CLIENT_NAME,
867
+ CHANNEL,
868
+ SDK_VERSION,
870
869
};
871
870
872
871
using MetadataLayout = BCRecordLayout<
@@ -897,21 +896,11 @@ namespace control_block {
897
896
BCBlob
898
897
>;
899
898
900
- using SDKVersionLayout = BCRecordLayout<
901
- SDK_VERSION,
902
- BCBlob
903
- >;
904
-
905
899
using RevisionLayout = BCRecordLayout<
906
900
REVISION,
907
901
BCBlob
908
902
>;
909
903
910
- using ChannelLayout = BCRecordLayout<
911
- CHANNEL,
912
- BCBlob
913
- >;
914
-
915
904
using IsOSSALayout = BCRecordLayout<
916
905
IS_OSSA,
917
906
BCFixed<1 >
@@ -921,6 +910,16 @@ namespace control_block {
921
910
ALLOWABLE_CLIENT_NAME,
922
911
BCBlob
923
912
>;
913
+
914
+ using ChannelLayout = BCRecordLayout<
915
+ CHANNEL,
916
+ BCBlob
917
+ >;
918
+
919
+ using SDKVersionLayout = BCRecordLayout<
920
+ SDK_VERSION,
921
+ BCBlob
922
+ >;
924
923
}
925
924
926
925
// / The record types within the options block (a sub-block of the control
Original file line number Diff line number Diff line change @@ -834,11 +834,11 @@ void Serializer::writeBlockInfoBlock() {
834
834
BLOCK_RECORD (control_block, MODULE_NAME);
835
835
BLOCK_RECORD (control_block, TARGET);
836
836
BLOCK_RECORD (control_block, SDK_NAME);
837
- BLOCK_RECORD (control_block, SDK_VERSION);
838
837
BLOCK_RECORD (control_block, REVISION);
839
- BLOCK_RECORD (control_block, CHANNEL);
840
838
BLOCK_RECORD (control_block, IS_OSSA);
841
839
BLOCK_RECORD (control_block, ALLOWABLE_CLIENT_NAME);
840
+ BLOCK_RECORD (control_block, CHANNEL);
841
+ BLOCK_RECORD (control_block, SDK_VERSION);
842
842
843
843
BLOCK (OPTIONS_BLOCK);
844
844
BLOCK_RECORD (options_block, SDK_PATH);
You can’t perform that action at this time.
0 commit comments