@@ -166,13 +166,17 @@ namespace {
166
166
// / The location of the "preconcurrency" attribute if present.
167
167
const SourceLoc preconcurrencyLoc;
168
168
169
+ // / The location of the "unsafe" attribute if present.
170
+ const SourceLoc unsafeLoc;
171
+
169
172
ConformanceConstructionInfo () { }
170
173
171
174
ConformanceConstructionInfo (ProtocolDecl *item, SourceLoc loc,
172
175
SourceLoc uncheckedLoc,
173
- SourceLoc preconcurrencyLoc)
176
+ SourceLoc preconcurrencyLoc,
177
+ SourceLoc unsafeLoc)
174
178
: Located(item, loc), uncheckedLoc(uncheckedLoc),
175
- preconcurrencyLoc (preconcurrencyLoc) {}
179
+ preconcurrencyLoc (preconcurrencyLoc), unsafeLoc(unsafeLoc) {}
176
180
};
177
181
}
178
182
@@ -228,7 +232,7 @@ void ConformanceLookupTable::forEachInStage(ConformanceStage stage,
228
232
registerProtocolConformances (next, conformances);
229
233
for (auto conf : conformances) {
230
234
protocols.push_back (
231
- {conf->getProtocol (), SourceLoc (), SourceLoc (), SourceLoc ()});
235
+ {conf->getProtocol (), SourceLoc (), SourceLoc (), SourceLoc (), SourceLoc () });
232
236
}
233
237
} else if (next->getParentSourceFile () ||
234
238
next->getParentModule ()->isBuiltinModule ()) {
@@ -238,7 +242,8 @@ void ConformanceLookupTable::forEachInStage(ConformanceStage stage,
238
242
getDirectlyInheritedNominalTypeDecls (next, inverses, anyObject)) {
239
243
if (auto proto = dyn_cast<ProtocolDecl>(found.Item ))
240
244
protocols.push_back (
241
- {proto, found.Loc , found.uncheckedLoc , found.preconcurrencyLoc });
245
+ {proto, found.Loc , found.uncheckedLoc ,
246
+ found.preconcurrencyLoc , found.unsafeLoc });
242
247
}
243
248
}
244
249
@@ -343,7 +348,8 @@ void ConformanceLookupTable::updateLookupTable(NominalTypeDecl *nominal,
343
348
addProtocol (
344
349
locAndProto.Item , locAndProto.Loc ,
345
350
source.withUncheckedLoc (locAndProto.uncheckedLoc )
346
- .withPreconcurrencyLoc (locAndProto.preconcurrencyLoc ));
351
+ .withPreconcurrencyLoc (locAndProto.preconcurrencyLoc )
352
+ .withUnsafeLoc (locAndProto.unsafeLoc ));
347
353
});
348
354
break ;
349
355
0 commit comments