[CSStep] Conjunction: Give each conjunction step a fresh timer

Original timer cannot be used each expression in the multi-statement
closure is type-checked independently.
This commit is contained in:
Pavel Yaskevich
2022-02-08 15:23:17 -08:00
parent d0031403cc
commit 1636ee83c3
3 changed files with 30 additions and 0 deletions

View File

@@ -167,8 +167,10 @@ public:
class ExpressionTimer {
public:
using AnchorType = llvm::PointerUnion<Expr *, ConstraintLocator *>;
private:
AnchorType Anchor;
ASTContext &Context;
llvm::TimeRecord StartTime;
@@ -188,6 +190,8 @@ public:
~ExpressionTimer();
AnchorType getAnchor() const { return Anchor; }
unsigned getWarnLimit() const {
return Context.TypeCheckerOpts.WarnLongExpressionTypeChecking;
}
@@ -5681,6 +5685,8 @@ public:
bool attempt(ConstraintSystem &cs) const;
ConstraintLocator *getLocator() const { return Element->getLocator(); }
void print(llvm::raw_ostream &Out, SourceManager *SM) const {
Out << "conjunction element ";
Element->print(Out, SM);