Bug 1443438 - Modify matcher isInSystemHeader to be polymorphic. r?mystor draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Tue, 06 Mar 2018 11:59:05 +0200
changeset 763621 22dcd060121360026d9a6e6b54bf5802fb671463
parent 763109 51200c0fdaddb2749549a82596da5323a4cbd499
push id101494
push userbmo:bpostelnicu@mozilla.com
push dateTue, 06 Mar 2018 10:04:52 +0000
reviewersmystor
bugs1443438
milestone60.0a1
Bug 1443438 - Modify matcher isInSystemHeader to be polymorphic. r?mystor MozReview-Commit-ID: sA4XmHMkaR
build/clang-plugin/CustomMatchers.h
--- 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"};