@@ -266,18 +266,14 @@ struct SILDeclRef {
266
266
bool operator ==(SILDeclRef rhs) const {
267
267
return loc.getOpaqueValue () == rhs.loc .getOpaqueValue ()
268
268
&& kind == rhs.kind
269
+ && Expansion == rhs.Expansion
269
270
&& uncurryLevel == rhs.uncurryLevel
270
271
&& isForeign == rhs.isForeign
271
272
&& isDirectReference == rhs.isDirectReference
272
273
&& defaultArgIndex == rhs.defaultArgIndex ;
273
274
}
274
275
bool operator !=(SILDeclRef rhs) const {
275
- return loc.getOpaqueValue () != rhs.loc .getOpaqueValue ()
276
- || kind != rhs.kind
277
- || uncurryLevel != rhs.uncurryLevel
278
- || isForeign != rhs.isForeign
279
- || isDirectReference != rhs.isDirectReference
280
- || defaultArgIndex != rhs.defaultArgIndex ;
276
+ return !(*this == rhs);
281
277
}
282
278
283
279
void print (llvm::raw_ostream &os) const ;
@@ -294,16 +290,16 @@ struct SILDeclRef {
294
290
// Curry thunks are never foreign.
295
291
bool willBeForeign = isForeign && !willBeCurried;
296
292
bool willBeDirect = isDirectReference;
297
- return SILDeclRef (loc.getOpaqueValue (), kind, level,
293
+ return SILDeclRef (loc.getOpaqueValue (), kind, Expansion, level,
298
294
willBeCurried, willBeDirect, willBeForeign,
299
295
defaultArgIndex);
300
296
}
301
297
302
298
// / Returns the foreign (or native) entry point corresponding to the same
303
299
// / decl.
304
300
SILDeclRef asForeign (bool foreign = true ) const {
305
- return SILDeclRef (loc.getOpaqueValue (), kind, uncurryLevel, isCurried ,
306
- isDirectReference, foreign, defaultArgIndex);
301
+ return SILDeclRef (loc.getOpaqueValue (), kind, Expansion, uncurryLevel ,
302
+ isCurried, isDirectReference, foreign, defaultArgIndex);
307
303
}
308
304
309
305
SILDeclRef asDirectReference (bool direct = true ) const {
@@ -321,22 +317,7 @@ struct SILDeclRef {
321
317
// / True if the decl ref references a thunk from a natively Swift declaration
322
318
// / to foreign C or ObjC calling convention.
323
319
bool isNativeToForeignThunk () const ;
324
-
325
- // / Produces a SILDeclRef from an opaque value.
326
- explicit SILDeclRef (void *opaqueLoc,
327
- Kind kind,
328
- unsigned uncurryLevel,
329
- bool isCurried,
330
- bool isDirectReference,
331
- bool isForeign,
332
- unsigned defaultArgIndex)
333
- : loc(Loc::getFromOpaqueValue(opaqueLoc)),
334
- kind(kind), uncurryLevel(uncurryLevel),
335
- isCurried(isCurried),
336
- isForeign(isForeign), isDirectReference(isDirectReference),
337
- defaultArgIndex(defaultArgIndex)
338
- {}
339
-
320
+
340
321
// / Return a SILDeclRef to the declaration overridden by this one, or
341
322
// / a null SILDeclRef if there is no override.
342
323
SILDeclRef getOverridden () const {
@@ -353,7 +334,25 @@ struct SILDeclRef {
353
334
// / overrides. This may be different from "getOverridden" because some
354
335
// / declarations do not always have vtable entries.
355
336
SILDeclRef getOverriddenVTableEntry () const ;
356
-
337
+
338
+ private:
339
+ friend struct llvm ::DenseMapInfo<swift::SILDeclRef>;
340
+ // / Produces a SILDeclRef from an opaque value.
341
+ explicit SILDeclRef (void *opaqueLoc,
342
+ Kind kind,
343
+ unsigned rawExpansion,
344
+ unsigned uncurryLevel,
345
+ bool isCurried,
346
+ bool isDirectReference,
347
+ bool isForeign,
348
+ unsigned defaultArgIndex)
349
+ : loc(Loc::getFromOpaqueValue(opaqueLoc)),
350
+ kind(kind), uncurryLevel(uncurryLevel), Expansion(rawExpansion),
351
+ isCurried(isCurried),
352
+ isForeign(isForeign), isDirectReference(isDirectReference),
353
+ defaultArgIndex(defaultArgIndex)
354
+ {}
355
+
357
356
};
358
357
359
358
inline llvm::raw_ostream &operator <<(llvm::raw_ostream &OS, SILDeclRef C) {
@@ -370,16 +369,17 @@ template<> struct DenseMapInfo<swift::SILDeclRef> {
370
369
using SILDeclRef = swift::SILDeclRef;
371
370
using Kind = SILDeclRef::Kind;
372
371
using Loc = SILDeclRef::Loc;
372
+ using ResilienceExpansion = swift::ResilienceExpansion;
373
373
using PointerInfo = DenseMapInfo<void *>;
374
374
using UnsignedInfo = DenseMapInfo<unsigned >;
375
375
376
376
static SILDeclRef getEmptyKey () {
377
- return SILDeclRef (PointerInfo::getEmptyKey (), Kind::Func, 0 ,
378
- false , false , false , 0 );
377
+ return SILDeclRef (PointerInfo::getEmptyKey (), Kind::Func,
378
+ 0 , 0 , false , false , false , 0 );
379
379
}
380
380
static SILDeclRef getTombstoneKey () {
381
- return SILDeclRef (PointerInfo::getTombstoneKey (), Kind::Func, 0 ,
382
- false , false , false , 0 );
381
+ return SILDeclRef (PointerInfo::getTombstoneKey (), Kind::Func,
382
+ 0 , 0 , false , false , false , 0 );
383
383
}
384
384
static unsigned getHashValue (swift::SILDeclRef Val) {
385
385
unsigned h1 = PointerInfo::getHashValue (Val.loc .getOpaqueValue ());
0 commit comments