File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -2690,12 +2690,20 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
2690
2690
llvm::errs () << " \n " ;
2691
2691
}
2692
2692
2693
-
2694
- #ifndef NDEBUG
2695
- // In asserts builds, also verify some invariants of the requirement
2696
- // signature.
2697
- PD->getGenericSignature ().verify (reqSig);
2698
- #endif
2693
+ if (getASTContext ().LangOpts .RequirementMachineProtocolSignatures ==
2694
+ RequirementMachineMode::Disabled) {
2695
+ #ifndef NDEBUG
2696
+ // The GenericSignatureBuilder outputs incorrectly-minimized signatures
2697
+ // sometimes, so only check invariants in asserts builds.
2698
+ PD->getGenericSignature ().verify (reqSig);
2699
+ #endif
2700
+ } else {
2701
+ // When using the Requirement Machine, always verify signatures.
2702
+ // An incorrect signature indicates a serious problem which can cause
2703
+ // miscompiles or inadvertent ABI dependencies on compiler bugs, so
2704
+ // we really want to avoid letting one slip by.
2705
+ PD->getGenericSignature ().verify (reqSig);
2706
+ }
2699
2707
2700
2708
(void ) reqSig;
2701
2709
You can’t perform that action at this time.
0 commit comments