@@ -700,76 +700,20 @@ ExprResult CalculateConstraintSatisfaction::Calculate(
700
700
HashParameterMapping (S, MLTAL, ID, OuterPackSubstIndex)
701
701
.VisitConstraint (Constraint);
702
702
703
- unsigned CacheKeyHash = ID.computeStableHash ();
704
-
705
- #define UseCache 1
706
703
if (auto Iter = S.ConceptIdSatisfactionCache .find (ID);
707
704
Iter != S.ConceptIdSatisfactionCache .end ()) {
708
- # if UseCache
705
+
709
706
auto &Cached = Iter->second .Satisfaction ;
710
707
Satisfaction.ContainsErrors = Cached.ContainsErrors ;
711
708
Satisfaction.IsSatisfied = Cached.IsSatisfied ;
712
709
Satisfaction.Details .insert (Satisfaction.Details .begin () + Size,
713
710
Cached.Details .begin (), Cached.Details .end ());
714
- #ifndef NDEBUG
715
- if (Iter->second .E != Constraint.getConstraintExpr ()) {
716
- llvm::errs () << " CacheKey: " << CacheKeyHash << " "
717
- << S.ConceptIdSatisfactionCache .size () << " \n " ;
718
- if (Constraint.hasParameterMapping ()) {
719
- llvm::errs () << " Mapping: " ;
720
- for (auto Arg : Constraint.getParameterMapping ()) {
721
- Arg.getArgument ().print (S.getPrintingPolicy (), llvm::errs (),
722
- /* IncludeType=*/ false );
723
- llvm::errs () << " " ;
724
- }
725
- llvm::errs () << " \n " ;
726
- }
727
- llvm::errs () << " Previous 1: " << Iter->second .E << " " ;
728
- Iter->second .E ->printPretty (llvm::errs (), /* Helper=*/ nullptr ,
729
- S.getPrintingPolicy ());
730
- llvm::errs () << " \n " ;
731
- llvm::errs () << " Current 1: " << Constraint.getConstraintExpr () << " " ;
732
- Constraint.getConstraintExpr ()->printPretty (
733
- llvm::errs (), /* Helper=*/ nullptr , S.getPrintingPolicy ());
734
- llvm::errs () << " \n " ;
735
- }
736
- assert (Iter->second .E == Constraint.getConstraintExpr ());
737
- #ifndef NDEBUG
738
- return Iter->second .SubstExpr ;
739
- #else
740
- #endif
741
711
}
742
712
743
713
ExprResult E = CalculateSlow (Constraint, MLTAL);
744
714
745
715
assert (Constraint.getConstraintExpr () == Previous);
746
716
747
- if (auto Iter = S.ConceptIdSatisfactionCache .find (ID);
748
- Iter != S.ConceptIdSatisfactionCache .end ()) {
749
- #if UseCache
750
- auto &Cached = Iter->second .Satisfaction ;
751
- Satisfaction.ContainsErrors = Cached.ContainsErrors ;
752
- Satisfaction.IsSatisfied = Cached.IsSatisfied ;
753
- Satisfaction.Details .insert (Satisfaction.Details .begin () + Size,
754
- Cached.Details .begin (), Cached.Details .end ());
755
- #ifndef NDEBUG
756
- if (Iter->second .E != Constraint.getConstraintExpr ()) {
757
- llvm::errs () << " CacheKey: " << CacheKeyHash << " " ;
758
- llvm::errs () << " Previous: " ;
759
- Iter->second .E ->printPretty (llvm::errs (), /* Helper=*/ nullptr ,
760
- S.getPrintingPolicy ());
761
- llvm::errs () << " \n " ;
762
- llvm::errs () << " Current: " ;
763
- Constraint.getConstraintExpr ()->printPretty (
764
- llvm::errs (), /* Helper=*/ nullptr , S.getPrintingPolicy ());
765
- llvm::errs () << " \n " ;
766
- }
767
- assert (Iter->second .E == Constraint.getConstraintExpr ());
768
- #ifndef NDEBUG
769
- return Iter->second .SubstExpr ;
770
- #endif
771
- }
772
-
773
717
CachedConceptIdConstraint Cache;
774
718
Cache.Satisfaction .ContainsErrors = Satisfaction.ContainsErrors ;
775
719
Cache.Satisfaction .IsSatisfied = Satisfaction.IsSatisfied ;
@@ -778,7 +722,6 @@ ExprResult CalculateConstraintSatisfaction::Calculate(
778
722
Cache.SubstExpr = E;
779
723
Cache.E = Constraint.getConstraintExpr ();
780
724
S.ConceptIdSatisfactionCache .insert ({ID, std::move (Cache)});
781
- #undef UseCache
782
725
783
726
return E;
784
727
}
0 commit comments