Bug 1443438 - Modify matcher isInSystemHeader to be polymorphic. r?mystor
MozReview-Commit-ID: sA4XmHMkaR
--- a/build/clang-plugin/CustomMatchers.h
+++ b/build/clang-plugin/CustomMatchers.h
@@ -105,17 +105,18 @@ AST_MATCHER(BinaryOperator, binaryCommaO
}
/// This matcher will match floating point types.
AST_MATCHER(QualType, isFloat) { return Node->isRealFloatingType(); }
/// This matcher will match locations in system headers. This is adopted from
/// isExpansionInSystemHeader in newer clangs, but modified in order to work
/// with old clangs that we use on infra.
-AST_MATCHER(BinaryOperator, isInSystemHeader) {
+AST_POLYMORPHIC_MATCHER(isInSystemHeader, \
+ AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt)) {
return ASTIsInSystemHeader(Finder->getASTContext(), Node);
}
/// This matcher will match a list of files. These files contain
/// known NaN-testing expressions which we would like to whitelist.
AST_MATCHER(BinaryOperator, isInWhitelistForNaNExpr) {
const char *whitelist[] = {"SkScalar.h", "json_writer.cpp", "State.cpp"};