@@ -412,46 +412,46 @@ class ASTExtInfoBuilder {
412412
413413 // Note that we don't have setters. That is by design, use
414414 // the following with methods instead of mutating these objects.
415- LLVM_NODISCARD
415+ [[nodiscard]]
416416 ASTExtInfoBuilder withRepresentation (Representation rep) const {
417417 return ASTExtInfoBuilder ((bits & ~RepresentationMask) | (unsigned )rep,
418418 shouldStoreClangType (rep) ? clangTypeInfo
419419 : ClangTypeInfo (),
420420 globalActor);
421421 }
422- LLVM_NODISCARD
422+ [[nodiscard]]
423423 ASTExtInfoBuilder withNoEscape (bool noEscape = true ) const {
424424 return ASTExtInfoBuilder (noEscape ? (bits | NoEscapeMask)
425425 : (bits & ~NoEscapeMask),
426426 clangTypeInfo, globalActor);
427427 }
428- LLVM_NODISCARD
428+ [[nodiscard]]
429429 ASTExtInfoBuilder withConcurrent (bool concurrent = true ) const {
430430 return ASTExtInfoBuilder (concurrent ? (bits | SendableMask)
431431 : (bits & ~SendableMask),
432432 clangTypeInfo, globalActor);
433433 }
434- LLVM_NODISCARD
434+ [[nodiscard]]
435435 ASTExtInfoBuilder withAsync (bool async = true ) const {
436436 return ASTExtInfoBuilder (async ? (bits | AsyncMask)
437437 : (bits & ~AsyncMask),
438438 clangTypeInfo, globalActor);
439439 }
440- LLVM_NODISCARD
440+ [[nodiscard]]
441441 ASTExtInfoBuilder withThrows (bool throws = true ) const {
442442 return ASTExtInfoBuilder (
443443 throws ? (bits | ThrowsMask) : (bits & ~ThrowsMask), clangTypeInfo,
444444 globalActor);
445445 }
446- LLVM_NODISCARD
446+ [[nodiscard]]
447447 ASTExtInfoBuilder
448448 withDifferentiabilityKind (DifferentiabilityKind differentiability) const {
449449 return ASTExtInfoBuilder (
450450 (bits & ~DifferentiabilityMask) |
451451 ((unsigned )differentiability << DifferentiabilityMaskOffset),
452452 clangTypeInfo, globalActor);
453453 }
454- LLVM_NODISCARD
454+ [[nodiscard]]
455455 ASTExtInfoBuilder withClangFunctionType (const clang::Type *type) const {
456456 return ASTExtInfoBuilder (bits, ClangTypeInfo (type), globalActor);
457457 }
@@ -461,7 +461,7 @@ class ASTExtInfoBuilder {
461461 // / SIL type lowering transiently generates AST function types with SIL
462462 // / representations. However, they shouldn't persist in the AST, and
463463 // / don't need to be parsed, printed, or serialized.
464- LLVM_NODISCARD
464+ [[nodiscard]]
465465 ASTExtInfoBuilder
466466 withSILRepresentation (SILFunctionTypeRepresentation rep) const {
467467 return ASTExtInfoBuilder ((bits & ~RepresentationMask) | (unsigned )rep,
@@ -470,7 +470,7 @@ class ASTExtInfoBuilder {
470470 globalActor);
471471 }
472472
473- LLVM_NODISCARD
473+ [[nodiscard]]
474474 ASTExtInfoBuilder withGlobalActor (Type globalActor) const {
475475 return ASTExtInfoBuilder (bits, clangTypeInfo, globalActor);
476476 }
@@ -555,44 +555,44 @@ class ASTExtInfo {
555555 // / Helper method for changing the representation.
556556 // /
557557 // / Prefer using \c ASTExtInfoBuilder::withRepresentation for chaining.
558- LLVM_NODISCARD
558+ [[nodiscard]]
559559 ASTExtInfo withRepresentation (ASTExtInfoBuilder::Representation rep) const {
560560 return builder.withRepresentation (rep).build ();
561561 }
562562
563563 // / Helper method for changing only the noEscape field.
564564 // /
565565 // / Prefer using \c ASTExtInfoBuilder::withNoEscape for chaining.
566- LLVM_NODISCARD
566+ [[nodiscard]]
567567 ASTExtInfo withNoEscape (bool noEscape = true ) const {
568568 return builder.withNoEscape (noEscape).build ();
569569 }
570570
571571 // / Helper method for changing only the concurrent field.
572572 // /
573573 // / Prefer using \c ASTExtInfoBuilder::withConcurrent for chaining.
574- LLVM_NODISCARD
574+ [[nodiscard]]
575575 ASTExtInfo withConcurrent (bool concurrent = true ) const {
576576 return builder.withConcurrent (concurrent).build ();
577577 }
578578
579579 // / Helper method for changing only the throws field.
580580 // /
581581 // / Prefer using \c ASTExtInfoBuilder::withThrows for chaining.
582- LLVM_NODISCARD
582+ [[nodiscard]]
583583 ASTExtInfo withThrows (bool throws = true ) const {
584584 return builder.withThrows (throws).build ();
585585 }
586586
587587 // / Helper method for changing only the async field.
588588 // /
589589 // / Prefer using \c ASTExtInfoBuilder::withAsync for chaining.
590- LLVM_NODISCARD
590+ [[nodiscard]]
591591 ASTExtInfo withAsync (bool async = true ) const {
592592 return builder.withAsync (async).build ();
593593 }
594594
595- LLVM_NODISCARD
595+ [[nodiscard]]
596596 ASTExtInfo withGlobalActor (Type globalActor) const {
597597 return builder.withGlobalActor (globalActor).build ();
598598 }
@@ -785,44 +785,44 @@ class SILExtInfoBuilder {
785785
786786 // Note that we don't have setters. That is by design, use
787787 // the following with methods instead of mutating these objects.
788- LLVM_NODISCARD
788+ [[nodiscard]]
789789 SILExtInfoBuilder withRepresentation (Representation rep) const {
790790 return SILExtInfoBuilder ((bits & ~RepresentationMask) | (unsigned )rep,
791791 shouldStoreClangType (rep) ? clangTypeInfo
792792 : ClangTypeInfo ());
793793 }
794- LLVM_NODISCARD
794+ [[nodiscard]]
795795 SILExtInfoBuilder withIsPseudogeneric (bool isPseudogeneric = true ) const {
796796 return SILExtInfoBuilder (isPseudogeneric ? (bits | PseudogenericMask)
797797 : (bits & ~PseudogenericMask),
798798 clangTypeInfo);
799799 }
800- LLVM_NODISCARD
800+ [[nodiscard]]
801801 SILExtInfoBuilder withNoEscape (bool noEscape = true ) const {
802802 return SILExtInfoBuilder (noEscape ? (bits | NoEscapeMask)
803803 : (bits & ~NoEscapeMask),
804804 clangTypeInfo);
805805 }
806- LLVM_NODISCARD
806+ [[nodiscard]]
807807 SILExtInfoBuilder withConcurrent (bool isSendable = true ) const {
808808 return SILExtInfoBuilder (isSendable ? (bits | SendableMask)
809809 : (bits & ~SendableMask),
810810 clangTypeInfo);
811811 }
812- LLVM_NODISCARD
812+ [[nodiscard]]
813813 SILExtInfoBuilder withAsync (bool isAsync = true ) const {
814814 return SILExtInfoBuilder (isAsync ? (bits | AsyncMask) : (bits & ~AsyncMask),
815815 clangTypeInfo);
816816 }
817- LLVM_NODISCARD
817+ [[nodiscard]]
818818 SILExtInfoBuilder
819819 withDifferentiabilityKind (DifferentiabilityKind differentiability) const {
820820 return SILExtInfoBuilder (
821821 (bits & ~DifferentiabilityMask) |
822822 ((unsigned )differentiability << DifferentiabilityMaskOffset),
823823 clangTypeInfo);
824824 }
825- LLVM_NODISCARD
825+ [[nodiscard]]
826826 SILExtInfoBuilder withClangFunctionType (const clang::Type *type) const {
827827 return SILExtInfoBuilder (bits, ClangTypeInfo (type).getCanonical ());
828828 }
0 commit comments