r318304 - ASTMatchers.h: Fix ODR violations by avoiding internal linkage variables in headers

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 08:52:12 PST 2017


Author: dblaikie
Date: Wed Nov 15 08:52:12 2017
New Revision: 318304

URL: http://llvm.org/viewvc/llvm-project?rev=318304&view=rev
Log:
ASTMatchers.h: Fix ODR violations by avoiding internal linkage variables in headers

Internal linkage variables ODR referenced from inline functions create
ODR violations (the same inline function ends up having different
definitions in each TU, since it references different variables - rather
than one definition).

This also happens to break modular code generation - so this is the last
fix to allow clang to compile with modular code generation.

Modified:
    cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
    cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp

Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h?rev=318304&r1=318303&r2=318304&view=diff
==============================================================================
--- cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h (original)
+++ cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h Wed Nov 15 08:52:12 2017
@@ -178,7 +178,7 @@ inline internal::TrueMatcher anything()
 /// \endcode
 /// decl(hasDeclContext(translationUnitDecl()))
 ///   matches "int X", but not "int Y".
-const internal::VariadicDynCastAllOfMatcher<Decl, TranslationUnitDecl>
+extern const internal::VariadicDynCastAllOfMatcher<Decl, TranslationUnitDecl>
     translationUnitDecl;
 
 /// \brief Matches typedef declarations.
@@ -190,7 +190,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// typedefDecl()
 ///   matches "typedef int X", but not "using Y = int"
-const internal::VariadicDynCastAllOfMatcher<Decl, TypedefDecl> typedefDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, TypedefDecl>
+    typedefDecl;
 
 /// \brief Matches typedef name declarations.
 ///
@@ -201,7 +202,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// typedefNameDecl()
 ///   matches "typedef int X" and "using Y = int"
-const internal::VariadicDynCastAllOfMatcher<Decl, TypedefNameDecl>
+extern const internal::VariadicDynCastAllOfMatcher<Decl, TypedefNameDecl>
     typedefNameDecl;
 
 /// \brief Matches type alias declarations.
@@ -213,7 +214,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// typeAliasDecl()
 ///   matches "using Y = int", but not "typedef int X"
-const internal::VariadicDynCastAllOfMatcher<Decl, TypeAliasDecl> typeAliasDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, TypeAliasDecl>
+    typeAliasDecl;
 
 /// \brief Matches type alias template declarations.
 ///
@@ -222,7 +224,7 @@ const internal::VariadicDynCastAllOfMatc
 ///   template <typename T>
 ///   using Y = X<T>;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Decl, TypeAliasTemplateDecl>
+extern const internal::VariadicDynCastAllOfMatcher<Decl, TypeAliasTemplateDecl>
     typeAliasTemplateDecl;
 
 /// \brief Matches AST nodes that were expanded within the main-file.
@@ -313,7 +315,7 @@ AST_POLYMORPHIC_MATCHER_P(isExpansionInF
 ///     friend X;
 ///   };
 /// \endcode
-const internal::VariadicAllOfMatcher<Decl> decl;
+extern const internal::VariadicAllOfMatcher<Decl> decl;
 
 /// \brief Matches a declaration of a linkage specification.
 ///
@@ -323,7 +325,7 @@ const internal::VariadicAllOfMatcher<Dec
 /// \endcode
 /// linkageSpecDecl()
 ///   matches "extern "C" {}"
-const internal::VariadicDynCastAllOfMatcher<Decl, LinkageSpecDecl>
+extern const internal::VariadicDynCastAllOfMatcher<Decl, LinkageSpecDecl>
     linkageSpecDecl;
 
 /// \brief Matches a declaration of anything that could have a name.
@@ -337,7 +339,7 @@ const internal::VariadicDynCastAllOfMatc
 ///     } U;
 ///   };
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Decl, NamedDecl> namedDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, NamedDecl> namedDecl;
 
 /// \brief Matches a declaration of label.
 ///
@@ -348,7 +350,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// labelDecl()
 ///   matches 'FOO:'
-const internal::VariadicDynCastAllOfMatcher<Decl, LabelDecl> labelDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, LabelDecl> labelDecl;
 
 /// \brief Matches a declaration of a namespace.
 ///
@@ -359,7 +361,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// namespaceDecl()
 ///   matches "namespace {}" and "namespace test {}"
-const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceDecl> namespaceDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceDecl>
+    namespaceDecl;
 
 /// \brief Matches a declaration of a namespace alias.
 ///
@@ -370,7 +373,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// namespaceAliasDecl()
 ///   matches "namespace alias" but not "namespace test"
-const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceAliasDecl>
+extern const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceAliasDecl>
     namespaceAliasDecl;
 
 /// \brief Matches class, struct, and union declarations.
@@ -382,9 +385,7 @@ const internal::VariadicDynCastAllOfMatc
 ///   struct S {};
 ///   union U {};
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  RecordDecl> recordDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, RecordDecl> recordDecl;
 
 /// \brief Matches C++ class declarations.
 ///
@@ -393,9 +394,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   class X;
 ///   template<class T> class Z {};
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  CXXRecordDecl> cxxRecordDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXRecordDecl>
+    cxxRecordDecl;
 
 /// \brief Matches C++ class template declarations.
 ///
@@ -403,9 +403,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   template<class T> class Z {};
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ClassTemplateDecl> classTemplateDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ClassTemplateDecl>
+    classTemplateDecl;
 
 /// \brief Matches C++ class template specializations.
 ///
@@ -417,9 +416,9 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// classTemplateSpecializationDecl()
 ///   matches the specializations \c A<int> and \c A<double>
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ClassTemplateSpecializationDecl> classTemplateSpecializationDecl;
+extern const internal::VariadicDynCastAllOfMatcher<
+    Decl, ClassTemplateSpecializationDecl>
+    classTemplateSpecializationDecl;
 
 /// \brief Matches declarator declarations (field, variable, function
 /// and non-type template parameter declarations).
@@ -430,7 +429,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// declaratorDecl()
 ///   matches \c int y.
-const internal::VariadicDynCastAllOfMatcher<Decl, DeclaratorDecl>
+extern const internal::VariadicDynCastAllOfMatcher<Decl, DeclaratorDecl>
     declaratorDecl;
 
 /// \brief Matches parameter variable declarations.
@@ -441,7 +440,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// parmVarDecl()
 ///   matches \c int x.
-const internal::VariadicDynCastAllOfMatcher<Decl, ParmVarDecl> parmVarDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ParmVarDecl>
+    parmVarDecl;
 
 /// \brief Matches C++ access specifier declarations.
 ///
@@ -454,9 +454,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// accessSpecDecl()
 ///   matches 'public:'
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  AccessSpecDecl> accessSpecDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, AccessSpecDecl>
+    accessSpecDecl;
 
 /// \brief Matches constructor initializers.
 ///
@@ -467,7 +466,8 @@ const internal::VariadicDynCastAllOfMatc
 ///     int i;
 ///   };
 /// \endcode
-const internal::VariadicAllOfMatcher<CXXCtorInitializer> cxxCtorInitializer;
+extern const internal::VariadicAllOfMatcher<CXXCtorInitializer>
+    cxxCtorInitializer;
 
 /// \brief Matches template arguments.
 ///
@@ -478,7 +478,7 @@ const internal::VariadicAllOfMatcher<CXX
 /// \endcode
 /// templateArgument()
 ///   matches 'int' in C<int>.
-const internal::VariadicAllOfMatcher<TemplateArgument> templateArgument;
+extern const internal::VariadicAllOfMatcher<TemplateArgument> templateArgument;
 
 /// \brief Matches template name.
 ///
@@ -489,7 +489,7 @@ const internal::VariadicAllOfMatcher<Tem
 /// \endcode
 /// templateName()
 ///   matches 'X' in X<int>.
-const internal::VariadicAllOfMatcher<TemplateName> templateName;
+extern const internal::VariadicAllOfMatcher<TemplateName> templateName;
 
 /// \brief Matches non-type template parameter declarations.
 ///
@@ -499,9 +499,9 @@ const internal::VariadicAllOfMatcher<Tem
 /// \endcode
 /// nonTypeTemplateParmDecl()
 ///   matches 'N', but not 'T'.
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  NonTypeTemplateParmDecl> nonTypeTemplateParmDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl,
+                                                   NonTypeTemplateParmDecl>
+    nonTypeTemplateParmDecl;
 
 /// \brief Matches template type parameter declarations.
 ///
@@ -511,9 +511,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// templateTypeParmDecl()
 ///   matches 'T', but not 'N'.
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  TemplateTypeParmDecl> templateTypeParmDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, TemplateTypeParmDecl>
+    templateTypeParmDecl;
 
 /// \brief Matches public C++ declarations.
 ///
@@ -974,7 +973,7 @@ AST_MATCHER_P(TemplateArgument, equalsIn
 ///   enum X { A, B, C };
 ///   void F();
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Decl, ValueDecl> valueDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ValueDecl> valueDecl;
 
 /// \brief Matches C++ constructor declarations.
 ///
@@ -987,9 +986,8 @@ const internal::VariadicDynCastAllOfMatc
 ///     int DoSomething();
 ///   };
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  CXXConstructorDecl> cxxConstructorDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXConstructorDecl>
+    cxxConstructorDecl;
 
 /// \brief Matches explicit C++ destructor declarations.
 ///
@@ -1000,9 +998,8 @@ const internal::VariadicDynCastAllOfMatc
 ///     virtual ~Foo();
 ///   };
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  CXXDestructorDecl> cxxDestructorDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXDestructorDecl>
+    cxxDestructorDecl;
 
 /// \brief Matches enum declarations.
 ///
@@ -1012,7 +1009,7 @@ const internal::VariadicDynCastAllOfMatc
 ///     A, B, C
 ///   };
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Decl, EnumDecl> enumDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, EnumDecl> enumDecl;
 
 /// \brief Matches enum constants.
 ///
@@ -1022,9 +1019,8 @@ const internal::VariadicDynCastAllOfMatc
 ///     A, B, C
 ///   };
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  EnumConstantDecl> enumConstantDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, EnumConstantDecl>
+    enumConstantDecl;
 
 /// \brief Matches method declarations.
 ///
@@ -1032,7 +1028,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   class X { void y(); };
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Decl, CXXMethodDecl> cxxMethodDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXMethodDecl>
+    cxxMethodDecl;
 
 /// \brief Matches conversion operator declarations.
 ///
@@ -1040,7 +1037,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   class X { operator int() const; };
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Decl, CXXConversionDecl>
+extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXConversionDecl>
     cxxConversionDecl;
 
 /// \brief Matches variable declarations.
@@ -1052,7 +1049,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   int a;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Decl, VarDecl> varDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, VarDecl> varDecl;
 
 /// \brief Matches field declarations.
 ///
@@ -1062,7 +1059,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// fieldDecl()
 ///   matches 'm'.
-const internal::VariadicDynCastAllOfMatcher<Decl, FieldDecl> fieldDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, FieldDecl> fieldDecl;
 
 /// \brief Matches function declarations.
 ///
@@ -1070,7 +1067,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   void f();
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Decl, FunctionDecl> functionDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, FunctionDecl>
+    functionDecl;
 
 /// \brief Matches C++ function template declarations.
 ///
@@ -1078,9 +1076,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   template<class T> void f(T t) {}
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  FunctionTemplateDecl> functionTemplateDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, FunctionTemplateDecl>
+    functionTemplateDecl;
 
 /// \brief Matches friend declarations.
 ///
@@ -1090,7 +1087,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// friendDecl()
 ///   matches 'friend void foo()'.
-const internal::VariadicDynCastAllOfMatcher<Decl, FriendDecl> friendDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, FriendDecl> friendDecl;
 
 /// \brief Matches statements.
 ///
@@ -1100,7 +1097,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// stmt()
 ///   matches both the compound statement '{ ++a; }' and '++a'.
-const internal::VariadicAllOfMatcher<Stmt> stmt;
+extern const internal::VariadicAllOfMatcher<Stmt> stmt;
 
 /// \brief Matches declaration statements.
 ///
@@ -1110,9 +1107,7 @@ const internal::VariadicAllOfMatcher<Stm
 /// \endcode
 /// declStmt()
 ///   matches 'int a'.
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  DeclStmt> declStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, DeclStmt> declStmt;
 
 /// \brief Matches member expressions.
 ///
@@ -1125,7 +1120,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// memberExpr()
 ///   matches this->x, x, y.x, a, this->b
-const internal::VariadicDynCastAllOfMatcher<Stmt, MemberExpr> memberExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, MemberExpr> memberExpr;
 
 /// \brief Matches call expressions.
 ///
@@ -1135,7 +1130,7 @@ const internal::VariadicDynCastAllOfMatc
 ///   x.y();
 ///   y();
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, CallExpr> callExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CallExpr> callExpr;
 
 /// \brief Matches lambda expressions.
 ///
@@ -1143,7 +1138,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   [&](){return 5;}
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, LambdaExpr> lambdaExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, LambdaExpr> lambdaExpr;
 
 /// \brief Matches member call expressions.
 ///
@@ -1152,9 +1147,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   X x;
 ///   x.y();
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXMemberCallExpr> cxxMemberCallExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXMemberCallExpr>
+    cxxMemberCallExpr;
 
 /// \brief Matches ObjectiveC Message invocation expressions.
 ///
@@ -1165,9 +1159,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   [[NSString alloc] initWithString:@"Hello"]
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ObjCMessageExpr> objcMessageExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCMessageExpr>
+    objcMessageExpr;
 
 /// \brief Matches Objective-C interface declarations.
 ///
@@ -1176,9 +1169,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   @interface Foo
 ///   @end
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ObjCInterfaceDecl> objcInterfaceDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCInterfaceDecl>
+    objcInterfaceDecl;
 
 /// \brief Matches Objective-C implementation declarations.
 ///
@@ -1187,9 +1179,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   @implementation Foo
 ///   @end
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ObjCImplementationDecl> objcImplementationDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCImplementationDecl>
+    objcImplementationDecl;
 
 /// \brief Matches Objective-C protocol declarations.
 ///
@@ -1198,9 +1189,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   @protocol FooDelegate
 ///   @end
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ObjCProtocolDecl> objcProtocolDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCProtocolDecl>
+    objcProtocolDecl;
 
 /// \brief Matches Objective-C category declarations.
 ///
@@ -1209,9 +1199,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   @interface Foo (Additions)
 ///   @end
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ObjCCategoryDecl> objcCategoryDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCCategoryDecl>
+    objcCategoryDecl;
 
 /// \brief Matches Objective-C category definitions.
 ///
@@ -1220,9 +1209,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   @implementation Foo (Additions)
 ///   @end
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ObjCCategoryImplDecl> objcCategoryImplDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCCategoryImplDecl>
+    objcCategoryImplDecl;
 
 /// \brief Matches Objective-C method declarations.
 ///
@@ -1236,9 +1224,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   - (void)method {}
 ///   @end
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ObjCMethodDecl> objcMethodDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCMethodDecl>
+    objcMethodDecl;
 
 /// \brief Matches Objective-C instance variable declarations.
 ///
@@ -1249,9 +1236,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   }
 ///   @end
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ObjCIvarDecl> objcIvarDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCIvarDecl>
+    objcIvarDecl;
 
 /// \brief Matches Objective-C property declarations.
 ///
@@ -1261,9 +1247,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   @property BOOL enabled;
 ///   @end
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  ObjCPropertyDecl> objcPropertyDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCPropertyDecl>
+    objcPropertyDecl;
 
 /// \brief Matches Objective-C \@throw statements.
 ///
@@ -1271,9 +1256,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   @throw obj;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ObjCAtThrowStmt> objcThrowStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtThrowStmt>
+    objcThrowStmt;
 
 /// \brief Matches Objective-C @try statements.
 ///
@@ -1282,9 +1266,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   @try {}
 ///   @catch (...) {}
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ObjCAtTryStmt> objcTryStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtTryStmt>
+    objcTryStmt;
 
 /// \brief Matches Objective-C @catch statements.
 ///
@@ -1293,9 +1276,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   @try {}
 ///   @catch (...) {}
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ObjCAtCatchStmt> objcCatchStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtCatchStmt>
+    objcCatchStmt;
 
 /// \brief Matches Objective-C @finally statements.
 ///
@@ -1304,9 +1286,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   @try {}
 ///   @finally {}
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ObjCAtFinallyStmt> objcFinallyStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtFinallyStmt>
+    objcFinallyStmt;
 
 /// \brief Matches expressions that introduce cleanups to be run at the end
 /// of the sub-expression's evaluation.
@@ -1315,9 +1296,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   const std::string str = std::string();
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ExprWithCleanups> exprWithCleanups;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ExprWithCleanups>
+    exprWithCleanups;
 
 /// \brief Matches init list expressions.
 ///
@@ -1329,7 +1309,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// initListExpr()
 ///   matches "{ 1, 2 }" and "{ 5, 6 }"
-const internal::VariadicDynCastAllOfMatcher<Stmt, InitListExpr> initListExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, InitListExpr>
+    initListExpr;
 
 /// \brief Matches the syntactic form of init list expressions
 /// (if expression have it).
@@ -1351,8 +1332,9 @@ AST_MATCHER_P(InitListExpr, hasSyntactic
 /// \endcode
 /// cxxStdInitializerListExpr()
 ///   matches "{ 1, 2, 3 }" and "{ 4, 5 }"
-const internal::VariadicDynCastAllOfMatcher<Stmt,
-  CXXStdInitializerListExpr> cxxStdInitializerListExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt,
+                                                   CXXStdInitializerListExpr>
+    cxxStdInitializerListExpr;
 
 /// \brief Matches implicit initializers of init list expressions.
 ///
@@ -1362,8 +1344,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// implicitValueInitExpr()
 ///   matches "[0].y" (implicitly)
-const internal::VariadicDynCastAllOfMatcher<Stmt, ImplicitValueInitExpr>
-implicitValueInitExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ImplicitValueInitExpr>
+    implicitValueInitExpr;
 
 /// \brief Matches paren list expressions.
 /// ParenListExprs don't have a predefined type and are used for late parsing.
@@ -1380,7 +1362,8 @@ implicitValueInitExpr;
 /// \endcode
 /// parenListExpr() matches "*this" but NOT matches (a, b) because (a, b)
 /// has a predefined type and is a ParenExpr, not a ParenListExpr.
-const internal::VariadicDynCastAllOfMatcher<Stmt, ParenListExpr> parenListExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ParenListExpr>
+    parenListExpr;
 
 /// \brief Matches substitutions of non-type template parameters.
 ///
@@ -1392,9 +1375,9 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// substNonTypeTemplateParmExpr()
 ///   matches "N" in the right-hand side of "static const int n = N;"
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  SubstNonTypeTemplateParmExpr> substNonTypeTemplateParmExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt,
+                                                   SubstNonTypeTemplateParmExpr>
+    substNonTypeTemplateParmExpr;
 
 /// \brief Matches using declarations.
 ///
@@ -1405,7 +1388,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// usingDecl()
 ///   matches \code using X::x \endcode
-const internal::VariadicDynCastAllOfMatcher<Decl, UsingDecl> usingDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, UsingDecl> usingDecl;
 
 /// \brief Matches using namespace declarations.
 ///
@@ -1416,9 +1399,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// usingDirectiveDecl()
 ///   matches \code using namespace X \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  UsingDirectiveDecl> usingDirectiveDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, UsingDirectiveDecl>
+    usingDirectiveDecl;
 
 /// \brief Matches reference to a name that can be looked up during parsing
 /// but could not be resolved to a specific declaration.
@@ -1434,9 +1416,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// unresolvedLookupExpr()
 ///   matches \code foo<T>() \endcode
-const internal::VariadicDynCastAllOfMatcher<
-   Stmt,
-   UnresolvedLookupExpr> unresolvedLookupExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, UnresolvedLookupExpr>
+    unresolvedLookupExpr;
 
 /// \brief Matches unresolved using value declarations.
 ///
@@ -1449,9 +1430,9 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// unresolvedUsingValueDecl()
 ///   matches \code using X::x \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  UnresolvedUsingValueDecl> unresolvedUsingValueDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl,
+                                                   UnresolvedUsingValueDecl>
+    unresolvedUsingValueDecl;
 
 /// \brief Matches unresolved using value declarations that involve the
 /// typename.
@@ -1468,9 +1449,9 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// unresolvedUsingTypenameDecl()
 ///   matches \code using Base<T>::Foo \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  UnresolvedUsingTypenameDecl> unresolvedUsingTypenameDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl,
+                                                   UnresolvedUsingTypenameDecl>
+    unresolvedUsingTypenameDecl;
 
 /// \brief Matches parentheses used in expressions.
 ///
@@ -1479,9 +1460,7 @@ const internal::VariadicDynCastAllOfMatc
 ///   int foo() { return 1; }
 ///   int a = (foo() + 1);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ParenExpr> parenExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ParenExpr> parenExpr;
 
 /// \brief Matches constructor call expressions (including implicit ones).
 ///
@@ -1493,9 +1472,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   int n;
 ///   f(string(ptr, n), ptr);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXConstructExpr> cxxConstructExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXConstructExpr>
+    cxxConstructExpr;
 
 /// \brief Matches unresolved constructor call expressions.
 ///
@@ -1505,9 +1483,9 @@ const internal::VariadicDynCastAllOfMatc
 ///   template <typename T>
 ///   void f(const T& t) { return T(t); }
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXUnresolvedConstructExpr> cxxUnresolvedConstructExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt,
+                                                   CXXUnresolvedConstructExpr>
+    cxxUnresolvedConstructExpr;
 
 /// \brief Matches implicit and explicit this expressions.
 ///
@@ -1519,7 +1497,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   int f() { return i; }
 /// };
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThisExpr> cxxThisExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThisExpr>
+    cxxThisExpr;
 
 /// \brief Matches nodes where temporaries are created.
 ///
@@ -1529,9 +1508,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   FunctionTakesString(GetStringByValue());
 ///   FunctionTakesStringByPointer(GetStringPointer());
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXBindTemporaryExpr> cxxBindTemporaryExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXBindTemporaryExpr>
+    cxxBindTemporaryExpr;
 
 /// \brief Matches nodes where temporaries are materialized.
 ///
@@ -1551,9 +1529,9 @@ const internal::VariadicDynCastAllOfMatc
 ///   f();
 ///   f().func();
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  MaterializeTemporaryExpr> materializeTemporaryExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt,
+                                                   MaterializeTemporaryExpr>
+    materializeTemporaryExpr;
 
 /// \brief Matches new expressions.
 ///
@@ -1563,7 +1541,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// cxxNewExpr()
 ///   matches 'new X'.
-const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNewExpr> cxxNewExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNewExpr> cxxNewExpr;
 
 /// \brief Matches delete expressions.
 ///
@@ -1573,7 +1551,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// cxxDeleteExpr()
 ///   matches 'delete X'.
-const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDeleteExpr> cxxDeleteExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDeleteExpr>
+    cxxDeleteExpr;
 
 /// \brief Matches array subscript expressions.
 ///
@@ -1583,9 +1562,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// arraySubscriptExpr()
 ///   matches "a[1]"
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ArraySubscriptExpr> arraySubscriptExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ArraySubscriptExpr>
+    arraySubscriptExpr;
 
 /// \brief Matches the value of a default argument at the call site.
 ///
@@ -1596,9 +1574,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   void f(int x, int y = 0);
 ///   f(42);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXDefaultArgExpr> cxxDefaultArgExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDefaultArgExpr>
+    cxxDefaultArgExpr;
 
 /// \brief Matches overloaded operator calls.
 ///
@@ -1614,9 +1591,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   ostream &o; int b = 1, c = 1;
 ///   o << b << c;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXOperatorCallExpr> cxxOperatorCallExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXOperatorCallExpr>
+    cxxOperatorCallExpr;
 
 /// \brief Matches expressions.
 ///
@@ -1624,7 +1600,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   void f() { x(); }
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, Expr> expr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, Expr> expr;
 
 /// \brief Matches expressions that refer to declarations.
 ///
@@ -1633,7 +1609,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   bool x;
 ///   if (x) {}
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, DeclRefExpr> declRefExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, DeclRefExpr>
+    declRefExpr;
 
 /// \brief Matches if statements.
 ///
@@ -1641,7 +1618,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   if (x) {}
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, IfStmt> ifStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, IfStmt> ifStmt;
 
 /// \brief Matches for statements.
 ///
@@ -1650,7 +1627,7 @@ const internal::VariadicDynCastAllOfMatc
 ///   for (;;) {}
 ///   int i[] =  {1, 2, 3}; for (auto a : i);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, ForStmt> forStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ForStmt> forStmt;
 
 /// \brief Matches the increment statement of a for loop.
 ///
@@ -1688,9 +1665,8 @@ AST_MATCHER_P(ForStmt, hasLoopInit, inte
 ///   int i[] =  {1, 2, 3}; for (auto a : i);
 ///   for(int j = 0; j < 5; ++j);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXForRangeStmt> cxxForRangeStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXForRangeStmt>
+    cxxForRangeStmt;
 
 /// \brief Matches the initialization statement of a for loop.
 ///
@@ -1728,7 +1704,7 @@ AST_MATCHER_P(CXXForRangeStmt, hasRangeI
 /// \endcode
 /// whileStmt()
 ///   matches 'while (true) {}'.
-const internal::VariadicDynCastAllOfMatcher<Stmt, WhileStmt> whileStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, WhileStmt> whileStmt;
 
 /// \brief Matches do statements.
 ///
@@ -1738,7 +1714,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// doStmt()
 ///   matches 'do {} while(true)'
-const internal::VariadicDynCastAllOfMatcher<Stmt, DoStmt> doStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, DoStmt> doStmt;
 
 /// \brief Matches break statements.
 ///
@@ -1748,7 +1724,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// breakStmt()
 ///   matches 'break'
-const internal::VariadicDynCastAllOfMatcher<Stmt, BreakStmt> breakStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, BreakStmt> breakStmt;
 
 /// \brief Matches continue statements.
 ///
@@ -1758,7 +1734,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// continueStmt()
 ///   matches 'continue'
-const internal::VariadicDynCastAllOfMatcher<Stmt, ContinueStmt> continueStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ContinueStmt>
+    continueStmt;
 
 /// \brief Matches return statements.
 ///
@@ -1768,7 +1745,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// returnStmt()
 ///   matches 'return 1'
-const internal::VariadicDynCastAllOfMatcher<Stmt, ReturnStmt> returnStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ReturnStmt> returnStmt;
 
 /// \brief Matches goto statements.
 ///
@@ -1779,7 +1756,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// gotoStmt()
 ///   matches 'goto FOO'
-const internal::VariadicDynCastAllOfMatcher<Stmt, GotoStmt> gotoStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, GotoStmt> gotoStmt;
 
 /// \brief Matches label statements.
 ///
@@ -1790,7 +1767,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// labelStmt()
 ///   matches 'FOO:'
-const internal::VariadicDynCastAllOfMatcher<Stmt, LabelStmt> labelStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, LabelStmt> labelStmt;
 
 /// \brief Matches address of label statements (GNU extension).
 ///
@@ -1802,7 +1779,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// addrLabelExpr()
 ///   matches '&&FOO'
-const internal::VariadicDynCastAllOfMatcher<Stmt, AddrLabelExpr> addrLabelExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, AddrLabelExpr>
+    addrLabelExpr;
 
 /// \brief Matches switch statements.
 ///
@@ -1812,7 +1790,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// switchStmt()
 ///   matches 'switch(a)'.
-const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchStmt> switchStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchStmt> switchStmt;
 
 /// \brief Matches case and default statements inside switch statements.
 ///
@@ -1822,7 +1800,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// switchCase()
 ///   matches 'case 42: break;' and 'default: break;'.
-const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchCase> switchCase;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchCase> switchCase;
 
 /// \brief Matches case statements inside switch statements.
 ///
@@ -1832,7 +1810,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// caseStmt()
 ///   matches 'case 42: break;'.
-const internal::VariadicDynCastAllOfMatcher<Stmt, CaseStmt> caseStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CaseStmt> caseStmt;
 
 /// \brief Matches default statements inside switch statements.
 ///
@@ -1842,7 +1820,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// defaultStmt()
 ///   matches 'default: break;'.
-const internal::VariadicDynCastAllOfMatcher<Stmt, DefaultStmt> defaultStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, DefaultStmt>
+    defaultStmt;
 
 /// \brief Matches compound statements.
 ///
@@ -1850,7 +1829,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   for (;;) {{}}
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundStmt> compoundStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundStmt>
+    compoundStmt;
 
 /// \brief Matches catch statements.
 ///
@@ -1859,7 +1839,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// cxxCatchStmt()
 ///   matches 'catch(int i)'
-const internal::VariadicDynCastAllOfMatcher<Stmt, CXXCatchStmt> cxxCatchStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXCatchStmt>
+    cxxCatchStmt;
 
 /// \brief Matches try statements.
 ///
@@ -1868,7 +1849,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// cxxTryStmt()
 ///   matches 'try {}'
-const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTryStmt> cxxTryStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTryStmt> cxxTryStmt;
 
 /// \brief Matches throw expressions.
 ///
@@ -1877,7 +1858,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// cxxThrowExpr()
 ///   matches 'throw 5'
-const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThrowExpr> cxxThrowExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThrowExpr>
+    cxxThrowExpr;
 
 /// \brief Matches null statements.
 ///
@@ -1886,7 +1868,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// nullStmt()
 ///   matches the second ';'
-const internal::VariadicDynCastAllOfMatcher<Stmt, NullStmt> nullStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, NullStmt> nullStmt;
 
 /// \brief Matches asm statements.
 ///
@@ -1896,7 +1878,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \endcode
 /// asmStmt()
 ///   matches '__asm("mov al, 2")'
-const internal::VariadicDynCastAllOfMatcher<Stmt, AsmStmt> asmStmt;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, AsmStmt> asmStmt;
 
 /// \brief Matches bool literals.
 ///
@@ -1904,9 +1886,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   true
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXBoolLiteralExpr> cxxBoolLiteral;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXBoolLiteralExpr>
+    cxxBoolLiteral;
 
 /// \brief Matches string literals (also matches wide string literals).
 ///
@@ -1915,9 +1896,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   char *s = "abcd";
 ///   wchar_t *ws = L"abcd";
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  StringLiteral> stringLiteral;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, StringLiteral>
+    stringLiteral;
 
 /// \brief Matches character literals (also matches wchar_t).
 ///
@@ -1929,17 +1909,15 @@ const internal::VariadicDynCastAllOfMatc
 ///   char ch = 'a';
 ///   wchar_t chw = L'a';
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CharacterLiteral> characterLiteral;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CharacterLiteral>
+    characterLiteral;
 
 /// \brief Matches integer literals of all sizes / encodings, e.g.
 /// 1, 1L, 0x1 and 1U.
 ///
 /// Does not match character-encoded integers such as L'a'.
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  IntegerLiteral> integerLiteral;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, IntegerLiteral>
+    integerLiteral;
 
 /// \brief Matches float literals of all sizes / encodings, e.g.
 /// 1.0, 1.0f, 1.0L and 1e10.
@@ -1948,16 +1926,14 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   float a = 10;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  FloatingLiteral> floatLiteral;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, FloatingLiteral>
+    floatLiteral;
 
 /// \brief Matches user defined literal operator call.
 ///
 /// Example match: "foo"_suffix
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  UserDefinedLiteral> userDefinedLiteral;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, UserDefinedLiteral>
+    userDefinedLiteral;
 
 /// \brief Matches compound (i.e. non-scalar) literals
 ///
@@ -1966,24 +1942,23 @@ const internal::VariadicDynCastAllOfMatc
 ///   int array[4] = {1};
 ///   vector int myvec = (vector int)(1, 2);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CompoundLiteralExpr> compoundLiteralExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundLiteralExpr>
+    compoundLiteralExpr;
 
 /// \brief Matches nullptr literal.
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXNullPtrLiteralExpr> cxxNullPtrLiteralExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNullPtrLiteralExpr>
+    cxxNullPtrLiteralExpr;
 
 /// \brief Matches GNU __null expression.
-const internal::VariadicDynCastAllOfMatcher<Stmt, GNUNullExpr> gnuNullExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, GNUNullExpr>
+    gnuNullExpr;
 
 /// \brief Matches atomic builtins.
 /// Example matches __atomic_load_n(ptr, 1)
 /// \code
 ///   void foo() { int *ptr; __atomic_load_n(ptr, 1); }
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, AtomicExpr> atomicExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, AtomicExpr> atomicExpr;
 
 /// \brief Matches statement expression (GNU extension).
 ///
@@ -1991,7 +1966,7 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   int C = ({ int X = 4; X; });
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, StmtExpr> stmtExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, StmtExpr> stmtExpr;
 
 /// \brief Matches binary operator expressions.
 ///
@@ -1999,9 +1974,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   !(a || b)
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  BinaryOperator> binaryOperator;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, BinaryOperator>
+    binaryOperator;
 
 /// \brief Matches unary operator expressions.
 ///
@@ -2009,9 +1983,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   !a || b
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  UnaryOperator> unaryOperator;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, UnaryOperator>
+    unaryOperator;
 
 /// \brief Matches conditional operator expressions.
 ///
@@ -2019,9 +1992,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   (a ? b : c) + 42
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ConditionalOperator> conditionalOperator;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ConditionalOperator>
+    conditionalOperator;
 
 /// \brief Matches binary conditional operator expressions (GNU extension).
 ///
@@ -2029,9 +2001,9 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   (a ?: b) + 42;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  BinaryConditionalOperator> binaryConditionalOperator;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt,
+                                                   BinaryConditionalOperator>
+    binaryConditionalOperator;
 
 /// \brief Matches opaque value expressions. They are used as helpers
 /// to reference another expressions and can be met
@@ -2041,9 +2013,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   (a ?: c) + 42;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  OpaqueValueExpr> opaqueValueExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, OpaqueValueExpr>
+    opaqueValueExpr;
 
 /// \brief Matches a C++ static_assert declaration.
 ///
@@ -2058,9 +2029,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   };
 ///   static_assert(sizeof(S) == sizeof(int));
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Decl,
-  StaticAssertDecl> staticAssertDecl;
+extern const internal::VariadicDynCastAllOfMatcher<Decl, StaticAssertDecl>
+    staticAssertDecl;
 
 /// \brief Matches a reinterpret_cast expression.
 ///
@@ -2072,9 +2042,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   void* p = reinterpret_cast<char*>(&p);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXReinterpretCastExpr> cxxReinterpretCastExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXReinterpretCastExpr>
+    cxxReinterpretCastExpr;
 
 /// \brief Matches a C++ static_cast expression.
 ///
@@ -2089,9 +2058,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   long eight(static_cast<long>(8));
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXStaticCastExpr> cxxStaticCastExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXStaticCastExpr>
+    cxxStaticCastExpr;
 
 /// \brief Matches a dynamic_cast expression.
 ///
@@ -2105,9 +2073,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   B b;
 ///   D* p = dynamic_cast<D*>(&b);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXDynamicCastExpr> cxxDynamicCastExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDynamicCastExpr>
+    cxxDynamicCastExpr;
 
 /// \brief Matches a const_cast expression.
 ///
@@ -2117,9 +2084,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   const int &r(n);
 ///   int* p = const_cast<int*>(&r);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXConstCastExpr> cxxConstCastExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXConstCastExpr>
+    cxxConstCastExpr;
 
 /// \brief Matches a C-style cast expression.
 ///
@@ -2127,9 +2093,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   int i = (int) 2.2f;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CStyleCastExpr> cStyleCastExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CStyleCastExpr>
+    cStyleCastExpr;
 
 /// \brief Matches explicit cast expressions.
 ///
@@ -2152,17 +2117,15 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   long ell = 42;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ExplicitCastExpr> explicitCastExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ExplicitCastExpr>
+    explicitCastExpr;
 
 /// \brief Matches the implicit cast nodes of Clang's AST.
 ///
 /// This matches many different places, including function call return value
 /// eliding, as well as any type conversions.
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  ImplicitCastExpr> implicitCastExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ImplicitCastExpr>
+    implicitCastExpr;
 
 /// \brief Matches any cast nodes of Clang's AST.
 ///
@@ -2177,7 +2140,7 @@ const internal::VariadicDynCastAllOfMatc
 ///   int i = (0);
 ///   int k = 0;
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<Stmt, CastExpr> castExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CastExpr> castExpr;
 
 /// \brief Matches functional cast expressions
 ///
@@ -2187,9 +2150,8 @@ const internal::VariadicDynCastAllOfMatc
 ///   Foo g = (Foo) bar;
 ///   Foo h = Foo(bar);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXFunctionalCastExpr> cxxFunctionalCastExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXFunctionalCastExpr>
+    cxxFunctionalCastExpr;
 
 /// \brief Matches functional cast expressions having N != 1 arguments
 ///
@@ -2197,9 +2159,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   Foo h = Foo(bar, bar);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CXXTemporaryObjectExpr> cxxTemporaryObjectExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTemporaryObjectExpr>
+    cxxTemporaryObjectExpr;
 
 /// \brief Matches predefined identifier expressions [C99 6.4.2.2].
 ///
@@ -2207,9 +2168,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   printf("%s", __func__);
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  PredefinedExpr> predefinedExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, PredefinedExpr>
+    predefinedExpr;
 
 /// \brief Matches C99 designated initializer expressions [C99 6.7.8].
 ///
@@ -2217,9 +2177,8 @@ const internal::VariadicDynCastAllOfMatc
 /// \code
 ///   point ptarray[10] = { [2].y = 1.0, [0].x = 1.0 };
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  DesignatedInitExpr> designatedInitExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, DesignatedInitExpr>
+    designatedInitExpr;
 
 /// \brief Matches designated initializer expressions that contain
 /// a specific number of designators.
@@ -2237,13 +2196,13 @@ AST_MATCHER_P(DesignatedInitExpr, design
 }
 
 /// \brief Matches \c QualTypes in the clang AST.
-const internal::VariadicAllOfMatcher<QualType> qualType;
+extern const internal::VariadicAllOfMatcher<QualType> qualType;
 
 /// \brief Matches \c Types in the clang AST.
-const internal::VariadicAllOfMatcher<Type> type;
+extern const internal::VariadicAllOfMatcher<Type> type;
 
 /// \brief Matches \c TypeLocs in the clang AST.
-const internal::VariadicAllOfMatcher<TypeLoc> typeLoc;
+extern const internal::VariadicAllOfMatcher<TypeLoc> typeLoc;
 
 /// \brief Matches if any of the given matchers matches.
 ///
@@ -2264,23 +2223,23 @@ const internal::VariadicAllOfMatcher<Typ
 /// \c b.
 ///
 /// Usable as: Any Matcher
-const internal::VariadicOperatorMatcherFunc<
+extern const internal::VariadicOperatorMatcherFunc<
     2, std::numeric_limits<unsigned>::max()>
-    eachOf = {internal::DynTypedMatcher::VO_EachOf};
+    eachOf;
 
 /// \brief Matches if any of the given matchers matches.
 ///
 /// Usable as: Any Matcher
-const internal::VariadicOperatorMatcherFunc<
+extern const internal::VariadicOperatorMatcherFunc<
     2, std::numeric_limits<unsigned>::max()>
-    anyOf = {internal::DynTypedMatcher::VO_AnyOf};
+    anyOf;
 
 /// \brief Matches if all given matchers match.
 ///
 /// Usable as: Any Matcher
-const internal::VariadicOperatorMatcherFunc<
+extern const internal::VariadicOperatorMatcherFunc<
     2, std::numeric_limits<unsigned>::max()>
-    allOf = {internal::DynTypedMatcher::VO_AllOf};
+    allOf;
 
 /// \brief Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
 ///
@@ -2291,9 +2250,9 @@ const internal::VariadicOperatorMatcherF
 /// \endcode
 /// unaryExprOrTypeTraitExpr()
 ///   matches \c sizeof(x) and \c alignof(x)
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  UnaryExprOrTypeTraitExpr> unaryExprOrTypeTraitExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt,
+                                                   UnaryExprOrTypeTraitExpr>
+    unaryExprOrTypeTraitExpr;
 
 /// \brief Matches unary expressions that have a specific type of argument.
 ///
@@ -2369,9 +2328,9 @@ inline internal::Matcher<NamedDecl> hasN
 /// \code
 ///     anyOf(hasName(a), hasName(b), hasName(c))
 /// \endcode
-const internal::VariadicFunction<internal::Matcher<NamedDecl>, StringRef,
-                                 internal::hasAnyNameFunc>
-    hasAnyName = {};
+extern const internal::VariadicFunction<internal::Matcher<NamedDecl>, StringRef,
+                                        internal::hasAnyNameFunc>
+    hasAnyName;
 
 /// \brief Matches NamedDecl nodes whose fully qualified names contain
 /// a substring matched by the given RegExp.
@@ -2520,8 +2479,7 @@ AST_MATCHER(CXXRecordDecl, isLambda) {
 /// casts and paren casts. If you are matching with expr then you should
 /// probably consider using ignoringParenImpCasts like:
 /// has(ignoringParenImpCasts(expr())).
-const internal::ArgumentAdaptingMatcherFunc<internal::HasMatcher>
-LLVM_ATTRIBUTE_UNUSED has = {};
+extern const internal::ArgumentAdaptingMatcherFunc<internal::HasMatcher> has;
 
 /// \brief Matches AST nodes that have descendant AST nodes that match the
 /// provided matcher.
@@ -2537,8 +2495,9 @@ LLVM_ATTRIBUTE_UNUSED has = {};
 /// DescendantT must be an AST base type.
 ///
 /// Usable as: Any Matcher
-const internal::ArgumentAdaptingMatcherFunc<internal::HasDescendantMatcher>
-LLVM_ATTRIBUTE_UNUSED hasDescendant = {};
+extern const internal::ArgumentAdaptingMatcherFunc<
+    internal::HasDescendantMatcher>
+    hasDescendant;
 
 /// \brief Matches AST nodes that have child AST nodes that match the
 /// provided matcher.
@@ -2557,8 +2516,8 @@ LLVM_ATTRIBUTE_UNUSED hasDescendant = {}
 /// matches instead of only on the first one.
 ///
 /// Usable as: Any Matcher
-const internal::ArgumentAdaptingMatcherFunc<internal::ForEachMatcher>
-LLVM_ATTRIBUTE_UNUSED forEach = {};
+extern const internal::ArgumentAdaptingMatcherFunc<internal::ForEachMatcher>
+    forEach;
 
 /// \brief Matches AST nodes that have descendant AST nodes that match the
 /// provided matcher.
@@ -2586,8 +2545,9 @@ LLVM_ATTRIBUTE_UNUSED forEach = {};
 /// \endcode
 ///
 /// Usable as: Any Matcher
-const internal::ArgumentAdaptingMatcherFunc<internal::ForEachDescendantMatcher>
-LLVM_ATTRIBUTE_UNUSED forEachDescendant = {};
+extern const internal::ArgumentAdaptingMatcherFunc<
+    internal::ForEachDescendantMatcher>
+    forEachDescendant;
 
 /// \brief Matches if the node or any descendant matches.
 ///
@@ -2620,11 +2580,11 @@ internal::Matcher<T> findAll(const inter
 /// \c compoundStmt(hasParent(ifStmt())) matches "{ int x = 43; }".
 ///
 /// Usable as: Any Matcher
-const internal::ArgumentAdaptingMatcherFunc<
+extern const internal::ArgumentAdaptingMatcherFunc<
     internal::HasParentMatcher,
     internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
     internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
-    LLVM_ATTRIBUTE_UNUSED hasParent = {};
+    hasParent;
 
 /// \brief Matches AST nodes that have an ancestor that matches the provided
 /// matcher.
@@ -2637,11 +2597,11 @@ const internal::ArgumentAdaptingMatcherF
 /// \c expr(integerLiteral(hasAncestor(ifStmt()))) matches \c 42, but not 43.
 ///
 /// Usable as: Any Matcher
-const internal::ArgumentAdaptingMatcherFunc<
+extern const internal::ArgumentAdaptingMatcherFunc<
     internal::HasAncestorMatcher,
     internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
     internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
-    LLVM_ATTRIBUTE_UNUSED hasAncestor = {};
+    hasAncestor;
 
 /// \brief Matches if the provided matcher does not match.
 ///
@@ -2652,9 +2612,7 @@ const internal::ArgumentAdaptingMatcherF
 /// \endcode
 ///
 /// Usable as: Any Matcher
-const internal::VariadicOperatorMatcherFunc<1, 1> unless = {
-  internal::DynTypedMatcher::VO_UnaryNot
-};
+extern const internal::VariadicOperatorMatcherFunc<1, 1> unless;
 
 /// \brief Matches a node if the declaration associated with that node
 /// matches the given matcher.
@@ -4780,6 +4738,9 @@ AST_MATCHER(Type, voidType) {
   return Node.isVoidType();
 }
 
+template <typename NodeType>
+using AstTypeMatcher = internal::VariadicDynCastAllOfMatcher<Type, NodeType>;
+
 /// \brief Matches builtin Types.
 ///
 /// Given
@@ -4792,7 +4753,7 @@ AST_MATCHER(Type, voidType) {
 /// \endcode
 /// builtinType()
 ///   matches "int b", "float c" and "bool d"
-AST_TYPE_MATCHER(BuiltinType, builtinType);
+extern const AstTypeMatcher<BuiltinType> builtinType;
 
 /// \brief Matches all kinds of arrays.
 ///
@@ -4804,7 +4765,7 @@ AST_TYPE_MATCHER(BuiltinType, builtinTyp
 /// \endcode
 /// arrayType()
 ///   matches "int a[]", "int b[4]" and "int c[a[0]]";
-AST_TYPE_MATCHER(ArrayType, arrayType);
+extern const AstTypeMatcher<ArrayType> arrayType;
 
 /// \brief Matches C99 complex types.
 ///
@@ -4814,7 +4775,7 @@ AST_TYPE_MATCHER(ArrayType, arrayType);
 /// \endcode
 /// complexType()
 ///   matches "_Complex float f"
-AST_TYPE_MATCHER(ComplexType, complexType);
+extern const AstTypeMatcher<ComplexType> complexType;
 
 /// \brief Matches any real floating-point type (float, double, long double).
 ///
@@ -4858,7 +4819,7 @@ AST_TYPELOC_TRAVERSE_MATCHER(hasElementT
 /// \endcode
 /// constantArrayType()
 ///   matches "int a[2]"
-AST_TYPE_MATCHER(ConstantArrayType, constantArrayType);
+extern const AstTypeMatcher<ConstantArrayType> constantArrayType;
 
 /// \brief Matches nodes that have the specified size.
 ///
@@ -4893,7 +4854,7 @@ AST_POLYMORPHIC_MATCHER_P(hasSize,
 /// \endcode
 /// dependentSizedArrayType
 ///   matches "T data[Size]"
-AST_TYPE_MATCHER(DependentSizedArrayType, dependentSizedArrayType);
+extern const AstTypeMatcher<DependentSizedArrayType> dependentSizedArrayType;
 
 /// \brief Matches C arrays with unspecified size.
 ///
@@ -4905,7 +4866,7 @@ AST_TYPE_MATCHER(DependentSizedArrayType
 /// \endcode
 /// incompleteArrayType()
 ///   matches "int a[]" and "int c[]"
-AST_TYPE_MATCHER(IncompleteArrayType, incompleteArrayType);
+extern const AstTypeMatcher<IncompleteArrayType> incompleteArrayType;
 
 /// \brief Matches C arrays with a specified size that is not an
 /// integer-constant-expression.
@@ -4920,7 +4881,7 @@ AST_TYPE_MATCHER(IncompleteArrayType, in
 /// \endcode
 /// variableArrayType()
 ///   matches "int c[a[0]]"
-AST_TYPE_MATCHER(VariableArrayType, variableArrayType);
+extern const AstTypeMatcher<VariableArrayType> variableArrayType;
 
 /// \brief Matches \c VariableArrayType nodes that have a specific size
 /// expression.
@@ -4947,7 +4908,7 @@ AST_MATCHER_P(VariableArrayType, hasSize
 /// \endcode
 /// atomicType()
 ///   matches "_Atomic(int) i"
-AST_TYPE_MATCHER(AtomicType, atomicType);
+extern const AstTypeMatcher<AtomicType> atomicType;
 
 /// \brief Matches atomic types with a specific value type.
 ///
@@ -4973,7 +4934,7 @@ AST_TYPELOC_TRAVERSE_MATCHER(hasValueTyp
 /// \endcode
 /// autoType()
 ///   matches "auto n" and "auto i"
-AST_TYPE_MATCHER(AutoType, autoType);
+extern const AstTypeMatcher<AutoType> autoType;
 
 /// \brief Matches \c AutoType nodes where the deduced type is a specific type.
 ///
@@ -5001,7 +4962,7 @@ AST_TYPE_TRAVERSE_MATCHER(hasDeducedType
 /// \endcode
 /// functionType()
 ///   matches "int (*f)(int)" and the type of "g".
-AST_TYPE_MATCHER(FunctionType, functionType);
+extern const AstTypeMatcher<FunctionType> functionType;
 
 /// \brief Matches \c FunctionProtoType nodes.
 ///
@@ -5013,7 +4974,7 @@ AST_TYPE_MATCHER(FunctionType, functionT
 /// functionProtoType()
 ///   matches "int (*f)(int)" and the type of "g" in C++ mode.
 ///   In C mode, "g" is not matched because it does not contain a prototype.
-AST_TYPE_MATCHER(FunctionProtoType, functionProtoType);
+extern const AstTypeMatcher<FunctionProtoType> functionProtoType;
 
 /// \brief Matches \c ParenType nodes.
 ///
@@ -5025,7 +4986,7 @@ AST_TYPE_MATCHER(FunctionProtoType, func
 ///
 /// \c varDecl(hasType(pointsTo(parenType()))) matches \c ptr_to_array but not
 /// \c array_of_ptrs.
-AST_TYPE_MATCHER(ParenType, parenType);
+extern const AstTypeMatcher<ParenType> parenType;
 
 /// \brief Matches \c ParenType nodes where the inner type is a specific type.
 ///
@@ -5046,7 +5007,7 @@ AST_TYPE_TRAVERSE_MATCHER(innerType, get
 /// "void (^)(int)".
 ///
 /// The \c pointee is always required to be a \c FunctionType.
-AST_TYPE_MATCHER(BlockPointerType, blockPointerType);
+extern const AstTypeMatcher<BlockPointerType> blockPointerType;
 
 /// \brief Matches member pointer types.
 /// Given
@@ -5056,7 +5017,7 @@ AST_TYPE_MATCHER(BlockPointerType, block
 /// \endcode
 /// memberPointerType()
 ///   matches "A::* ptr"
-AST_TYPE_MATCHER(MemberPointerType, memberPointerType);
+extern const AstTypeMatcher<MemberPointerType> memberPointerType;
 
 /// \brief Matches pointer types, but does not match Objective-C object pointer
 /// types.
@@ -5073,7 +5034,7 @@ AST_TYPE_MATCHER(MemberPointerType, memb
 /// \endcode
 /// pointerType()
 ///   matches "int *a", but does not match "Foo *f".
-AST_TYPE_MATCHER(PointerType, pointerType);
+extern const AstTypeMatcher<PointerType> pointerType;
 
 /// \brief Matches an Objective-C object pointer type, which is different from
 /// a pointer type, despite being syntactically similar.
@@ -5088,7 +5049,7 @@ AST_TYPE_MATCHER(PointerType, pointerTyp
 /// \endcode
 /// pointerType()
 ///   matches "Foo *f", but does not match "int *a".
-AST_TYPE_MATCHER(ObjCObjectPointerType, objcObjectPointerType);
+extern const AstTypeMatcher<ObjCObjectPointerType> objcObjectPointerType;
 
 /// \brief Matches both lvalue and rvalue reference types.
 ///
@@ -5104,7 +5065,7 @@ AST_TYPE_MATCHER(ObjCObjectPointerType,
 /// \endcode
 ///
 /// \c referenceType() matches the types of \c b, \c c, \c d, \c e, and \c f.
-AST_TYPE_MATCHER(ReferenceType, referenceType);
+extern const AstTypeMatcher<ReferenceType> referenceType;
 
 /// \brief Matches lvalue reference types.
 ///
@@ -5121,7 +5082,7 @@ AST_TYPE_MATCHER(ReferenceType, referenc
 ///
 /// \c lValueReferenceType() matches the types of \c b, \c d, and \c e. \c e is
 /// matched since the type is deduced as int& by reference collapsing rules.
-AST_TYPE_MATCHER(LValueReferenceType, lValueReferenceType);
+extern const AstTypeMatcher<LValueReferenceType> lValueReferenceType;
 
 /// \brief Matches rvalue reference types.
 ///
@@ -5138,7 +5099,7 @@ AST_TYPE_MATCHER(LValueReferenceType, lV
 ///
 /// \c rValueReferenceType() matches the types of \c c and \c f. \c e is not
 /// matched as it is deduced to int& by reference collapsing rules.
-AST_TYPE_MATCHER(RValueReferenceType, rValueReferenceType);
+extern const AstTypeMatcher<RValueReferenceType> rValueReferenceType;
 
 /// \brief Narrows PointerType (and similar) matchers to those where the
 /// \c pointee matches a given matcher.
@@ -5168,7 +5129,7 @@ AST_TYPELOC_TRAVERSE_MATCHER(pointee, ge
 /// \endcode
 /// typedefType()
 ///   matches "typedef int X"
-AST_TYPE_MATCHER(TypedefType, typedefType);
+extern const AstTypeMatcher<TypedefType> typedefType;
 
 /// \brief Matches enum types.
 ///
@@ -5183,7 +5144,7 @@ AST_TYPE_MATCHER(TypedefType, typedefTyp
 //
 /// \c enumType() matches the type of the variable declarations of both \c c and
 /// \c s.
-AST_TYPE_MATCHER(EnumType, enumType);
+extern const AstTypeMatcher<EnumType> enumType;
 
 /// \brief Matches template specialization types.
 ///
@@ -5198,7 +5159,8 @@ AST_TYPE_MATCHER(EnumType, enumType);
 ///
 /// \c templateSpecializationType() matches the type of the explicit
 /// instantiation in \c A and the type of the variable declaration in \c B.
-AST_TYPE_MATCHER(TemplateSpecializationType, templateSpecializationType);
+extern const AstTypeMatcher<TemplateSpecializationType>
+    templateSpecializationType;
 
 /// \brief Matches types nodes representing unary type transformations.
 ///
@@ -5208,7 +5170,7 @@ AST_TYPE_MATCHER(TemplateSpecializationT
 /// \endcode
 /// unaryTransformType()
 ///   matches "__underlying_type(T)"
-AST_TYPE_MATCHER(UnaryTransformType, unaryTransformType);
+extern const AstTypeMatcher<UnaryTransformType> unaryTransformType;
 
 /// \brief Matches record types (e.g. structs, classes).
 ///
@@ -5223,7 +5185,7 @@ AST_TYPE_MATCHER(UnaryTransformType, una
 ///
 /// \c recordType() matches the type of the variable declarations of both \c c
 /// and \c s.
-AST_TYPE_MATCHER(RecordType, recordType);
+extern const AstTypeMatcher<RecordType> recordType;
 
 /// \brief Matches tag types (record and enum types).
 ///
@@ -5238,7 +5200,7 @@ AST_TYPE_MATCHER(RecordType, recordType)
 ///
 /// \c tagType() matches the type of the variable declarations of both \c e
 /// and \c c.
-AST_TYPE_MATCHER(TagType, tagType);
+extern const AstTypeMatcher<TagType> tagType;
 
 /// \brief Matches types specified with an elaborated type keyword or with a
 /// qualified name.
@@ -5258,7 +5220,7 @@ AST_TYPE_MATCHER(TagType, tagType);
 ///
 /// \c elaboratedType() matches the type of the variable declarations of both
 /// \c c and \c d.
-AST_TYPE_MATCHER(ElaboratedType, elaboratedType);
+extern const AstTypeMatcher<ElaboratedType> elaboratedType;
 
 /// \brief Matches ElaboratedTypes whose qualifier, a NestedNameSpecifier,
 /// matches \c InnerMatcher if the qualifier exists.
@@ -5315,7 +5277,8 @@ AST_MATCHER_P(ElaboratedType, namesType,
 /// \endcode
 ///
 /// \c substTemplateTypeParmType() matches the type of 't' but not '1'
-AST_TYPE_MATCHER(SubstTemplateTypeParmType, substTemplateTypeParmType);
+extern const AstTypeMatcher<SubstTemplateTypeParmType>
+    substTemplateTypeParmType;
 
 /// \brief Matches template type parameter substitutions that have a replacement
 /// type that matches the provided matcher.
@@ -5340,7 +5303,7 @@ AST_TYPE_TRAVERSE_MATCHER(
 /// \code
 ///   template <typename T> void f(int i);
 /// \endcode
-AST_TYPE_MATCHER(TemplateTypeParmType, templateTypeParmType);
+extern const AstTypeMatcher<TemplateTypeParmType> templateTypeParmType;
 
 /// \brief Matches injected class name types.
 ///
@@ -5352,7 +5315,7 @@ AST_TYPE_MATCHER(TemplateTypeParmType, t
 ///     void g(S<T> s);
 ///   };
 /// \endcode
-AST_TYPE_MATCHER(InjectedClassNameType, injectedClassNameType);
+extern const AstTypeMatcher<InjectedClassNameType> injectedClassNameType;
 
 /// \brief Matches decayed type
 /// Example matches i[] in declaration of f.
@@ -5364,7 +5327,7 @@ AST_TYPE_MATCHER(InjectedClassNameType,
 ///     i[1] = 0;
 ///   }
 /// \endcode
-AST_TYPE_MATCHER(DecayedType, decayedType);
+extern const AstTypeMatcher<DecayedType> decayedType;
 
 /// \brief Matches the decayed type, whos decayed type matches \c InnerMatcher
 AST_MATCHER_P(DecayedType, hasDecayedType, internal::Matcher<QualType>,
@@ -5405,11 +5368,12 @@ AST_MATCHER_P(Decl, hasDeclContext, inte
 /// \endcode
 /// nestedNameSpecifier()
 ///   matches "ns::" and both "A::"
-const internal::VariadicAllOfMatcher<NestedNameSpecifier> nestedNameSpecifier;
+extern const internal::VariadicAllOfMatcher<NestedNameSpecifier>
+    nestedNameSpecifier;
 
 /// \brief Same as \c nestedNameSpecifier but matches \c NestedNameSpecifierLoc.
-const internal::VariadicAllOfMatcher<
-  NestedNameSpecifierLoc> nestedNameSpecifierLoc;
+extern const internal::VariadicAllOfMatcher<NestedNameSpecifierLoc>
+    nestedNameSpecifierLoc;
 
 /// \brief Matches \c NestedNameSpecifierLocs for which the given inner
 /// NestedNameSpecifier-matcher matches.
@@ -5768,9 +5732,8 @@ AST_MATCHER_P(ReturnStmt, hasReturnValue
 /// \code
 ///   kernel<<<i,j>>>();
 /// \endcode
-const internal::VariadicDynCastAllOfMatcher<
-  Stmt,
-  CUDAKernelCallExpr> cudaKernelCallExpr;
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, CUDAKernelCallExpr>
+    cudaKernelCallExpr;
 
 /// \brief Matches expressions that resolve to a null pointer constant, such as
 /// GNU's __null, C++11's nullptr, or C's NULL macro.

Modified: cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp?rev=318304&r1=318303&r2=318304&view=diff
==============================================================================
--- cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp (original)
+++ cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp Wed Nov 15 08:52:12 2017
@@ -526,5 +526,273 @@ bool HasNameMatcher::matchesNode(const N
 }
 
 } // end namespace internal
+
+const internal::VariadicDynCastAllOfMatcher<Decl, TranslationUnitDecl>
+    translationUnitDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, TypedefDecl> typedefDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, TypedefNameDecl>
+    typedefNameDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, TypeAliasDecl> typeAliasDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, TypeAliasTemplateDecl>
+    typeAliasTemplateDecl;
+const internal::VariadicAllOfMatcher<Decl> decl;
+const internal::VariadicDynCastAllOfMatcher<Decl, LinkageSpecDecl>
+    linkageSpecDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, NamedDecl> namedDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, LabelDecl> labelDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceDecl> namespaceDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceAliasDecl>
+    namespaceAliasDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, RecordDecl> recordDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, CXXRecordDecl> cxxRecordDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, ClassTemplateDecl>
+    classTemplateDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl,
+                                            ClassTemplateSpecializationDecl>
+    classTemplateSpecializationDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, DeclaratorDecl>
+    declaratorDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, ParmVarDecl> parmVarDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, AccessSpecDecl>
+    accessSpecDecl;
+const internal::VariadicAllOfMatcher<CXXCtorInitializer> cxxCtorInitializer;
+const internal::VariadicAllOfMatcher<TemplateArgument> templateArgument;
+const internal::VariadicAllOfMatcher<TemplateName> templateName;
+const internal::VariadicDynCastAllOfMatcher<Decl, NonTypeTemplateParmDecl>
+    nonTypeTemplateParmDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, TemplateTypeParmDecl>
+    templateTypeParmDecl;
+const internal::VariadicAllOfMatcher<QualType> qualType;
+const internal::VariadicAllOfMatcher<Type> type;
+const internal::VariadicAllOfMatcher<TypeLoc> typeLoc;
+const internal::VariadicDynCastAllOfMatcher<Stmt, UnaryExprOrTypeTraitExpr>
+    unaryExprOrTypeTraitExpr;
+const internal::VariadicDynCastAllOfMatcher<Decl, ValueDecl> valueDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, CXXConstructorDecl>
+    cxxConstructorDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, CXXDestructorDecl>
+    cxxDestructorDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, EnumDecl> enumDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, EnumConstantDecl>
+    enumConstantDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, CXXMethodDecl> cxxMethodDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, CXXConversionDecl>
+    cxxConversionDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, VarDecl> varDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, FieldDecl> fieldDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, FunctionDecl> functionDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, FunctionTemplateDecl>
+    functionTemplateDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, FriendDecl> friendDecl;
+const internal::VariadicAllOfMatcher<Stmt> stmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, DeclStmt> declStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, MemberExpr> memberExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CallExpr> callExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, LambdaExpr> lambdaExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXMemberCallExpr>
+    cxxMemberCallExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCMessageExpr>
+    objcMessageExpr;
+const internal::VariadicDynCastAllOfMatcher<Decl, ObjCInterfaceDecl>
+    objcInterfaceDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, ObjCImplementationDecl>
+    objcImplementationDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, ObjCProtocolDecl>
+    objcProtocolDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, ObjCCategoryDecl>
+    objcCategoryDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, ObjCCategoryImplDecl>
+    objcCategoryImplDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, ObjCMethodDecl>
+    objcMethodDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, ObjCIvarDecl> objcIvarDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, ObjCPropertyDecl>
+    objcPropertyDecl;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtThrowStmt>
+    objcThrowStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtTryStmt> objcTryStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtCatchStmt>
+    objcCatchStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtFinallyStmt>
+    objcFinallyStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ExprWithCleanups>
+    exprWithCleanups;
+const internal::VariadicDynCastAllOfMatcher<Stmt, InitListExpr> initListExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXStdInitializerListExpr>
+    cxxStdInitializerListExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ImplicitValueInitExpr>
+    implicitValueInitExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ParenListExpr> parenListExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, SubstNonTypeTemplateParmExpr>
+    substNonTypeTemplateParmExpr;
+const internal::VariadicDynCastAllOfMatcher<Decl, UsingDecl> usingDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, UsingDirectiveDecl>
+    usingDirectiveDecl;
+const internal::VariadicDynCastAllOfMatcher<Stmt, UnresolvedLookupExpr>
+    unresolvedLookupExpr;
+const internal::VariadicDynCastAllOfMatcher<Decl, UnresolvedUsingValueDecl>
+    unresolvedUsingValueDecl;
+const internal::VariadicDynCastAllOfMatcher<Decl, UnresolvedUsingTypenameDecl>
+    unresolvedUsingTypenameDecl;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ParenExpr> parenExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXConstructExpr>
+    cxxConstructExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXUnresolvedConstructExpr>
+    cxxUnresolvedConstructExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThisExpr> cxxThisExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXBindTemporaryExpr>
+    cxxBindTemporaryExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, MaterializeTemporaryExpr>
+    materializeTemporaryExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNewExpr> cxxNewExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDeleteExpr> cxxDeleteExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ArraySubscriptExpr>
+    arraySubscriptExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDefaultArgExpr>
+    cxxDefaultArgExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXOperatorCallExpr>
+    cxxOperatorCallExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, Expr> expr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, DeclRefExpr> declRefExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, IfStmt> ifStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ForStmt> forStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXForRangeStmt>
+    cxxForRangeStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, WhileStmt> whileStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, DoStmt> doStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, BreakStmt> breakStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ContinueStmt> continueStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ReturnStmt> returnStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, GotoStmt> gotoStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, LabelStmt> labelStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, AddrLabelExpr> addrLabelExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchStmt> switchStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchCase> switchCase;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CaseStmt> caseStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, DefaultStmt> defaultStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundStmt> compoundStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXCatchStmt> cxxCatchStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTryStmt> cxxTryStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThrowExpr> cxxThrowExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, NullStmt> nullStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, AsmStmt> asmStmt;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXBoolLiteralExpr>
+    cxxBoolLiteral;
+const internal::VariadicDynCastAllOfMatcher<Stmt, StringLiteral> stringLiteral;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CharacterLiteral>
+    characterLiteral;
+const internal::VariadicDynCastAllOfMatcher<Stmt, IntegerLiteral>
+    integerLiteral;
+const internal::VariadicDynCastAllOfMatcher<Stmt, FloatingLiteral> floatLiteral;
+const internal::VariadicDynCastAllOfMatcher<Stmt, UserDefinedLiteral>
+    userDefinedLiteral;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundLiteralExpr>
+    compoundLiteralExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNullPtrLiteralExpr>
+    cxxNullPtrLiteralExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, GNUNullExpr> gnuNullExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, AtomicExpr> atomicExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, StmtExpr> stmtExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, BinaryOperator>
+    binaryOperator;
+const internal::VariadicDynCastAllOfMatcher<Stmt, UnaryOperator> unaryOperator;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ConditionalOperator>
+    conditionalOperator;
+const internal::VariadicDynCastAllOfMatcher<Stmt, BinaryConditionalOperator>
+    binaryConditionalOperator;
+const internal::VariadicDynCastAllOfMatcher<Stmt, OpaqueValueExpr>
+    opaqueValueExpr;
+const internal::VariadicDynCastAllOfMatcher<Decl, StaticAssertDecl>
+    staticAssertDecl;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXReinterpretCastExpr>
+    cxxReinterpretCastExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXStaticCastExpr>
+    cxxStaticCastExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDynamicCastExpr>
+    cxxDynamicCastExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXConstCastExpr>
+    cxxConstCastExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CStyleCastExpr>
+    cStyleCastExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ExplicitCastExpr>
+    explicitCastExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, ImplicitCastExpr>
+    implicitCastExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CastExpr> castExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXFunctionalCastExpr>
+    cxxFunctionalCastExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTemporaryObjectExpr>
+    cxxTemporaryObjectExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, PredefinedExpr>
+    predefinedExpr;
+const internal::VariadicDynCastAllOfMatcher<Stmt, DesignatedInitExpr>
+    designatedInitExpr;
+const internal::VariadicOperatorMatcherFunc<
+    2, std::numeric_limits<unsigned>::max()>
+    eachOf = {internal::DynTypedMatcher::VO_EachOf};
+const internal::VariadicOperatorMatcherFunc<
+    2, std::numeric_limits<unsigned>::max()>
+    anyOf = {internal::DynTypedMatcher::VO_AnyOf};
+const internal::VariadicOperatorMatcherFunc<
+    2, std::numeric_limits<unsigned>::max()>
+    allOf = {internal::DynTypedMatcher::VO_AllOf};
+const internal::VariadicFunction<internal::Matcher<NamedDecl>, StringRef,
+                                 internal::hasAnyNameFunc>
+    hasAnyName = {};
+const internal::ArgumentAdaptingMatcherFunc<internal::HasMatcher> has = {};
+const internal::ArgumentAdaptingMatcherFunc<internal::HasDescendantMatcher>
+    hasDescendant = {};
+const internal::ArgumentAdaptingMatcherFunc<internal::ForEachMatcher> forEach =
+    {};
+const internal::ArgumentAdaptingMatcherFunc<internal::ForEachDescendantMatcher>
+    forEachDescendant = {};
+const internal::ArgumentAdaptingMatcherFunc<
+    internal::HasParentMatcher,
+    internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
+    internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
+    hasParent = {};
+const internal::ArgumentAdaptingMatcherFunc<
+    internal::HasAncestorMatcher,
+    internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
+    internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
+    hasAncestor = {};
+const internal::VariadicOperatorMatcherFunc<1, 1> unless = {
+    internal::DynTypedMatcher::VO_UnaryNot};
+const internal::VariadicAllOfMatcher<NestedNameSpecifier> nestedNameSpecifier;
+const internal::VariadicAllOfMatcher<NestedNameSpecifierLoc>
+    nestedNameSpecifierLoc;
+const internal::VariadicDynCastAllOfMatcher<Stmt, CUDAKernelCallExpr>
+    cudaKernelCallExpr;
+const AstTypeMatcher<BuiltinType> builtinType;
+const AstTypeMatcher<ArrayType> arrayType;
+const AstTypeMatcher<ComplexType> complexType;
+const AstTypeMatcher<ConstantArrayType> constantArrayType;
+const AstTypeMatcher<DependentSizedArrayType> dependentSizedArrayType;
+const AstTypeMatcher<IncompleteArrayType> incompleteArrayType;
+const AstTypeMatcher<VariableArrayType> variableArrayType;
+const AstTypeMatcher<AtomicType> atomicType;
+const AstTypeMatcher<AutoType> autoType;
+const AstTypeMatcher<FunctionType> functionType;
+const AstTypeMatcher<FunctionProtoType> functionProtoType;
+const AstTypeMatcher<ParenType> parenType;
+const AstTypeMatcher<BlockPointerType> blockPointerType;
+const AstTypeMatcher<MemberPointerType> memberPointerType;
+const AstTypeMatcher<PointerType> pointerType;
+const AstTypeMatcher<ObjCObjectPointerType> objcObjectPointerType;
+const AstTypeMatcher<ReferenceType> referenceType;
+const AstTypeMatcher<LValueReferenceType> lValueReferenceType;
+const AstTypeMatcher<RValueReferenceType> rValueReferenceType;
+const AstTypeMatcher<TypedefType> typedefType;
+const AstTypeMatcher<EnumType> enumType;
+const AstTypeMatcher<TemplateSpecializationType> templateSpecializationType;
+const AstTypeMatcher<UnaryTransformType> unaryTransformType;
+const AstTypeMatcher<RecordType> recordType;
+const AstTypeMatcher<TagType> tagType;
+const AstTypeMatcher<ElaboratedType> elaboratedType;
+const AstTypeMatcher<SubstTemplateTypeParmType> substTemplateTypeParmType;
+const AstTypeMatcher<TemplateTypeParmType> templateTypeParmType;
+const AstTypeMatcher<InjectedClassNameType> injectedClassNameType;
+const AstTypeMatcher<DecayedType> decayedType;
+
 } // end namespace ast_matchers
 } // end namespace clang




More information about the cfe-commits mailing list