@@ -505,6 +505,15 @@ class SILExtInfoBuilder {
505
505
SILExtInfoBuilder (unsigned bits, ClangTypeInfo clangTypeInfo)
506
506
: bits(bits), clangTypeInfo(clangTypeInfo) {}
507
507
508
+ static constexpr unsigned makeBits (Representation rep, bool isPseudogeneric,
509
+ bool isNoEscape, bool isAsync,
510
+ DifferentiabilityKind diffKind) {
511
+ return ((unsigned )rep) | (isPseudogeneric ? PseudogenericMask : 0 ) |
512
+ (isNoEscape ? NoEscapeMask : 0 ) | (isAsync ? AsyncMask : 0 ) |
513
+ (((unsigned )diffKind << DifferentiabilityMaskOffset) &
514
+ DifferentiabilityMask);
515
+ }
516
+
508
517
public:
509
518
// Constructor with all defaults.
510
519
SILExtInfoBuilder () : bits(0 ), clangTypeInfo(ClangTypeInfo(nullptr )) {}
@@ -513,12 +522,9 @@ class SILExtInfoBuilder {
513
522
SILExtInfoBuilder (Representation rep, bool isPseudogeneric, bool isNoEscape,
514
523
bool isAsync, DifferentiabilityKind diffKind,
515
524
const clang::Type *type)
516
- : SILExtInfoBuilder(
517
- ((unsigned )rep) | (isPseudogeneric ? PseudogenericMask : 0 ) |
518
- (isNoEscape ? NoEscapeMask : 0 ) | (isAsync ? AsyncMask : 0 ) |
519
- (((unsigned )diffKind << DifferentiabilityMaskOffset) &
520
- DifferentiabilityMask),
521
- ClangTypeInfo (type)) {}
525
+ : SILExtInfoBuilder(makeBits(rep, isPseudogeneric, isNoEscape, isAsync,
526
+ diffKind),
527
+ ClangTypeInfo (type)) {}
522
528
523
529
void checkInvariants () const ;
524
530
0 commit comments