Skip to content

Commit 1b75dbd

Browse files
committed
Remove TypeChecker::Diags
1 parent 1000c9d commit 1b75dbd

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ bool MissingExplicitConversionFailure::diagnoseAsError() {
10421042
return false;
10431043

10441044
bool useAs = TypeChecker::isExplicitlyConvertibleTo(fromType, toType, DC);
1045-
if (!useAs && TypeChecker::checkedCastMaySucceed(fromType, toType, DC))
1045+
if (!useAs && !TypeChecker::checkedCastMaySucceed(fromType, toType, DC))
10461046
return false;
10471047

10481048
auto *expr = findParentExpr(getAnchor());

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ Type TypeChecker::typeCheckExpressionImpl(Expr *&expr, DeclContext *dc,
21852185
// Construct a constraint system from this expression.
21862186
ConstraintSystemOptions csOptions = ConstraintSystemFlags::AllowFixes;
21872187

2188-
if (DiagnosticSuppression::isEnabled(Diags))
2188+
if (DiagnosticSuppression::isEnabled(Context.Diags))
21892189
csOptions |= ConstraintSystemFlags::SuppressDiagnostics;
21902190

21912191
if (options.contains(TypeCheckExprFlags::AllowUnresolvedTypeVariables))

lib/Sema/TypeChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ TypeChecker &TypeChecker::createForContext(ASTContext &ctx) {
6262
}
6363

6464
TypeChecker::TypeChecker(ASTContext &Ctx)
65-
: Context(Ctx), Diags(Ctx.Diags) {}
65+
: Context(Ctx) {}
6666

6767
TypeChecker::~TypeChecker() {}
6868

lib/Sema/TypeChecker.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,6 @@ class TypeChecker final {
543543

544544
private:
545545
ASTContext &Context;
546-
DiagnosticEngine &Diags;
547546

548547
/// The set of expressions currently being analyzed for failures.
549548
llvm::DenseMap<Expr*, Expr*> DiagnosedExprs;

0 commit comments

Comments
 (0)