Skip to content

Commit 827027b

Browse files
authored
[clang] Move Diags.isIgnored() check below faster checks (llvm#141084)
Because this check is relatively slow and the others aren't as much. http://llvm-compile-time-tracker.com/compare.php?from=4a158f675be7fd1b3763bf39980d801db89744f8&to=886a8fab041ff7574d54cccddbc1a9b968c1bb58&stat=instructions:u
1 parent a40762c commit 827027b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/Sema/SemaChecking.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11745,10 +11745,6 @@ static void CheckImplicitArgumentConversions(Sema &S, CallExpr *TheCall,
1174511745

1174611746
static void DiagnoseNullConversion(Sema &S, Expr *E, QualType T,
1174711747
SourceLocation CC) {
11748-
if (S.Diags.isIgnored(diag::warn_impcast_null_pointer_to_integer,
11749-
E->getExprLoc()))
11750-
return;
11751-
1175211748
// Don't warn on functions which have return type nullptr_t.
1175311749
if (isa<CallExpr>(E))
1175411750
return;
@@ -11765,6 +11761,10 @@ static void DiagnoseNullConversion(Sema &S, Expr *E, QualType T,
1176511761
T->isMemberPointerType() || !T->isScalarType() || T->isNullPtrType())
1176611762
return;
1176711763

11764+
if (S.Diags.isIgnored(diag::warn_impcast_null_pointer_to_integer,
11765+
E->getExprLoc()))
11766+
return;
11767+
1176811768
SourceLocation Loc = E->getSourceRange().getBegin();
1176911769

1177011770
// Venture through the macro stacks to get to the source of macro arguments.

0 commit comments

Comments
 (0)