@@ -412,46 +412,46 @@ class ASTExtInfoBuilder {
412
412
413
413
// Note that we don't have setters. That is by design, use
414
414
// the following with methods instead of mutating these objects.
415
- LLVM_NODISCARD
415
+ [[nodiscard]]
416
416
ASTExtInfoBuilder withRepresentation (Representation rep) const {
417
417
return ASTExtInfoBuilder ((bits & ~RepresentationMask) | (unsigned )rep,
418
418
shouldStoreClangType (rep) ? clangTypeInfo
419
419
: ClangTypeInfo (),
420
420
globalActor);
421
421
}
422
- LLVM_NODISCARD
422
+ [[nodiscard]]
423
423
ASTExtInfoBuilder withNoEscape (bool noEscape = true ) const {
424
424
return ASTExtInfoBuilder (noEscape ? (bits | NoEscapeMask)
425
425
: (bits & ~NoEscapeMask),
426
426
clangTypeInfo, globalActor);
427
427
}
428
- LLVM_NODISCARD
428
+ [[nodiscard]]
429
429
ASTExtInfoBuilder withConcurrent (bool concurrent = true ) const {
430
430
return ASTExtInfoBuilder (concurrent ? (bits | SendableMask)
431
431
: (bits & ~SendableMask),
432
432
clangTypeInfo, globalActor);
433
433
}
434
- LLVM_NODISCARD
434
+ [[nodiscard]]
435
435
ASTExtInfoBuilder withAsync (bool async = true ) const {
436
436
return ASTExtInfoBuilder (async ? (bits | AsyncMask)
437
437
: (bits & ~AsyncMask),
438
438
clangTypeInfo, globalActor);
439
439
}
440
- LLVM_NODISCARD
440
+ [[nodiscard]]
441
441
ASTExtInfoBuilder withThrows (bool throws = true ) const {
442
442
return ASTExtInfoBuilder (
443
443
throws ? (bits | ThrowsMask) : (bits & ~ThrowsMask), clangTypeInfo,
444
444
globalActor);
445
445
}
446
- LLVM_NODISCARD
446
+ [[nodiscard]]
447
447
ASTExtInfoBuilder
448
448
withDifferentiabilityKind (DifferentiabilityKind differentiability) const {
449
449
return ASTExtInfoBuilder (
450
450
(bits & ~DifferentiabilityMask) |
451
451
((unsigned )differentiability << DifferentiabilityMaskOffset),
452
452
clangTypeInfo, globalActor);
453
453
}
454
- LLVM_NODISCARD
454
+ [[nodiscard]]
455
455
ASTExtInfoBuilder withClangFunctionType (const clang::Type *type) const {
456
456
return ASTExtInfoBuilder (bits, ClangTypeInfo (type), globalActor);
457
457
}
@@ -461,7 +461,7 @@ class ASTExtInfoBuilder {
461
461
// / SIL type lowering transiently generates AST function types with SIL
462
462
// / representations. However, they shouldn't persist in the AST, and
463
463
// / don't need to be parsed, printed, or serialized.
464
- LLVM_NODISCARD
464
+ [[nodiscard]]
465
465
ASTExtInfoBuilder
466
466
withSILRepresentation (SILFunctionTypeRepresentation rep) const {
467
467
return ASTExtInfoBuilder ((bits & ~RepresentationMask) | (unsigned )rep,
@@ -470,7 +470,7 @@ class ASTExtInfoBuilder {
470
470
globalActor);
471
471
}
472
472
473
- LLVM_NODISCARD
473
+ [[nodiscard]]
474
474
ASTExtInfoBuilder withGlobalActor (Type globalActor) const {
475
475
return ASTExtInfoBuilder (bits, clangTypeInfo, globalActor);
476
476
}
@@ -555,44 +555,44 @@ class ASTExtInfo {
555
555
// / Helper method for changing the representation.
556
556
// /
557
557
// / Prefer using \c ASTExtInfoBuilder::withRepresentation for chaining.
558
- LLVM_NODISCARD
558
+ [[nodiscard]]
559
559
ASTExtInfo withRepresentation (ASTExtInfoBuilder::Representation rep) const {
560
560
return builder.withRepresentation (rep).build ();
561
561
}
562
562
563
563
// / Helper method for changing only the noEscape field.
564
564
// /
565
565
// / Prefer using \c ASTExtInfoBuilder::withNoEscape for chaining.
566
- LLVM_NODISCARD
566
+ [[nodiscard]]
567
567
ASTExtInfo withNoEscape (bool noEscape = true ) const {
568
568
return builder.withNoEscape (noEscape).build ();
569
569
}
570
570
571
571
// / Helper method for changing only the concurrent field.
572
572
// /
573
573
// / Prefer using \c ASTExtInfoBuilder::withConcurrent for chaining.
574
- LLVM_NODISCARD
574
+ [[nodiscard]]
575
575
ASTExtInfo withConcurrent (bool concurrent = true ) const {
576
576
return builder.withConcurrent (concurrent).build ();
577
577
}
578
578
579
579
// / Helper method for changing only the throws field.
580
580
// /
581
581
// / Prefer using \c ASTExtInfoBuilder::withThrows for chaining.
582
- LLVM_NODISCARD
582
+ [[nodiscard]]
583
583
ASTExtInfo withThrows (bool throws = true ) const {
584
584
return builder.withThrows (throws).build ();
585
585
}
586
586
587
587
// / Helper method for changing only the async field.
588
588
// /
589
589
// / Prefer using \c ASTExtInfoBuilder::withAsync for chaining.
590
- LLVM_NODISCARD
590
+ [[nodiscard]]
591
591
ASTExtInfo withAsync (bool async = true ) const {
592
592
return builder.withAsync (async).build ();
593
593
}
594
594
595
- LLVM_NODISCARD
595
+ [[nodiscard]]
596
596
ASTExtInfo withGlobalActor (Type globalActor) const {
597
597
return builder.withGlobalActor (globalActor).build ();
598
598
}
@@ -785,44 +785,44 @@ class SILExtInfoBuilder {
785
785
786
786
// Note that we don't have setters. That is by design, use
787
787
// the following with methods instead of mutating these objects.
788
- LLVM_NODISCARD
788
+ [[nodiscard]]
789
789
SILExtInfoBuilder withRepresentation (Representation rep) const {
790
790
return SILExtInfoBuilder ((bits & ~RepresentationMask) | (unsigned )rep,
791
791
shouldStoreClangType (rep) ? clangTypeInfo
792
792
: ClangTypeInfo ());
793
793
}
794
- LLVM_NODISCARD
794
+ [[nodiscard]]
795
795
SILExtInfoBuilder withIsPseudogeneric (bool isPseudogeneric = true ) const {
796
796
return SILExtInfoBuilder (isPseudogeneric ? (bits | PseudogenericMask)
797
797
: (bits & ~PseudogenericMask),
798
798
clangTypeInfo);
799
799
}
800
- LLVM_NODISCARD
800
+ [[nodiscard]]
801
801
SILExtInfoBuilder withNoEscape (bool noEscape = true ) const {
802
802
return SILExtInfoBuilder (noEscape ? (bits | NoEscapeMask)
803
803
: (bits & ~NoEscapeMask),
804
804
clangTypeInfo);
805
805
}
806
- LLVM_NODISCARD
806
+ [[nodiscard]]
807
807
SILExtInfoBuilder withConcurrent (bool isSendable = true ) const {
808
808
return SILExtInfoBuilder (isSendable ? (bits | SendableMask)
809
809
: (bits & ~SendableMask),
810
810
clangTypeInfo);
811
811
}
812
- LLVM_NODISCARD
812
+ [[nodiscard]]
813
813
SILExtInfoBuilder withAsync (bool isAsync = true ) const {
814
814
return SILExtInfoBuilder (isAsync ? (bits | AsyncMask) : (bits & ~AsyncMask),
815
815
clangTypeInfo);
816
816
}
817
- LLVM_NODISCARD
817
+ [[nodiscard]]
818
818
SILExtInfoBuilder
819
819
withDifferentiabilityKind (DifferentiabilityKind differentiability) const {
820
820
return SILExtInfoBuilder (
821
821
(bits & ~DifferentiabilityMask) |
822
822
((unsigned )differentiability << DifferentiabilityMaskOffset),
823
823
clangTypeInfo);
824
824
}
825
- LLVM_NODISCARD
825
+ [[nodiscard]]
826
826
SILExtInfoBuilder withClangFunctionType (const clang::Type *type) const {
827
827
return SILExtInfoBuilder (bits, ClangTypeInfo (type).getCanonical ());
828
828
}
0 commit comments