@@ -150,16 +150,17 @@ struct SILDeclRef {
150
150
unsigned defaultArgIndex : 10 ;
151
151
// / The derivative function identifier.
152
152
AutoDiffDerivativeFunctionIdentifier *derivativeFunctionIdentifier = nullptr ;
153
-
153
+
154
154
// / Produces a null SILDeclRef.
155
- SILDeclRef () : loc(), kind(Kind::Func), isForeign(0 ), defaultArgIndex(0 ),
156
- derivativeFunctionIdentifier (nullptr ) {}
157
-
155
+ SILDeclRef ()
156
+ : loc(), kind(Kind::Func), isForeign(0 ), defaultArgIndex(0 ),
157
+ derivativeFunctionIdentifier (nullptr ) {}
158
+
158
159
// / Produces a SILDeclRef of the given kind for the given decl.
159
- explicit SILDeclRef (ValueDecl *decl, Kind kind,
160
- bool isForeign = false ,
161
- AutoDiffDerivativeFunctionIdentifier *derivativeId = nullptr );
162
-
160
+ explicit SILDeclRef (
161
+ ValueDecl *decl, Kind kind, bool isForeign = false ,
162
+ AutoDiffDerivativeFunctionIdentifier *derivativeId = nullptr );
163
+
163
164
// / Produces a SILDeclRef for the given ValueDecl or
164
165
// / AbstractClosureExpr:
165
166
// / - If 'loc' is a func or closure, this returns a Func SILDeclRef.
@@ -283,11 +284,10 @@ struct SILDeclRef {
283
284
}
284
285
285
286
bool operator ==(SILDeclRef rhs) const {
286
- return loc.getOpaqueValue () == rhs.loc .getOpaqueValue ()
287
- && kind == rhs.kind
288
- && isForeign == rhs.isForeign
289
- && defaultArgIndex == rhs.defaultArgIndex
290
- && derivativeFunctionIdentifier == rhs.derivativeFunctionIdentifier ;
287
+ return loc.getOpaqueValue () == rhs.loc .getOpaqueValue () &&
288
+ kind == rhs.kind && isForeign == rhs.isForeign &&
289
+ defaultArgIndex == rhs.defaultArgIndex &&
290
+ derivativeFunctionIdentifier == rhs.derivativeFunctionIdentifier ;
291
291
}
292
292
bool operator !=(SILDeclRef rhs) const {
293
293
return !(*this == rhs);
@@ -301,8 +301,8 @@ struct SILDeclRef {
301
301
// / Returns the foreign (or native) entry point corresponding to the same
302
302
// / decl.
303
303
SILDeclRef asForeign (bool foreign = true ) const {
304
- return SILDeclRef (loc.getOpaqueValue (), kind,
305
- foreign, defaultArgIndex, derivativeFunctionIdentifier);
304
+ return SILDeclRef (loc.getOpaqueValue (), kind, foreign, defaultArgIndex,
305
+ derivativeFunctionIdentifier);
306
306
}
307
307
308
308
// / Returns the entry point for the corresponding autodiff derivative
@@ -400,16 +400,12 @@ struct SILDeclRef {
400
400
private:
401
401
friend struct llvm ::DenseMapInfo<swift::SILDeclRef>;
402
402
// / Produces a SILDeclRef from an opaque value.
403
- explicit SILDeclRef (void *opaqueLoc,
404
- Kind kind,
405
- bool isForeign,
403
+ explicit SILDeclRef (void *opaqueLoc, Kind kind, bool isForeign,
406
404
unsigned defaultArgIndex,
407
405
AutoDiffDerivativeFunctionIdentifier *derivativeId)
408
- : loc(Loc::getFromOpaqueValue(opaqueLoc)), kind(kind),
409
- isForeign(isForeign), defaultArgIndex(defaultArgIndex),
410
- derivativeFunctionIdentifier(derivativeId)
411
- {}
412
-
406
+ : loc(Loc::getFromOpaqueValue(opaqueLoc)), kind(kind),
407
+ isForeign(isForeign), defaultArgIndex(defaultArgIndex),
408
+ derivativeFunctionIdentifier(derivativeId) {}
413
409
};
414
410
415
411
inline llvm::raw_ostream &operator <<(llvm::raw_ostream &OS, SILDeclRef C) {
@@ -430,12 +426,12 @@ template<> struct DenseMapInfo<swift::SILDeclRef> {
430
426
using UnsignedInfo = DenseMapInfo<unsigned >;
431
427
432
428
static SILDeclRef getEmptyKey () {
433
- return SILDeclRef (PointerInfo::getEmptyKey (), Kind::Func,
434
- false , 0 , nullptr );
429
+ return SILDeclRef (PointerInfo::getEmptyKey (), Kind::Func, false , 0 ,
430
+ nullptr );
435
431
}
436
432
static SILDeclRef getTombstoneKey () {
437
- return SILDeclRef (PointerInfo::getTombstoneKey (), Kind::Func,
438
- false , 0 , nullptr );
433
+ return SILDeclRef (PointerInfo::getTombstoneKey (), Kind::Func, false , 0 ,
434
+ nullptr );
439
435
}
440
436
static unsigned getHashValue (swift::SILDeclRef Val) {
441
437
unsigned h1 = PointerInfo::getHashValue (Val.loc .getOpaqueValue ());
@@ -444,8 +440,7 @@ template<> struct DenseMapInfo<swift::SILDeclRef> {
444
440
? UnsignedInfo::getHashValue (Val.defaultArgIndex )
445
441
: 0 ;
446
442
unsigned h4 = UnsignedInfo::getHashValue (Val.isForeign );
447
- unsigned h5 =
448
- PointerInfo::getHashValue (Val.derivativeFunctionIdentifier );
443
+ unsigned h5 = PointerInfo::getHashValue (Val.derivativeFunctionIdentifier );
449
444
return h1 ^ (h2 << 4 ) ^ (h3 << 9 ) ^ (h4 << 7 ) ^ (h5 << 11 );
450
445
}
451
446
static bool isEqual (swift::SILDeclRef const &LHS,
0 commit comments