@@ -252,9 +252,10 @@ ParameterList *ModuleFile::readParameterList() {
252
252
using namespace decls_block ;
253
253
254
254
SmallVector<uint64_t , 8 > scratch;
255
- llvm::BitstreamEntry entry = fatalIfUnexpected (
256
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
257
- unsigned recordID = fatalIfUnexpected (DeclTypeCursor.readRecord (entry.ID , scratch));
255
+ llvm::BitstreamEntry entry =
256
+ fatalIfUnexpected (DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
257
+ unsigned recordID =
258
+ fatalIfUnexpected (DeclTypeCursor.readRecord (entry.ID , scratch));
258
259
assert (recordID == PARAMETERLIST);
259
260
(void ) recordID;
260
261
@@ -286,8 +287,8 @@ Expected<Pattern *> ModuleFile::readPattern(DeclContext *owningDC) {
286
287
SmallVector<uint64_t , 8 > scratch;
287
288
288
289
BCOffsetRAII restoreOffset (DeclTypeCursor);
289
- llvm::BitstreamEntry next = fatalIfUnexpected (
290
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
290
+ llvm::BitstreamEntry next =
291
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
291
292
if (next.Kind != llvm::BitstreamEntry::Record) {
292
293
error ();
293
294
return nullptr ;
@@ -336,8 +337,7 @@ Expected<Pattern *> ModuleFile::readPattern(DeclContext *owningDC) {
336
337
next = fatalIfUnexpected (DeclTypeCursor.advance ());
337
338
assert (next.Kind == llvm::BitstreamEntry::Record);
338
339
339
- kind = fatalIfUnexpected (
340
- DeclTypeCursor.readRecord (next.ID , scratch));
340
+ kind = fatalIfUnexpected (DeclTypeCursor.readRecord (next.ID , scratch));
341
341
assert (kind == decls_block::TUPLE_PATTERN_ELT);
342
342
343
343
// FIXME: Add something for this record or remove it.
@@ -429,8 +429,8 @@ SILLayout *ModuleFile::readSILLayout(llvm::BitstreamCursor &Cursor) {
429
429
430
430
SmallVector<uint64_t , 16 > scratch;
431
431
432
- llvm::BitstreamEntry next = fatalIfUnexpected (
433
- Cursor.advance (AF_DontPopBlockAtEnd));
432
+ llvm::BitstreamEntry next =
433
+ fatalIfUnexpected ( Cursor.advance (AF_DontPopBlockAtEnd));
434
434
assert (next.Kind == llvm::BitstreamEntry::Record);
435
435
436
436
unsigned kind = fatalIfUnexpected (Cursor.readRecord (next.ID , scratch));
@@ -469,8 +469,8 @@ ProtocolConformanceRef ModuleFile::readConformance(
469
469
470
470
SmallVector<uint64_t , 16 > scratch;
471
471
472
- llvm::BitstreamEntry next = fatalIfUnexpected (
473
- Cursor.advance (AF_DontPopBlockAtEnd));
472
+ llvm::BitstreamEntry next =
473
+ fatalIfUnexpected ( Cursor.advance (AF_DontPopBlockAtEnd));
474
474
assert (next.Kind == llvm::BitstreamEntry::Record);
475
475
476
476
if (getContext ().Stats )
@@ -610,8 +610,7 @@ NormalProtocolConformance *ModuleFile::readNormalConformance(
610
610
// Find the conformance record.
611
611
BCOffsetRAII restoreOffset (DeclTypeCursor);
612
612
fatalIfNotSuccess (DeclTypeCursor.JumpToBit (conformanceEntry));
613
- llvm::BitstreamEntry entry =
614
- fatalIfUnexpected (DeclTypeCursor.advance ());
613
+ llvm::BitstreamEntry entry = fatalIfUnexpected (DeclTypeCursor.advance ());
615
614
if (entry.Kind != llvm::BitstreamEntry::Record) {
616
615
error ();
617
616
return nullptr ;
@@ -675,13 +674,13 @@ GenericParamList *ModuleFile::maybeReadGenericParams(DeclContext *DC) {
675
674
SmallVector<uint64_t , 8 > scratch;
676
675
StringRef blobData;
677
676
678
- llvm::BitstreamEntry next = fatalIfUnexpected (
679
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
677
+ llvm::BitstreamEntry next =
678
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
680
679
if (next.Kind != llvm::BitstreamEntry::Record)
681
680
return nullptr ;
682
681
683
- unsigned kind = fatalIfUnexpected (
684
- DeclTypeCursor.readRecord (next.ID , scratch, &blobData));
682
+ unsigned kind =
683
+ fatalIfUnexpected ( DeclTypeCursor.readRecord (next.ID , scratch, &blobData));
685
684
if (kind != GENERIC_PARAM_LIST)
686
685
return nullptr ;
687
686
lastRecordOffset.reset ();
@@ -718,8 +717,8 @@ void ModuleFile::readGenericRequirements(
718
717
lastRecordOffset.reset ();
719
718
bool shouldContinue = true ;
720
719
721
- llvm::BitstreamEntry entry = fatalIfUnexpected (
722
- Cursor.advance (AF_DontPopBlockAtEnd));
720
+ llvm::BitstreamEntry entry =
721
+ fatalIfUnexpected ( Cursor.advance (AF_DontPopBlockAtEnd));
723
722
if (entry.Kind != llvm::BitstreamEntry::Record)
724
723
break ;
725
724
@@ -910,8 +909,8 @@ GenericSignature *ModuleFile::getGenericSignature(
910
909
StringRef blobData;
911
910
SmallVector<uint64_t , 8 > scratch;
912
911
913
- llvm::BitstreamEntry entry = fatalIfUnexpected (
914
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
912
+ llvm::BitstreamEntry entry =
913
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
915
914
if (entry.Kind != llvm::BitstreamEntry::Record) {
916
915
error ();
917
916
return nullptr ;
@@ -1002,8 +1001,8 @@ ModuleFile::getGenericSignatureOrEnvironment(
1002
1001
// own internal tracking.)
1003
1002
BCOffsetRAII lastRecordOffset (DeclTypeCursor);
1004
1003
1005
- llvm::BitstreamEntry entry = fatalIfUnexpected (
1006
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1004
+ llvm::BitstreamEntry entry =
1005
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1007
1006
if (entry.Kind != llvm::BitstreamEntry::Record)
1008
1007
return result;
1009
1008
@@ -1108,8 +1107,8 @@ SubstitutionMap ModuleFile::getSubstitutionMap(
1108
1107
DeserializingEntityRAII deserializingEntity (*this );
1109
1108
1110
1109
// Read the substitution map.
1111
- llvm::BitstreamEntry entry = fatalIfUnexpected (
1112
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1110
+ llvm::BitstreamEntry entry =
1111
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1113
1112
if (entry.Kind != llvm::BitstreamEntry::Record) {
1114
1113
error ();
1115
1114
return SubstitutionMap ();
@@ -1170,15 +1169,15 @@ SubstitutionMap ModuleFile::getSubstitutionMap(
1170
1169
bool ModuleFile::readDefaultWitnessTable (ProtocolDecl *proto) {
1171
1170
using namespace decls_block ;
1172
1171
1173
- llvm::BitstreamEntry entry = fatalIfUnexpected (
1174
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1172
+ llvm::BitstreamEntry entry =
1173
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1175
1174
if (entry.Kind != llvm::BitstreamEntry::Record)
1176
1175
return true ;
1177
1176
1178
1177
SmallVector<uint64_t , 16 > witnessIDBuffer;
1179
1178
1180
- unsigned kind = fatalIfUnexpected (
1181
- DeclTypeCursor.readRecord (entry.ID , witnessIDBuffer));
1179
+ unsigned kind =
1180
+ fatalIfUnexpected ( DeclTypeCursor.readRecord (entry.ID , witnessIDBuffer));
1182
1181
assert (kind == DEFAULT_WITNESS_TABLE);
1183
1182
(void )kind;
1184
1183
@@ -1327,8 +1326,8 @@ ModuleFile::resolveCrossReference(ModuleID MID, uint32_t pathLen) {
1327
1326
assert (baseModule && " missing dependency" );
1328
1327
PrettyXRefTrace pathTrace (*baseModule);
1329
1328
1330
- llvm::BitstreamEntry entry = fatalIfUnexpected (
1331
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1329
+ llvm::BitstreamEntry entry =
1330
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1332
1331
if (entry.Kind != llvm::BitstreamEntry::Record) {
1333
1332
error ();
1334
1333
return nullptr ;
@@ -1455,8 +1454,8 @@ ModuleFile::resolveCrossReference(ModuleID MID, uint32_t pathLen) {
1455
1454
auto getXRefDeclNameForError = [&]() -> DeclName {
1456
1455
DeclName result = pathTrace.getLastName ();
1457
1456
while (--pathLen) {
1458
- llvm::BitstreamEntry entry = fatalIfUnexpected (
1459
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1457
+ llvm::BitstreamEntry entry =
1458
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1460
1459
if (entry.Kind != llvm::BitstreamEntry::Record)
1461
1460
return Identifier ();
1462
1461
@@ -1531,8 +1530,8 @@ ModuleFile::resolveCrossReference(ModuleID MID, uint32_t pathLen) {
1531
1530
1532
1531
// For remaining path pieces, filter or drill down into the results we have.
1533
1532
while (--pathLen) {
1534
- llvm::BitstreamEntry entry = fatalIfUnexpected (
1535
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1533
+ llvm::BitstreamEntry entry =
1534
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
1536
1535
if (entry.Kind != llvm::BitstreamEntry::Record) {
1537
1536
error ();
1538
1537
return nullptr ;
@@ -1948,8 +1947,7 @@ DeclContext *ModuleFile::getLocalDeclContext(DeclContextID DCID) {
1948
1947
1949
1948
BCOffsetRAII restoreOffset (DeclTypeCursor);
1950
1949
fatalIfNotSuccess (DeclTypeCursor.JumpToBit (declContextOrOffset));
1951
- llvm::BitstreamEntry entry =
1952
- fatalIfUnexpected (DeclTypeCursor.advance ());
1950
+ llvm::BitstreamEntry entry = fatalIfUnexpected (DeclTypeCursor.advance ());
1953
1951
1954
1952
if (entry.Kind != llvm::BitstreamEntry::Record) {
1955
1953
error ();
@@ -2048,8 +2046,7 @@ DeclContext *ModuleFile::getDeclContext(DeclContextID DCID) {
2048
2046
2049
2047
BCOffsetRAII restoreOffset (DeclTypeCursor);
2050
2048
fatalIfNotSuccess (DeclTypeCursor.JumpToBit (declContextOrOffset));
2051
- llvm::BitstreamEntry entry =
2052
- fatalIfUnexpected (DeclTypeCursor.advance ());
2049
+ llvm::BitstreamEntry entry = fatalIfUnexpected (DeclTypeCursor.advance ());
2053
2050
2054
2051
if (entry.Kind != llvm::BitstreamEntry::Record) {
2055
2052
error ();
@@ -4791,8 +4788,8 @@ class swift::TypeDeserializer {
4791
4788
// The tuple record itself is empty. Read all trailing elements.
4792
4789
SmallVector<TupleTypeElt, 8 > elements;
4793
4790
while (true ) {
4794
- llvm::BitstreamEntry entry = MF. fatalIfUnexpected (
4795
- MF.DeclTypeCursor .advance (AF_DontPopBlockAtEnd));
4791
+ llvm::BitstreamEntry entry =
4792
+ MF.fatalIfUnexpected (MF. DeclTypeCursor .advance (AF_DontPopBlockAtEnd));
4796
4793
if (entry.Kind != llvm::BitstreamEntry::Record)
4797
4794
break ;
4798
4795
@@ -4858,8 +4855,8 @@ class swift::TypeDeserializer {
4858
4855
4859
4856
SmallVector<AnyFunctionType::Param, 8 > params;
4860
4857
while (true ) {
4861
- llvm::BitstreamEntry entry = MF. fatalIfUnexpected (
4862
- MF.DeclTypeCursor .advance (AF_DontPopBlockAtEnd));
4858
+ llvm::BitstreamEntry entry =
4859
+ MF.fatalIfUnexpected (MF. DeclTypeCursor .advance (AF_DontPopBlockAtEnd));
4863
4860
if (entry.Kind != llvm::BitstreamEntry::Record)
4864
4861
break ;
4865
4862
@@ -5595,17 +5592,16 @@ void ModuleFile::loadAllMembers(Decl *container, uint64_t contextData) {
5595
5592
5596
5593
BCOffsetRAII restoreOffset (DeclTypeCursor);
5597
5594
fatalIfNotSuccess (DeclTypeCursor.JumpToBit (contextData));
5598
- llvm::BitstreamEntry entry =
5599
- fatalIfUnexpected (DeclTypeCursor.advance ());
5595
+ llvm::BitstreamEntry entry = fatalIfUnexpected (DeclTypeCursor.advance ());
5600
5596
if (entry.Kind != llvm::BitstreamEntry::Record) {
5601
5597
error ();
5602
5598
return ;
5603
5599
}
5604
5600
5605
5601
SmallVector<uint64_t , 16 > memberIDBuffer;
5606
5602
5607
- unsigned kind = fatalIfUnexpected (
5608
- DeclTypeCursor.readRecord (entry.ID , memberIDBuffer));
5603
+ unsigned kind =
5604
+ fatalIfUnexpected ( DeclTypeCursor.readRecord (entry.ID , memberIDBuffer));
5609
5605
assert (kind == decls_block::MEMBERS);
5610
5606
(void )kind;
5611
5607
@@ -5688,8 +5684,7 @@ void ModuleFile::finishNormalConformance(NormalProtocolConformance *conformance,
5688
5684
// Find the conformance record.
5689
5685
BCOffsetRAII restoreOffset (DeclTypeCursor);
5690
5686
fatalIfNotSuccess (DeclTypeCursor.JumpToBit (contextData));
5691
- llvm::BitstreamEntry entry =
5692
- fatalIfUnexpected (DeclTypeCursor.advance ());
5687
+ llvm::BitstreamEntry entry = fatalIfUnexpected (DeclTypeCursor.advance ());
5693
5688
assert (entry.Kind == llvm::BitstreamEntry::Record &&
5694
5689
" registered lazy loader incorrectly" );
5695
5690
@@ -5923,8 +5918,8 @@ Optional<StringRef> ModuleFile::maybeReadInlinableBodyText() {
5923
5918
BCOffsetRAII restoreOffset (DeclTypeCursor);
5924
5919
StringRef blobData;
5925
5920
5926
- llvm::BitstreamEntry next = fatalIfUnexpected (
5927
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
5921
+ llvm::BitstreamEntry next =
5922
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
5928
5923
if (next.Kind != llvm::BitstreamEntry::Record)
5929
5924
return None;
5930
5925
@@ -5950,8 +5945,8 @@ Optional<ForeignErrorConvention> ModuleFile::maybeReadForeignErrorConvention() {
5950
5945
5951
5946
BCOffsetRAII restoreOffset (DeclTypeCursor);
5952
5947
5953
- llvm::BitstreamEntry next = fatalIfUnexpected (
5954
- DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
5948
+ llvm::BitstreamEntry next =
5949
+ fatalIfUnexpected ( DeclTypeCursor.advance (AF_DontPopBlockAtEnd));
5955
5950
if (next.Kind != llvm::BitstreamEntry::Record)
5956
5951
return None;
5957
5952
0 commit comments