clang  16.0.0git
Registry.cpp
Go to the documentation of this file.
1 //===- Registry.cpp - Matcher registry ------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 /// Registry map populated at static initialization time.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 #include "Marshallers.h"
20 #include "llvm/ADT/Optional.h"
21 #include "llvm/ADT/STLExtras.h"
22 #include "llvm/ADT/StringMap.h"
23 #include "llvm/ADT/StringRef.h"
24 #include "llvm/Support/ManagedStatic.h"
25 #include "llvm/Support/raw_ostream.h"
26 #include <cassert>
27 #include <iterator>
28 #include <memory>
29 #include <set>
30 #include <string>
31 #include <utility>
32 #include <vector>
33 
34 namespace clang {
35 namespace ast_matchers {
36 namespace dynamic {
37 
38 namespace {
39 
40 using internal::MatcherDescriptor;
41 
42 using ConstructorMap =
43  llvm::StringMap<std::unique_ptr<const MatcherDescriptor>>;
44 
45 class RegistryMaps {
46 public:
47  RegistryMaps();
48  ~RegistryMaps();
49 
50  const ConstructorMap &constructors() const { return Constructors; }
51 
52 private:
53  void registerMatcher(StringRef MatcherName,
54  std::unique_ptr<MatcherDescriptor> Callback);
55 
56  ConstructorMap Constructors;
57 };
58 
59 } // namespace
60 
61 void RegistryMaps::registerMatcher(
62  StringRef MatcherName, std::unique_ptr<MatcherDescriptor> Callback) {
63  assert(Constructors.find(MatcherName) == Constructors.end());
64  Constructors[MatcherName] = std::move(Callback);
65 }
66 
67 #define REGISTER_MATCHER(name) \
68  registerMatcher(#name, internal::makeMatcherAutoMarshall( \
69  ::clang::ast_matchers::name, #name));
70 
71 #define REGISTER_MATCHER_OVERLOAD(name) \
72  registerMatcher(#name, \
73  std::make_unique<internal::OverloadedMatcherDescriptor>(name##Callbacks))
74 
75 #define SPECIFIC_MATCHER_OVERLOAD(name, Id) \
76  static_cast<::clang::ast_matchers::name##_Type##Id>( \
77  ::clang::ast_matchers::name)
78 
79 #define MATCHER_OVERLOAD_ENTRY(name, Id) \
80  internal::makeMatcherAutoMarshall(SPECIFIC_MATCHER_OVERLOAD(name, Id), \
81  #name)
82 
83 #define REGISTER_OVERLOADED_2(name) \
84  do { \
85  std::unique_ptr<MatcherDescriptor> name##Callbacks[] = { \
86  MATCHER_OVERLOAD_ENTRY(name, 0), \
87  MATCHER_OVERLOAD_ENTRY(name, 1)}; \
88  REGISTER_MATCHER_OVERLOAD(name); \
89  } while (false)
90 
91 #define REGISTER_REGEX_MATCHER(name) \
92  registerMatcher(#name, internal::makeMatcherRegexMarshall(name, name))
93 
94 /// Generate a registry map with all the known matchers.
95 /// Please keep sorted alphabetically!
96 RegistryMaps::RegistryMaps() {
97  // TODO: Here is the list of the missing matchers, grouped by reason.
98  //
99  // Polymorphic + argument overload:
100  // findAll
101  //
102  // Other:
103  // equalsNode
104 
105  registerMatcher("mapAnyOf",
106  std::make_unique<internal::MapAnyOfBuilderDescriptor>());
107 
108  REGISTER_OVERLOADED_2(callee);
109  REGISTER_OVERLOADED_2(hasPrefix);
110  REGISTER_OVERLOADED_2(hasType);
111  REGISTER_OVERLOADED_2(ignoringParens);
112  REGISTER_OVERLOADED_2(isDerivedFrom);
113  REGISTER_OVERLOADED_2(isDirectlyDerivedFrom);
114  REGISTER_OVERLOADED_2(isSameOrDerivedFrom);
116  REGISTER_OVERLOADED_2(pointsTo);
117  REGISTER_OVERLOADED_2(references);
118  REGISTER_OVERLOADED_2(thisPointerType);
119 
120  std::unique_ptr<MatcherDescriptor> equalsCallbacks[] = {
124  };
126 
127  REGISTER_REGEX_MATCHER(isExpansionInFileMatching);
128  REGISTER_REGEX_MATCHER(matchesName);
129  REGISTER_REGEX_MATCHER(matchesSelector);
130 
137  REGISTER_MATCHER(argumentCountIs);
140  REGISTER_MATCHER(asString);
154  REGISTER_MATCHER(booleanType);
159  REGISTER_MATCHER(capturesThis);
160  REGISTER_MATCHER(capturesVar);
175  REGISTER_MATCHER(containsDeclaration);
216  REGISTER_MATCHER(declCountIs);
226  REGISTER_MATCHER(designatorCountIs);
235  REGISTER_MATCHER(equalsBoundNode);
236  REGISTER_MATCHER(equalsIntegralValue);
243  REGISTER_MATCHER(forCallable);
244  REGISTER_MATCHER(forDecomposition);
246  REGISTER_MATCHER(forEachArgumentWithParam);
247  REGISTER_MATCHER(forEachArgumentWithParamType);
248  REGISTER_MATCHER(forEachConstructorInitializer);
250  REGISTER_MATCHER(forEachLambdaCapture);
251  REGISTER_MATCHER(forEachOverridden);
252  REGISTER_MATCHER(forEachSwitchCase);
253  REGISTER_MATCHER(forEachTemplateArgument);
254  REGISTER_MATCHER(forField);
255  REGISTER_MATCHER(forFunction);
267  REGISTER_MATCHER(hasAnyArgument);
268  REGISTER_MATCHER(hasAnyBase);
269  REGISTER_MATCHER(hasAnyBinding);
270  REGISTER_MATCHER(hasAnyBody);
271  REGISTER_MATCHER(hasAnyCapture);
272  REGISTER_MATCHER(hasAnyClause);
273  REGISTER_MATCHER(hasAnyConstructorInitializer);
274  REGISTER_MATCHER(hasAnyDeclaration);
278  REGISTER_MATCHER(hasAnyParameter);
279  REGISTER_MATCHER(hasAnyPlacementArg);
281  REGISTER_MATCHER(hasAnySubstatement);
282  REGISTER_MATCHER(hasAnyTemplateArgument);
283  REGISTER_MATCHER(hasAnyTemplateArgumentLoc);
284  REGISTER_MATCHER(hasAnyUsingShadowDecl);
285  REGISTER_MATCHER(hasArgument);
286  REGISTER_MATCHER(hasArgumentOfType);
287  REGISTER_MATCHER(hasArraySize);
289  REGISTER_MATCHER(hasAutomaticStorageDuration);
290  REGISTER_MATCHER(hasBase);
291  REGISTER_MATCHER(hasBinding);
292  REGISTER_MATCHER(hasBitWidth);
293  REGISTER_MATCHER(hasBody);
294  REGISTER_MATCHER(hasCanonicalType);
295  REGISTER_MATCHER(hasCaseConstant);
296  REGISTER_MATCHER(hasCastKind);
297  REGISTER_MATCHER(hasCondition);
298  REGISTER_MATCHER(hasConditionVariableStatement);
299  REGISTER_MATCHER(hasDecayedType);
300  REGISTER_MATCHER(hasDeclContext);
302  REGISTER_MATCHER(hasDeducedType);
303  REGISTER_MATCHER(hasDefaultArgument);
306  REGISTER_MATCHER(hasDestinationType);
307  REGISTER_MATCHER(hasDirectBase);
308  REGISTER_MATCHER(hasDynamicExceptionSpec);
309  REGISTER_MATCHER(hasEitherOperand);
310  REGISTER_MATCHER(hasElementType);
311  REGISTER_MATCHER(hasElse);
312  REGISTER_MATCHER(hasExplicitSpecifier);
313  REGISTER_MATCHER(hasExternalFormalLinkage);
314  REGISTER_MATCHER(hasFalseExpression);
315  REGISTER_MATCHER(hasGlobalStorage);
316  REGISTER_MATCHER(hasImplicitDestinationType);
317  REGISTER_MATCHER(hasInClassInitializer);
318  REGISTER_MATCHER(hasIncrement);
319  REGISTER_MATCHER(hasIndex);
320  REGISTER_MATCHER(hasInit);
321  REGISTER_MATCHER(hasInitializer);
322  REGISTER_MATCHER(hasInitStatement);
323  REGISTER_MATCHER(hasKeywordSelector);
324  REGISTER_MATCHER(hasLHS);
325  REGISTER_MATCHER(hasLocalQualifiers);
326  REGISTER_MATCHER(hasLocalStorage);
327  REGISTER_MATCHER(hasLoopInit);
328  REGISTER_MATCHER(hasLoopVariable);
329  REGISTER_MATCHER(hasMemberName);
330  REGISTER_MATCHER(hasMethod);
332  REGISTER_MATCHER(hasNamedTypeLoc);
333  REGISTER_MATCHER(hasNullSelector);
334  REGISTER_MATCHER(hasObjectExpression);
335  REGISTER_MATCHER(hasOperands);
336  REGISTER_MATCHER(hasOperatorName);
338  REGISTER_MATCHER(hasParameter);
340  REGISTER_MATCHER(hasPointeeLoc);
341  REGISTER_MATCHER(hasQualifier);
342  REGISTER_MATCHER(hasRHS);
343  REGISTER_MATCHER(hasRangeInit);
344  REGISTER_MATCHER(hasReceiver);
345  REGISTER_MATCHER(hasReceiverType);
346  REGISTER_MATCHER(hasReferentLoc);
347  REGISTER_MATCHER(hasReplacementType);
348  REGISTER_MATCHER(hasReturnTypeLoc);
349  REGISTER_MATCHER(hasReturnValue);
350  REGISTER_MATCHER(hasPlacementArg);
351  REGISTER_MATCHER(hasSelector);
352  REGISTER_MATCHER(hasSingleDecl);
353  REGISTER_MATCHER(hasSize);
354  REGISTER_MATCHER(hasSizeExpr);
355  REGISTER_MATCHER(hasSourceExpression);
356  REGISTER_MATCHER(hasSpecializedTemplate);
357  REGISTER_MATCHER(hasStaticStorageDuration);
358  REGISTER_MATCHER(hasStructuredBlock);
359  REGISTER_MATCHER(hasSyntacticForm);
360  REGISTER_MATCHER(hasTargetDecl);
361  REGISTER_MATCHER(hasTemplateArgument);
362  REGISTER_MATCHER(hasTemplateArgumentLoc);
363  REGISTER_MATCHER(hasThen);
364  REGISTER_MATCHER(hasThreadStorageDuration);
365  REGISTER_MATCHER(hasTrailingReturn);
366  REGISTER_MATCHER(hasTrueExpression);
367  REGISTER_MATCHER(hasTypeLoc);
368  REGISTER_MATCHER(hasUnaryOperand);
369  REGISTER_MATCHER(hasUnarySelector);
370  REGISTER_MATCHER(hasUnderlyingDecl);
371  REGISTER_MATCHER(hasUnderlyingType);
372  REGISTER_MATCHER(hasUnqualifiedDesugaredType);
373  REGISTER_MATCHER(hasUnqualifiedLoc);
374  REGISTER_MATCHER(hasValueType);
376  REGISTER_MATCHER(ignoringElidableConstructorCall);
377  REGISTER_MATCHER(ignoringImpCasts);
378  REGISTER_MATCHER(ignoringImplicit);
379  REGISTER_MATCHER(ignoringParenCasts);
380  REGISTER_MATCHER(ignoringParenImpCasts);
388  REGISTER_MATCHER(innerType);
391  REGISTER_MATCHER(isAllowedToContainClauseKind);
392  REGISTER_MATCHER(isAnonymous);
393  REGISTER_MATCHER(isAnyCharacter);
394  REGISTER_MATCHER(isAnyPointer);
395  REGISTER_MATCHER(isArray);
396  REGISTER_MATCHER(isArrow);
397  REGISTER_MATCHER(isAssignmentOperator);
398  REGISTER_MATCHER(isAtPosition);
399  REGISTER_MATCHER(isBaseInitializer);
400  REGISTER_MATCHER(isBitField);
401  REGISTER_MATCHER(isCatchAll);
402  REGISTER_MATCHER(isClass);
403  REGISTER_MATCHER(isClassMessage);
404  REGISTER_MATCHER(isClassMethod);
406  REGISTER_MATCHER(isConst);
407  REGISTER_MATCHER(isConstQualified);
408  REGISTER_MATCHER(isConsteval);
409  REGISTER_MATCHER(isConstexpr);
410  REGISTER_MATCHER(isConstinit);
411  REGISTER_MATCHER(isCopyAssignmentOperator);
412  REGISTER_MATCHER(isCopyConstructor);
413  REGISTER_MATCHER(isDefaultConstructor);
414  REGISTER_MATCHER(isDefaulted);
415  REGISTER_MATCHER(isDefinition);
416  REGISTER_MATCHER(isDelegatingConstructor);
417  REGISTER_MATCHER(isDeleted);
418  REGISTER_MATCHER(isEnum);
419  REGISTER_MATCHER(isExceptionVariable);
420  REGISTER_MATCHER(isExpandedFromMacro);
421  REGISTER_MATCHER(isExpansionInMainFile);
422  REGISTER_MATCHER(isExpansionInSystemHeader);
423  REGISTER_MATCHER(isExplicit);
424  REGISTER_MATCHER(isExplicitTemplateSpecialization);
425  REGISTER_MATCHER(isExpr);
427  REGISTER_MATCHER(isFinal);
428  REGISTER_MATCHER(isPrivateKind);
429  REGISTER_MATCHER(isFirstPrivateKind);
430  REGISTER_MATCHER(isImplicit);
431  REGISTER_MATCHER(isInStdNamespace);
432  REGISTER_MATCHER(isInTemplateInstantiation);
433  REGISTER_MATCHER(isInitCapture);
434  REGISTER_MATCHER(isInline);
435  REGISTER_MATCHER(isInstanceMessage);
437  REGISTER_MATCHER(isInstantiated);
438  REGISTER_MATCHER(isInstantiationDependent);
439  REGISTER_MATCHER(isInteger);
440  REGISTER_MATCHER(isIntegral);
441  REGISTER_MATCHER(isLambda);
442  REGISTER_MATCHER(isListInitialization);
443  REGISTER_MATCHER(isMain);
444  REGISTER_MATCHER(isMemberInitializer);
445  REGISTER_MATCHER(isMoveAssignmentOperator);
446  REGISTER_MATCHER(isMoveConstructor);
447  REGISTER_MATCHER(isNoReturn);
448  REGISTER_MATCHER(isNoThrow);
449  REGISTER_MATCHER(isNoneKind);
450  REGISTER_MATCHER(isOverride);
451  REGISTER_MATCHER(isPrivate);
452  REGISTER_MATCHER(isProtected);
453  REGISTER_MATCHER(isPublic);
454  REGISTER_MATCHER(isPure);
455  REGISTER_MATCHER(isScoped);
456  REGISTER_MATCHER(isSharedKind);
457  REGISTER_MATCHER(isSignedInteger);
458  REGISTER_MATCHER(isStandaloneDirective);
459  REGISTER_MATCHER(isStaticLocal);
460  REGISTER_MATCHER(isStaticStorageClass);
461  REGISTER_MATCHER(isStruct);
463  REGISTER_MATCHER(isTypeDependent);
464  REGISTER_MATCHER(isUnion);
465  REGISTER_MATCHER(isUnsignedInteger);
466  REGISTER_MATCHER(isUserProvided);
467  REGISTER_MATCHER(isValueDependent);
468  REGISTER_MATCHER(isVariadic);
469  REGISTER_MATCHER(isVirtual);
470  REGISTER_MATCHER(isVirtualAsWritten);
471  REGISTER_MATCHER(isVolatileQualified);
472  REGISTER_MATCHER(isWeak);
473  REGISTER_MATCHER(isWritten);
483  REGISTER_MATCHER(memberHasSameNameAsBoundNode);
486  REGISTER_MATCHER(namesType);
492  REGISTER_MATCHER(nullPointerConstant);
494  REGISTER_MATCHER(numSelectorArgs);
511  REGISTER_MATCHER(ofClass);
512  REGISTER_MATCHER(ofKind);
515  REGISTER_MATCHER(on);
516  REGISTER_MATCHER(onImplicitObjectArgument);
519  REGISTER_MATCHER(parameterCountIs);
524  REGISTER_MATCHER(pointee);
531  REGISTER_MATCHER(realFloatingPointType);
536  REGISTER_MATCHER(refersToDeclaration);
537  REGISTER_MATCHER(refersToIntegralType);
538  REGISTER_MATCHER(refersToTemplate);
539  REGISTER_MATCHER(refersToType);
540  REGISTER_MATCHER(requiresZeroInitialization);
542  REGISTER_MATCHER(returns);
544  REGISTER_MATCHER(specifiesNamespace);
545  REGISTER_MATCHER(specifiesType);
546  REGISTER_MATCHER(specifiesTypeLoc);
547  REGISTER_MATCHER(statementCountIs);
559  REGISTER_MATCHER(templateArgumentCountIs);
567  REGISTER_MATCHER(throughUsingDecl);
568  REGISTER_MATCHER(to);
586  REGISTER_MATCHER(usesADL);
593  REGISTER_MATCHER(voidType);
595  REGISTER_MATCHER(withInitializer);
596 }
597 
598 RegistryMaps::~RegistryMaps() = default;
599 
600 static llvm::ManagedStatic<RegistryMaps> RegistryData;
601 
603  return Ctor->nodeMatcherType();
604 }
605 
607  : Ptr(Ptr) {}
608 
610 
612  return Ctor->isBuilderMatcher();
613 }
614 
617  ArrayRef<ParserValue> Args, Diagnostics *Error) {
619  Ctor->buildMatcherCtor(NameRange, Args, Error).release());
620 }
621 
622 // static
624  auto it = RegistryData->constructors().find(MatcherName);
625  return it == RegistryData->constructors().end()
627  : it->second.get();
628 }
629 
630 static llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
631  const std::set<ASTNodeKind> &KS) {
632  unsigned Count = 0;
633  for (std::set<ASTNodeKind>::const_iterator I = KS.begin(), E = KS.end();
634  I != E; ++I) {
635  if (I != KS.begin())
636  OS << "|";
637  if (Count++ == 3) {
638  OS << "...";
639  break;
640  }
641  OS << *I;
642  }
643  return OS;
644 }
645 
647  ArrayRef<std::pair<MatcherCtor, unsigned>> Context) {
648  ASTNodeKind InitialTypes[] = {
649  ASTNodeKind::getFromNodeKind<Decl>(),
650  ASTNodeKind::getFromNodeKind<QualType>(),
651  ASTNodeKind::getFromNodeKind<Type>(),
652  ASTNodeKind::getFromNodeKind<Stmt>(),
653  ASTNodeKind::getFromNodeKind<NestedNameSpecifier>(),
654  ASTNodeKind::getFromNodeKind<NestedNameSpecifierLoc>(),
655  ASTNodeKind::getFromNodeKind<TypeLoc>()};
656 
657  // Starting with the above seed of acceptable top-level matcher types, compute
658  // the acceptable type set for the argument indicated by each context element.
659  std::set<ArgKind> TypeSet;
660  for (auto IT : InitialTypes) {
661  TypeSet.insert(ArgKind::MakeMatcherArg(IT));
662  }
663  for (const auto &CtxEntry : Context) {
664  MatcherCtor Ctor = CtxEntry.first;
665  unsigned ArgNumber = CtxEntry.second;
666  std::vector<ArgKind> NextTypeSet;
667  for (const ArgKind &Kind : TypeSet) {
668  if (Kind.getArgKind() == Kind.AK_Matcher &&
669  Ctor->isConvertibleTo(Kind.getMatcherKind()) &&
670  (Ctor->isVariadic() || ArgNumber < Ctor->getNumArgs()))
671  Ctor->getArgKinds(Kind.getMatcherKind(), ArgNumber, NextTypeSet);
672  }
673  TypeSet.clear();
674  TypeSet.insert(NextTypeSet.begin(), NextTypeSet.end());
675  }
676  return std::vector<ArgKind>(TypeSet.begin(), TypeSet.end());
677 }
678 
679 std::vector<MatcherCompletion>
681  std::vector<MatcherCompletion> Completions;
682 
683  // Search the registry for acceptable matchers.
684  for (const auto &M : RegistryData->constructors()) {
685  const MatcherDescriptor& Matcher = *M.getValue();
686  StringRef Name = M.getKey();
687 
688  std::set<ASTNodeKind> RetKinds;
689  unsigned NumArgs = Matcher.isVariadic() ? 1 : Matcher.getNumArgs();
690  bool IsPolymorphic = Matcher.isPolymorphic();
691  std::vector<std::vector<ArgKind>> ArgsKinds(NumArgs);
692  unsigned MaxSpecificity = 0;
693  bool NodeArgs = false;
694  for (const ArgKind& Kind : AcceptedTypes) {
695  if (Kind.getArgKind() != Kind.AK_Matcher &&
696  Kind.getArgKind() != Kind.AK_Node) {
697  continue;
698  }
699 
700  if (Kind.getArgKind() == Kind.AK_Node) {
701  NodeArgs = true;
702  unsigned Specificity;
703  ASTNodeKind LeastDerivedKind;
704  if (Matcher.isConvertibleTo(Kind.getNodeKind(), &Specificity,
705  &LeastDerivedKind)) {
706  if (MaxSpecificity < Specificity)
707  MaxSpecificity = Specificity;
708  RetKinds.insert(LeastDerivedKind);
709  for (unsigned Arg = 0; Arg != NumArgs; ++Arg)
710  Matcher.getArgKinds(Kind.getNodeKind(), Arg, ArgsKinds[Arg]);
711  if (IsPolymorphic)
712  break;
713  }
714  } else {
715  unsigned Specificity;
716  ASTNodeKind LeastDerivedKind;
717  if (Matcher.isConvertibleTo(Kind.getMatcherKind(), &Specificity,
718  &LeastDerivedKind)) {
719  if (MaxSpecificity < Specificity)
720  MaxSpecificity = Specificity;
721  RetKinds.insert(LeastDerivedKind);
722  for (unsigned Arg = 0; Arg != NumArgs; ++Arg)
723  Matcher.getArgKinds(Kind.getMatcherKind(), Arg, ArgsKinds[Arg]);
724  if (IsPolymorphic)
725  break;
726  }
727  }
728  }
729 
730  if (!RetKinds.empty() && MaxSpecificity > 0) {
732  llvm::raw_string_ostream OS(Decl);
733 
734  std::string TypedText = std::string(Name);
735 
736  if (NodeArgs) {
737  OS << Name;
738  } else {
739 
740  if (IsPolymorphic) {
741  OS << "Matcher<T> " << Name << "(Matcher<T>";
742  } else {
743  OS << "Matcher<" << RetKinds << "> " << Name << "(";
744  for (const std::vector<ArgKind> &Arg : ArgsKinds) {
745  if (&Arg != &ArgsKinds[0])
746  OS << ", ";
747 
748  bool FirstArgKind = true;
749  std::set<ASTNodeKind> MatcherKinds;
750  // Two steps. First all non-matchers, then matchers only.
751  for (const ArgKind &AK : Arg) {
752  if (AK.getArgKind() == ArgKind::AK_Matcher) {
753  MatcherKinds.insert(AK.getMatcherKind());
754  } else {
755  if (!FirstArgKind)
756  OS << "|";
757  FirstArgKind = false;
758  OS << AK.asString();
759  }
760  }
761  if (!MatcherKinds.empty()) {
762  if (!FirstArgKind) OS << "|";
763  OS << "Matcher<" << MatcherKinds << ">";
764  }
765  }
766  }
767  if (Matcher.isVariadic())
768  OS << "...";
769  OS << ")";
770 
771  TypedText += "(";
772  if (ArgsKinds.empty())
773  TypedText += ")";
774  else if (ArgsKinds[0][0].getArgKind() == ArgKind::AK_String)
775  TypedText += "\"";
776  }
777 
778  Completions.emplace_back(TypedText, OS.str(), MaxSpecificity);
779  }
780  }
781 
782  return Completions;
783 }
784 
786  SourceRange NameRange,
788  Diagnostics *Error) {
789  return Ctor->create(NameRange, Args, Error);
790 }
791 
793  SourceRange NameRange,
794  StringRef BindID,
796  Diagnostics *Error) {
797  VariantMatcher Out = constructMatcher(Ctor, NameRange, Args, Error);
798  if (Out.isNull()) return Out;
799 
800  llvm::Optional<DynTypedMatcher> Result = Out.getSingleMatcher();
801  if (Result) {
802  llvm::Optional<DynTypedMatcher> Bound = Result->tryBind(BindID);
803  if (Bound) {
804  return VariantMatcher::SingleMatcher(*Bound);
805  }
806  }
807  Error->addError(NameRange, Error->ET_RegistryNotBindable);
808  return VariantMatcher();
809 }
810 
811 } // namespace dynamic
812 } // namespace ast_matchers
813 } // namespace clang
clang::ast_matchers::hasParent
const internal::ArgumentAdaptingMatcherFunc< internal::HasParentMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr > > hasParent
Matches AST nodes that have a parent that matches the provided matcher.
Definition: ASTMatchersInternal.cpp:1020
clang::ast_matchers::enumConstantDecl
const internal::VariadicDynCastAllOfMatcher< Decl, EnumConstantDecl > enumConstantDecl
Matches enum constants.
Definition: ASTMatchersInternal.cpp:797
clang::ast_matchers::decompositionDecl
const internal::VariadicDynCastAllOfMatcher< Decl, DecompositionDecl > decompositionDecl
Matches decomposition-declarations.
Definition: ASTMatchersInternal.cpp:735
clang::ast_matchers::substTemplateTypeParmType
const AstTypeMatcher< SubstTemplateTypeParmType > substTemplateTypeParmType
Matches types that represent the result of substituting a type for a template type parameter.
Definition: ASTMatchersInternal.cpp:1064
clang::ast_matchers::stmtExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, StmtExpr > stmtExpr
Matches statement expression (GNU extension).
Definition: ASTMatchersInternal.cpp:946
isInstanceMethod
static bool isInstanceMethod(const Decl *D)
Definition: SemaDeclAttr.cpp:154
clang::ast_matchers::dynamic::internal::MatcherDescriptor::isBuilderMatcher
virtual bool isBuilderMatcher() const
Definition: Marshallers.h:314
clang::ast_matchers::invocation
const internal::MapAnyOfMatcher< CallExpr, CXXConstructExpr > invocation
Matches function calls and constructor calls.
Definition: ASTMatchersInternal.cpp:952
hasAttr
static bool hasAttr(const FunctionDecl *D, bool IgnoreImplicitAttr)
Definition: SemaCUDA.cpp:108
clang::ast_matchers::templateTemplateParmDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TemplateTemplateParmDecl > templateTemplateParmDecl
Matches template template parameter declarations.
Definition: ASTMatchersInternal.cpp:769
clang::ast_matchers::switchCase
const internal::VariadicDynCastAllOfMatcher< Stmt, SwitchCase > switchCase
Matches case and default statements inside switch statements.
Definition: ASTMatchersInternal.cpp:908
clang::ast_matchers::hasAnyName
const internal::VariadicFunction< internal::Matcher< NamedDecl >, StringRef, internal::hasAnyNameFunc > hasAnyName
Matches NamedDecl nodes that have any of the specified names.
Definition: ASTMatchersInternal.cpp:998
clang::ast_matchers::imaginaryLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, ImaginaryLiteral > imaginaryLiteral
Matches imaginary literals, which are based on integer and floating point literals e....
Definition: ASTMatchersInternal.cpp:926
clang::ast_matchers::userDefinedLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, UserDefinedLiteral > userDefinedLiteral
Matches user defined literal operator call.
Definition: ASTMatchersInternal.cpp:930
clang::ast_matchers::initListExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, InitListExpr > initListExpr
Matches init list expressions.
Definition: ASTMatchersInternal.cpp:849
clang::ast_matchers::blockExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, BlockExpr > blockExpr
Matches a reference to a block.
Definition: ASTMatchersInternal.cpp:893
type
clang::ast_matchers::dynamic::Registry::nodeMatcherType
static ASTNodeKind nodeMatcherType(MatcherCtor)
Definition: Registry.cpp:602
Error
llvm::Error Error
Definition: ByteCodeEmitter.cpp:20
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::ast_matchers::stmt
const internal::VariadicAllOfMatcher< Stmt > stmt
Matches statements.
Definition: ASTMatchersInternal.cpp:810
clang::ast_matchers::cxxBaseSpecifier
const internal::VariadicAllOfMatcher< CXXBaseSpecifier > cxxBaseSpecifier
Matches class bases.
Definition: ASTMatchersInternal.cpp:759
clang::ast_matchers::dynamic::operator<<
static llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const std::set< ASTNodeKind > &KS)
Definition: Registry.cpp:630
clang::ast_matchers::lValueReferenceType
const AstTypeMatcher< LValueReferenceType > lValueReferenceType
Matches lvalue reference types.
Definition: ASTMatchersInternal.cpp:1054
clang::ast_matchers::stringLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, StringLiteral > stringLiteral
Matches string literals (also matches wide string literals).
Definition: ASTMatchersInternal.cpp:919
clang::ast_matchers::anyOf
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> anyOf
Matches if any of the given matchers matches.
Definition: ASTMatchersInternal.cpp:990
clang::ast_matchers::cxxFunctionalCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXFunctionalCastExpr > cxxFunctionalCastExpr
Matches functional cast expressions.
Definition: ASTMatchersInternal.cpp:978
clang::ast_matchers::cxxThrowExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXThrowExpr > cxxThrowExpr
Matches throw expressions.
Definition: ASTMatchersInternal.cpp:914
clang::ast_matchers::nestedNameSpecifierLoc
const internal::VariadicAllOfMatcher< NestedNameSpecifierLoc > nestedNameSpecifierLoc
Same as nestedNameSpecifier but matches NestedNameSpecifierLoc.
Definition: ASTMatchersInternal.cpp:1030
clang::ast_matchers::declaratorDecl
const internal::VariadicDynCastAllOfMatcher< Decl, DeclaratorDecl > declaratorDecl
Matches declarator declarations (field, variable, function and non-type template parameter declaratio...
Definition: ASTMatchersInternal.cpp:755
clang::ast_matchers::genericSelectionExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, GenericSelectionExpr > genericSelectionExpr
Matches C11 _Generic expression.
Definition: ASTMatchersInternal.cpp:944
clang::ast_matchers::unaryTransformType
const AstTypeMatcher< UnaryTransformType > unaryTransformType
Matches types nodes representing unary type transformations.
Definition: ASTMatchersInternal.cpp:1059
clang::ast_matchers::lambdaCapture
const internal::VariadicAllOfMatcher< LambdaCapture > lambdaCapture
Matches lambda captures.
Definition: ASTMatchersInternal.cpp:771
clang::ast_matchers::cxxCtorInitializer
const internal::VariadicAllOfMatcher< CXXCtorInitializer > cxxCtorInitializer
Matches constructor initializers.
Definition: ASTMatchersInternal.cpp:760
clang::ast_matchers::memberExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, MemberExpr > memberExpr
Matches member expressions.
Definition: ASTMatchersInternal.cpp:812
clang::ast_matchers::objcThrowStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtThrowStmt > objcThrowStmt
Matches Objective-C @throw statements.
Definition: ASTMatchersInternal.cpp:841
clang::ast_matchers::designatedInitExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, DesignatedInitExpr > designatedInitExpr
Matches C99 designated initializer expressions [C99 6.7.8].
Definition: ASTMatchersInternal.cpp:984
clang::ast_matchers::hasAnyOverloadedOperatorName
const internal::VariadicFunction< internal::PolymorphicMatcher< internal::HasOverloadedOperatorNameMatcher, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXOperatorCallExpr, FunctionDecl), std::vector< std::string > >, StringRef, internal::hasAnyOverloadedOperatorNameFunc > hasAnyOverloadedOperatorName
Matches overloaded operator names.
Definition: ASTMatchersInternal.cpp:1005
clang::ast_matchers::allOf
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> allOf
Matches if all given matchers match.
Definition: ASTMatchersInternal.cpp:993
clang::ast_matchers::unresolvedUsingTypenameDecl
const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingTypenameDecl > unresolvedUsingTypenameDecl
Matches unresolved using value declarations that involve the typename.
Definition: ASTMatchersInternal.cpp:866
clang::ast_matchers::templateTypeParmDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TemplateTypeParmDecl > templateTypeParmDecl
Matches template type parameter declarations.
Definition: ASTMatchersInternal.cpp:767
clang::ast_matchers::decltypeType
const AstTypeMatcher< DecltypeType > decltypeType
Matches types nodes representing C++11 decltype(<expr>) types.
Definition: ASTMatchersInternal.cpp:1045
llvm::Optional
Definition: LLVM.h:40
clang::ast_matchers::explicitCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ExplicitCastExpr > explicitCastExpr
Matches explicit cast expressions.
Definition: ASTMatchersInternal.cpp:973
clang::ast_matchers::tagType
const AstTypeMatcher< TagType > tagType
Matches tag types (record and enum types).
Definition: ASTMatchersInternal.cpp:1061
clang::ast_matchers::equals
internal::PolymorphicMatcher< internal::ValueEqualsMatcher, void(internal::AllNodeBaseTypes), ValueT > equals(const ValueT &Value)
Matches literals that are equal to the given value of type ValueT.
Definition: ASTMatchers.h:5587
clang::ast_matchers::returnStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ReturnStmt > returnStmt
Matches return statements.
Definition: ASTMatchersInternal.cpp:903
clang::ast_matchers::functionProtoType
const AstTypeMatcher< FunctionProtoType > functionProtoType
Matches FunctionProtoType nodes.
Definition: ASTMatchersInternal.cpp:1047
clang::ast_matchers::cxxConstructorDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXConstructorDecl > cxxConstructorDecl
Matches C++ constructor declarations.
Definition: ASTMatchersInternal.cpp:792
clang::ast_matchers::deducedTemplateSpecializationType
const AstTypeMatcher< DeducedTemplateSpecializationType > deducedTemplateSpecializationType
Matches C++17 deduced template specialization types, e.g.
Definition: ASTMatchersInternal.cpp:1039
clang::ast_matchers::ompDefaultClause
const internal::VariadicDynCastAllOfMatcher< OMPClause, OMPDefaultClause > ompDefaultClause
Matches OpenMP default clause.
Definition: ASTMatchersInternal.cpp:1081
clang::ast_matchers::implicitValueInitExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitValueInitExpr > implicitValueInitExpr
Matches implicit initializers of init list expressions.
Definition: ASTMatchersInternal.cpp:853
clang::ast_matchers::constantExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ConstantExpr > constantExpr
Matches a constant expression wrapper.
Definition: ASTMatchersInternal.cpp:867
clang::ast_matchers::objcInterfaceDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCInterfaceDecl > objcInterfaceDecl
Matches Objective-C interface declarations.
Definition: ASTMatchersInternal.cpp:824
clang::ast_matchers::cxxTryStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXTryStmt > cxxTryStmt
Matches try statements.
Definition: ASTMatchersInternal.cpp:913
clang::ast_matchers::valueDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ValueDecl > valueDecl
Matches any value declaration.
Definition: ASTMatchersInternal.cpp:790
clang::ast_matchers::materializeTemporaryExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, MaterializeTemporaryExpr > materializeTemporaryExpr
Matches nodes where temporaries are materialized.
Definition: ASTMatchersInternal.cpp:877
clang::ast_matchers::blockDecl
const internal::VariadicDynCastAllOfMatcher< Decl, BlockDecl > blockDecl
Matches block declarations.
Definition: ASTMatchersInternal.cpp:836
clang::ast_matchers::dynamic::internal::MatcherDescriptor::getArgKinds
virtual void getArgKinds(ASTNodeKind ThisKind, unsigned ArgNo, std::vector< ArgKind > &ArgKinds) const =0
Given that the matcher is being converted to type ThisKind, append the set of argument types accepted...
clang::ast_matchers::dynamic::internal::MatcherDescriptor::nodeMatcherType
virtual ASTNodeKind nodeMatcherType() const
Definition: Marshallers.h:312
clang::ast_matchers::rValueReferenceType
const AstTypeMatcher< RValueReferenceType > rValueReferenceType
Matches rvalue reference types.
Definition: ASTMatchersInternal.cpp:1055
clang::ast_matchers::opaqueValueExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, OpaqueValueExpr > opaqueValueExpr
Matches opaque value expressions.
Definition: ASTMatchersInternal.cpp:959
clang::ast_matchers::floatLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, FloatingLiteral > floatLiteral
Matches float literals of all sizes / encodings, e.g.
Definition: ASTMatchersInternal.cpp:925
clang::ast_matchers::labelStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, LabelStmt > labelStmt
Matches label statements.
Definition: ASTMatchersInternal.cpp:905
clang::ast_matchers::cxxDeleteExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDeleteExpr > cxxDeleteExpr
Matches delete expressions.
Definition: ASTMatchersInternal.cpp:879
clang::ast_matchers::templateName
const internal::VariadicAllOfMatcher< TemplateName > templateName
Matches template name.
Definition: ASTMatchersInternal.cpp:763
clang::ast_matchers::forEachDescendant
const internal::ArgumentAdaptingMatcherFunc< internal::ForEachDescendantMatcher > forEachDescendant
Matches AST nodes that have descendant AST nodes that match the provided matcher.
Definition: ASTMatchersInternal.cpp:1015
clang::ast_matchers::cxxBoolLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBoolLiteralExpr > cxxBoolLiteral
Matches bool literals.
Definition: ASTMatchersInternal.cpp:918
clang::ast_matchers::cxxForRangeStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXForRangeStmt > cxxForRangeStmt
Matches range-based for statements.
Definition: ASTMatchersInternal.cpp:897
clang::ast_matchers::typeLoc
const internal::VariadicAllOfMatcher< TypeLoc > typeLoc
Matches TypeLocs in the clang AST.
Definition: ASTMatchersInternal.cpp:774
clang::ast_matchers::forEach
const internal::ArgumentAdaptingMatcherFunc< internal::ForEachMatcher > forEach
Matches AST nodes that have child AST nodes that match the provided matcher.
Definition: ASTMatchersInternal.cpp:1012
Marshallers.h
clang::ast_matchers::dynamic::Registry::getMatcherCompletions
static std::vector< MatcherCompletion > getMatcherCompletions(ArrayRef< ArgKind > AcceptedTypes)
Compute the list of completions that match any of AcceptedTypes.
Definition: Registry.cpp:680
clang::ast_matchers::cxxOperatorCallExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXOperatorCallExpr > cxxOperatorCallExpr
Matches overloaded operator calls.
Definition: ASTMatchersInternal.cpp:887
clang::ast_matchers::objcPropertyDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCPropertyDecl > objcPropertyDecl
Matches Objective-C property declarations.
Definition: ASTMatchersInternal.cpp:839
clang::ast_matchers::unresolvedUsingValueDecl
const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingValueDecl > unresolvedUsingValueDecl
Matches unresolved using value declarations.
Definition: ASTMatchersInternal.cpp:864
clang::ast_matchers::atomicType
const AstTypeMatcher< AtomicType > atomicType
Matches atomic types.
Definition: ASTMatchersInternal.cpp:1043
clang::ast_matchers::expr
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
Definition: ASTMatchersInternal.cpp:890
clang::ast_matchers::cxxDependentScopeMemberExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDependentScopeMemberExpr > cxxDependentScopeMemberExpr
Matches member expressions where the actual member referenced could not be resolved because the base ...
Definition: ASTMatchersInternal.cpp:816
clang::ast_matchers::attr
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
Definition: ASTMatchersInternal.cpp:1031
hasDefinition
static bool hasDefinition(const ObjCObjectPointerType *ObjPtr)
Definition: DynamicTypeChecker.cpp:145
clang::ast_matchers::templateArgument
const internal::VariadicAllOfMatcher< TemplateArgument > templateArgument
Matches template arguments.
Definition: ASTMatchersInternal.cpp:761
clang::ast_matchers::objcIvarRefExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCIvarRefExpr > objcIvarRefExpr
Matches a reference to an ObjCIvar.
Definition: ASTMatchersInternal.cpp:892
clang::ast_matchers::tagDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TagDecl > tagDecl
Matches tag declarations.
Definition: ASTMatchersInternal.cpp:798
clang::ast_matchers::objcCategoryDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCCategoryDecl > objcCategoryDecl
Matches Objective-C category declarations.
Definition: ASTMatchersInternal.cpp:830
clang::ast_matchers::usingDecl
const internal::VariadicDynCastAllOfMatcher< Decl, UsingDecl > usingDecl
Matches using declarations.
Definition: ASTMatchersInternal.cpp:857
clang::ast_matchers::substNonTypeTemplateParmExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, SubstNonTypeTemplateParmExpr > substNonTypeTemplateParmExpr
Matches substitutions of non-type template parameters.
Definition: ASTMatchersInternal.cpp:856
clang::ast_matchers::objcFinallyStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtFinallyStmt > objcFinallyStmt
Matches Objective-C @finally statements.
Definition: ASTMatchersInternal.cpp:846
clang::ast_matchers::functionType
const AstTypeMatcher< FunctionType > functionType
Matches FunctionType nodes.
Definition: ASTMatchersInternal.cpp:1046
clang::ast_matchers::cxxUnresolvedConstructExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXUnresolvedConstructExpr > cxxUnresolvedConstructExpr
Matches unresolved constructor call expressions.
Definition: ASTMatchersInternal.cpp:872
clang::ast_matchers::builtinType
const AstTypeMatcher< BuiltinType > builtinType
Matches builtin Types.
Definition: ASTMatchersInternal.cpp:1034
clang::ast_matchers::namespaceAliasDecl
const internal::VariadicDynCastAllOfMatcher< Decl, NamespaceAliasDecl > namespaceAliasDecl
Matches a declaration of a namespace alias.
Definition: ASTMatchersInternal.cpp:743
clang::ento::iterator::isComparisonOperator
bool isComparisonOperator(OverloadedOperatorKind OK)
Definition: Iterator.cpp:71
clang::ast_matchers::bindingDecl
const internal::VariadicDynCastAllOfMatcher< Decl, BindingDecl > bindingDecl
Matches binding declarations Example matches foo and bar (matcher = bindingDecl()
Definition: ASTMatchersInternal.cpp:736
clang::ast_matchers::dynamic::internal::MatcherDescriptorPtr::MatcherDescriptorPtr
MatcherDescriptorPtr(MatcherDescriptor *)
Definition: Registry.cpp:606
clang::ast_matchers::enumDecl
const internal::VariadicDynCastAllOfMatcher< Decl, EnumDecl > enumDecl
Matches enum declarations.
Definition: ASTMatchersInternal.cpp:795
clang::ast_matchers::referenceTypeLoc
const internal::VariadicDynCastAllOfMatcher< TypeLoc, ReferenceTypeLoc > referenceTypeLoc
Matches reference TypeLocs.
Definition: ASTMatchersInternal.cpp:781
ASTMatchers.h
clang::ast_matchers::objcProtocolDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCProtocolDecl > objcProtocolDecl
Matches Objective-C protocol declarations.
Definition: ASTMatchersInternal.cpp:828
clang::ast_matchers::switchStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, SwitchStmt > switchStmt
Matches switch statements.
Definition: ASTMatchersInternal.cpp:907
clang::ast_matchers::cxxReinterpretCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXReinterpretCastExpr > cxxReinterpretCastExpr
Matches a reinterpret_cast expression.
Definition: ASTMatchersInternal.cpp:963
clang::ast_matchers::cxxThisExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXThisExpr > cxxThisExpr
Matches implicit and explicit this expressions.
Definition: ASTMatchersInternal.cpp:873
clang::ast_matchers::breakStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, BreakStmt > breakStmt
Matches break statements.
Definition: ASTMatchersInternal.cpp:900
clang::ast_matchers::cxxMethodDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXMethodDecl > cxxMethodDecl
Matches method declarations.
Definition: ASTMatchersInternal.cpp:799
clang::ast_matchers::unaryExprOrTypeTraitExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryExprOrTypeTraitExpr > unaryExprOrTypeTraitExpr
Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
Definition: ASTMatchersInternal.cpp:789
clang::ast_matchers::cxxNullPtrLiteralExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNullPtrLiteralExpr > cxxNullPtrLiteralExpr
Matches nullptr literal.
Definition: ASTMatchersInternal.cpp:934
clang::ast_matchers::cxxStdInitializerListExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXStdInitializerListExpr > cxxStdInitializerListExpr
Matches C++ initializer list expressions.
Definition: ASTMatchersInternal.cpp:851
clang::ast_matchers::usingDirectiveDecl
const internal::VariadicDynCastAllOfMatcher< Decl, UsingDirectiveDecl > usingDirectiveDecl
Matches using namespace declarations.
Definition: ASTMatchersInternal.cpp:860
clang::ast_matchers::chooseExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ChooseExpr > chooseExpr
Matches GNU __builtin_choose_expr.
Definition: ASTMatchersInternal.cpp:935
clang::ast_matchers::whileStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, WhileStmt > whileStmt
Matches while statements.
Definition: ASTMatchersInternal.cpp:898
clang::ast_matchers::hasAnySelector
const internal::VariadicFunction< internal::Matcher< ObjCMessageExpr >, StringRef, internal::hasAnySelectorFunc > hasAnySelector
Matches when at least one of the supplied string equals to the Selector.getAsString()
Definition: ASTMatchersInternal.cpp:1008
clang::ast_matchers::typedefType
const AstTypeMatcher< TypedefType > typedefType
Matches typedef types.
Definition: ASTMatchersInternal.cpp:1056
clang::ast_matchers::linkageSpecDecl
const internal::VariadicDynCastAllOfMatcher< Decl, LinkageSpecDecl > linkageSpecDecl
Matches a declaration of a linkage specification.
Definition: ASTMatchersInternal.cpp:738
clang::ast_matchers::nestedNameSpecifier
const internal::VariadicAllOfMatcher< NestedNameSpecifier > nestedNameSpecifier
Matches nested name specifiers.
Definition: ASTMatchersInternal.cpp:1028
VariantValue.h
clang::ast_matchers::binaryOperation
const internal::MapAnyOfMatcher< BinaryOperator, CXXOperatorCallExpr, CXXRewrittenBinaryOperator > binaryOperation
Matches nodes which can be used with binary operators.
Definition: ASTMatchersInternal.cpp:951
clang::ast_matchers::asmStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, AsmStmt > asmStmt
Matches asm statements.
Definition: ASTMatchersInternal.cpp:916
clang::ast_matchers::cxxConstCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstCastExpr > cxxConstCastExpr
Matches a const_cast expression.
Definition: ASTMatchersInternal.cpp:969
clang::ast_matchers::nonTypeTemplateParmDecl
const internal::VariadicDynCastAllOfMatcher< Decl, NonTypeTemplateParmDecl > nonTypeTemplateParmDecl
Matches non-type template parameter declarations.
Definition: ASTMatchersInternal.cpp:765
clang::ast_matchers::dynamic::Registry::buildMatcherCtor
static internal::MatcherDescriptorPtr buildMatcherCtor(MatcherCtor, SourceRange NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error)
Definition: Registry.cpp:616
clang::ast_matchers::atomicExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, AtomicExpr > atomicExpr
Matches atomic builtins.
Definition: ASTMatchersInternal.cpp:945
clang::ast_matchers::pointerTypeLoc
const internal::VariadicDynCastAllOfMatcher< TypeLoc, PointerTypeLoc > pointerTypeLoc
Matches pointer TypeLocs.
Definition: ASTMatchersInternal.cpp:779
clang::ast_matchers::coyieldExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CoyieldExpr > coyieldExpr
Matches co_yield expressions.
Definition: ASTMatchersInternal.cpp:941
clang::ast_matchers::cxxMemberCallExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXMemberCallExpr > cxxMemberCallExpr
Matches member call expressions.
Definition: ASTMatchersInternal.cpp:820
clang::ast_matchers::ifStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, IfStmt > ifStmt
Matches if statements.
Definition: ASTMatchersInternal.cpp:894
clang::ast_matchers::memberPointerType
const AstTypeMatcher< MemberPointerType > memberPointerType
Matches member pointer types.
Definition: ASTMatchersInternal.cpp:1050
clang::ast_matchers::cxxRewrittenBinaryOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXRewrittenBinaryOperator > cxxRewrittenBinaryOperator
Matches rewritten binary operators.
Definition: ASTMatchersInternal.cpp:889
clang::ast_matchers::binaryOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryOperator > binaryOperator
Matches binary operator expressions.
Definition: ASTMatchersInternal.cpp:948
clang::ast_matchers::namespaceDecl
const internal::VariadicDynCastAllOfMatcher< Decl, NamespaceDecl > namespaceDecl
Matches a declaration of a namespace.
Definition: ASTMatchersInternal.cpp:741
clang::ast_matchers::labelDecl
const internal::VariadicDynCastAllOfMatcher< Decl, LabelDecl > labelDecl
Matches a declaration of label.
Definition: ASTMatchersInternal.cpp:740
clang::ast_matchers::parenListExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ParenListExpr > parenListExpr
Matches paren list expressions.
Definition: ASTMatchersInternal.cpp:854
clang::ast_matchers::qualifiedTypeLoc
const internal::VariadicDynCastAllOfMatcher< TypeLoc, QualifiedTypeLoc > qualifiedTypeLoc
Matches QualifiedTypeLocs in the clang AST.
Definition: ASTMatchersInternal.cpp:777
clang::ast_matchers::nullStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, NullStmt > nullStmt
Matches null statements.
Definition: ASTMatchersInternal.cpp:915
clang::ast_matchers::autoreleasePoolStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAutoreleasePoolStmt > autoreleasePoolStmt
Matches an Objective-C autorelease pool statement.
Definition: ASTMatchersInternal.cpp:725
clang::ast_matchers::objcCatchStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtCatchStmt > objcCatchStmt
Matches Objective-C @catch statements.
Definition: ASTMatchersInternal.cpp:844
clang::ast_matchers::usingEnumDecl
const internal::VariadicDynCastAllOfMatcher< Decl, UsingEnumDecl > usingEnumDecl
Matches using-enum declarations.
Definition: ASTMatchersInternal.cpp:858
clang::ast_matchers::unless
const internal::VariadicOperatorMatcherFunc< 1, 1 > unless
Matches if the provided matcher does not match.
Definition: ASTMatchersInternal.cpp:1026
clang::ast_matchers::doStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, DoStmt > doStmt
Matches do statements.
Definition: ASTMatchersInternal.cpp:899
clang::ast_matchers::arrayType
const AstTypeMatcher< ArrayType > arrayType
Matches all kinds of arrays.
Definition: ASTMatchersInternal.cpp:1035
clang::ast_matchers::dynamic::internal::MatcherDescriptor::isConvertibleTo
virtual bool isConvertibleTo(ASTNodeKind Kind, unsigned *Specificity=nullptr, ASTNodeKind *LeastDerivedKind=nullptr) const =0
Returns whether this matcher is convertible to the given type.
clang::ast_matchers::objcImplementationDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCImplementationDecl > objcImplementationDecl
Matches Objective-C implementation declarations.
Definition: ASTMatchersInternal.cpp:826
clang::ast_matchers::objcStringLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCStringLiteral > objcStringLiteral
Matches ObjectiveC String literal expressions.
Definition: ASTMatchersInternal.cpp:920
clang::ast_matchers::functionTemplateDecl
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionTemplateDecl > functionTemplateDecl
Matches C++ function template declarations.
Definition: ASTMatchersInternal.cpp:808
clang::ast_matchers::typedefNameDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TypedefNameDecl > typedefNameDecl
Matches typedef name declarations.
Definition: ASTMatchersInternal.cpp:730
Diagnostics.h
clang::ast_matchers::parenExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ParenExpr > parenExpr
Matches parentheses used in expressions.
Definition: ASTMatchersInternal.cpp:868
clang::ast_matchers::cStyleCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CStyleCastExpr > cStyleCastExpr
Matches a C-style cast expression.
Definition: ASTMatchersInternal.cpp:971
clang::ast_matchers::hasAncestor
const internal::ArgumentAdaptingMatcherFunc< internal::HasAncestorMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr > > hasAncestor
Matches AST nodes that have an ancestor that matches the provided matcher.
Definition: ASTMatchersInternal.cpp:1025
clang::ast_matchers::gnuNullExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, GNUNullExpr > gnuNullExpr
Matches GNU __null expression.
Definition: ASTMatchersInternal.cpp:942
clang::ast_matchers::exprWithCleanups
const internal::VariadicDynCastAllOfMatcher< Stmt, ExprWithCleanups > exprWithCleanups
Matches expressions that introduce cleanups to be run at the end of the sub-expression's evaluation.
Definition: ASTMatchersInternal.cpp:848
clang::ast_matchers::translationUnitDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TranslationUnitDecl > translationUnitDecl
Matches the top declaration context.
Definition: ASTMatchersInternal.cpp:727
clang::ast_matchers::eachOf
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> eachOf
Matches if any of the given matchers matches.
Definition: ASTMatchersInternal.cpp:987
clang::ast_matchers::autoType
const AstTypeMatcher< AutoType > autoType
Matches types nodes representing C++11 auto types.
Definition: ASTMatchersInternal.cpp:1044
clang::ast_matchers::decl
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
Definition: ASTMatchersInternal.cpp:734
clang::ast_matchers::unaryOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryOperator > unaryOperator
Matches unary operator expressions.
Definition: ASTMatchersInternal.cpp:953
clang::ast_matchers::dynamic::ArgKind
Kind identifier.
Definition: VariantValue.h:34
clang::ast_matchers::typedefDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TypedefDecl > typedefDecl
Matches typedef declarations.
Definition: ASTMatchersInternal.cpp:728
clang::ast_matchers::variableArrayType
const AstTypeMatcher< VariableArrayType > variableArrayType
Matches C arrays with a specified size that is not an integer-constant-expression.
Definition: ASTMatchersInternal.cpp:1042
clang::ast_matchers::objcTryStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtTryStmt > objcTryStmt
Matches Objective-C @try statements.
Definition: ASTMatchersInternal.cpp:842
clang::ast_matchers::compoundStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CompoundStmt > compoundStmt
Matches compound statements.
Definition: ASTMatchersInternal.cpp:911
clang::ast_matchers::friendDecl
const internal::VariadicDynCastAllOfMatcher< Decl, FriendDecl > friendDecl
Matches friend declarations.
Definition: ASTMatchersInternal.cpp:809
clang::ast_matchers::gotoStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, GotoStmt > gotoStmt
Matches goto statements.
Definition: ASTMatchersInternal.cpp:904
clang::ast_matchers::objcIvarDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCIvarDecl > objcIvarDecl
Matches Objective-C instance variable declarations.
Definition: ASTMatchersInternal.cpp:837
clang::ast_matchers::templateSpecializationTypeLoc
const internal::VariadicDynCastAllOfMatcher< TypeLoc, TemplateSpecializationTypeLoc > templateSpecializationTypeLoc
Matches template specialization TypeLocs.
Definition: ASTMatchersInternal.cpp:784
clang::ast_matchers::castExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
Definition: ASTMatchersInternal.cpp:976
clang::ast_matchers::dynamic::internal::MatcherDescriptor::buildMatcherCtor
virtual std::unique_ptr< MatcherDescriptor > buildMatcherCtor(SourceRange NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error) const
Definition: Marshallers.h:317
clang::ast_matchers::incompleteArrayType
const AstTypeMatcher< IncompleteArrayType > incompleteArrayType
Matches C arrays with unspecified size.
Definition: ASTMatchersInternal.cpp:1041
clang::ast_matchers::typeAliasDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TypeAliasDecl > typeAliasDecl
Matches type alias declarations.
Definition: ASTMatchersInternal.cpp:731
clang::ast_matchers::predefinedExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, PredefinedExpr > predefinedExpr
Matches predefined identifier expressions [C99 6.4.2.2].
Definition: ASTMatchersInternal.cpp:982
clang::ast_matchers::dynamic::VariantMatcher
A variant matcher object.
Definition: VariantValue.h:105
llvm::ArrayRef
Definition: LLVM.h:34
clang::ast_matchers::objcCategoryImplDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCCategoryImplDecl > objcCategoryImplDecl
Matches Objective-C category definitions.
Definition: ASTMatchersInternal.cpp:832
clang::ast_matchers::cxxDynamicCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDynamicCastExpr > cxxDynamicCastExpr
Matches a dynamic_cast expression.
Definition: ASTMatchersInternal.cpp:967
clang::ast_matchers::compoundLiteralExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CompoundLiteralExpr > compoundLiteralExpr
Matches compound (i.e.
Definition: ASTMatchersInternal.cpp:932
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
clang::ast_matchers::objcMessageExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCMessageExpr > objcMessageExpr
Matches ObjectiveC Message invocation expressions.
Definition: ASTMatchersInternal.cpp:822
clang::ast_matchers::dependentCoawaitExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, DependentCoawaitExpr > dependentCoawaitExpr
Matches co_await expressions where the type of the promise is dependent.
Definition: ASTMatchersInternal.cpp:939
clang::ast_matchers::recordDecl
const internal::VariadicDynCastAllOfMatcher< Decl, RecordDecl > recordDecl
Matches class, struct, and union declarations.
Definition: ASTMatchersInternal.cpp:744
clang::ast_matchers::cxxStaticCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXStaticCastExpr > cxxStaticCastExpr
Matches a C++ static_cast expression.
Definition: ASTMatchersInternal.cpp:965
clang::ast_matchers::dynamic::internal::MatcherDescriptor
Matcher descriptor interface.
Definition: Marshallers.h:304
clang::ast_matchers::blockPointerType
const AstTypeMatcher< BlockPointerType > blockPointerType
Matches block pointer types, i.e.
Definition: ASTMatchersInternal.cpp:1049
clang::ast_matchers::cxxDestructorDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXDestructorDecl > cxxDestructorDecl
Matches explicit C++ destructor declarations.
Definition: ASTMatchersInternal.cpp:794
clang::ast_matchers::cxxCatchStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXCatchStmt > cxxCatchStmt
Matches catch statements.
Definition: ASTMatchersInternal.cpp:912
clang::ast_matchers::dynamic::SourceRange
Definition: Diagnostics.h:36
clang::ast_matchers::complexType
const AstTypeMatcher< ComplexType > complexType
Matches C99 complex types.
Definition: ASTMatchersInternal.cpp:1036
clang::ast_matchers::arraySubscriptExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ArraySubscriptExpr > arraySubscriptExpr
Matches array subscript expressions.
Definition: ASTMatchersInternal.cpp:883
clang::ast_matchers::dynamic::internal::MatcherDescriptorPtr::~MatcherDescriptorPtr
~MatcherDescriptorPtr()
Definition: Registry.cpp:609
clang::ast_matchers::dynamic::Registry::lookupMatcherCtor
static llvm::Optional< MatcherCtor > lookupMatcherCtor(StringRef MatcherName)
Look up a matcher in the registry by name,.
Definition: Registry.cpp:623
clang::ast_matchers::characterLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, CharacterLiteral > characterLiteral
Matches character literals (also matches wchar_t).
Definition: ASTMatchersInternal.cpp:922
clang::ast_matchers::hasDescendant
const internal::ArgumentAdaptingMatcherFunc< internal::HasDescendantMatcher > hasDescendant
Matches AST nodes that have descendant AST nodes that match the provided matcher.
Definition: ASTMatchersInternal.cpp:1011
clang::ast_matchers::callExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CallExpr > callExpr
Matches call expressions.
Definition: ASTMatchersInternal.cpp:817
clang::ast_matchers::elaboratedTypeLoc
const internal::VariadicDynCastAllOfMatcher< TypeLoc, ElaboratedTypeLoc > elaboratedTypeLoc
Matches C or C++ elaborated TypeLocs.
Definition: ASTMatchersInternal.cpp:786
isExternC
static bool isExternC(const NamedDecl *ND)
Definition: Mangle.cpp:58
clang::ast_matchers::cxxDefaultArgExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDefaultArgExpr > cxxDefaultArgExpr
Matches the value of a default argument at the call site.
Definition: ASTMatchersInternal.cpp:885
ASTTypeTraits.h
clang::ast_matchers::dynamic::Registry::constructMatcher
static VariantMatcher constructMatcher(MatcherCtor Ctor, SourceRange NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error)
Construct a matcher from the registry.
Definition: Registry.cpp:785
clang::ast_matchers::addrLabelExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, AddrLabelExpr > addrLabelExpr
Matches address of label statements (GNU extension).
Definition: ASTMatchersInternal.cpp:906
clang::transformer::member
RangeSelector member(std::string ID)
Given a MemberExpr, selects the member token.
Definition: RangeSelector.cpp:188
Registry.h
MATCHER_OVERLOAD_ENTRY
#define MATCHER_OVERLOAD_ENTRY(name, Id)
Definition: Registry.cpp:79
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
clang::ast_matchers::functionDecl
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionDecl > functionDecl
Matches function declarations.
Definition: ASTMatchersInternal.cpp:806
clang::ast_matchers::indirectFieldDecl
const internal::VariadicDynCastAllOfMatcher< Decl, IndirectFieldDecl > indirectFieldDecl
Matches indirect field declarations.
Definition: ASTMatchersInternal.cpp:805
clang::ast_matchers::declRefExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclRefExpr > declRefExpr
Matches expressions that refer to declarations.
Definition: ASTMatchersInternal.cpp:891
clang::ast_matchers::dynamic::Registry::constructBoundMatcher
static VariantMatcher constructBoundMatcher(MatcherCtor Ctor, SourceRange NameRange, StringRef BindID, ArrayRef< ParserValue > Args, Diagnostics *Error)
Construct a matcher from the registry and bind it.
Definition: Registry.cpp:792
clang::ast_matchers::anything
internal::TrueMatcher anything()
Matches any node.
Definition: ASTMatchers.h:169
clang::ASTNodeKind
Kind identifier.
Definition: ASTTypeTraits.h:51
clang::ast_matchers::pointerType
const AstTypeMatcher< PointerType > pointerType
Matches pointer types, but does not match Objective-C object pointer types.
Definition: ASTMatchersInternal.cpp:1051
clang::ast_matchers::dynamic::Registry::getAcceptedCompletionTypes
static std::vector< ArgKind > getAcceptedCompletionTypes(llvm::ArrayRef< std::pair< MatcherCtor, unsigned >> Context)
Compute the list of completion types for Context.
Definition: Registry.cpp:646
clang::ast_matchers::recordType
const AstTypeMatcher< RecordType > recordType
Matches record types (e.g.
Definition: ASTMatchersInternal.cpp:1060
clang::ast_matchers::hasAnyOperatorName
const internal::VariadicFunction< internal::PolymorphicMatcher< internal::HasAnyOperatorNameMatcher, AST_POLYMORPHIC_SUPPORTED_TYPES(BinaryOperator, CXXOperatorCallExpr, CXXRewrittenBinaryOperator, UnaryOperator), std::vector< std::string > >, StringRef, internal::hasAnyOperatorNameFunc > hasAnyOperatorName
Matches operator expressions (binary or unary) that have any of the specified names.
Definition: ASTMatchersInternal.cpp:1002
clang::ast_matchers::decayedType
const AstTypeMatcher< DecayedType > decayedType
Matches decayed type Example matches i[] in declaration of f.
Definition: ASTMatchersInternal.cpp:1067
clang::ast_matchers::optionally
const internal::VariadicOperatorMatcherFunc< 1, 1 > optionally
Matches any node regardless of the submatcher.
Definition: ASTMatchersInternal.cpp:994
clang::ast_matchers::dynamic::Diagnostics
Helper class to manage error messages.
Definition: Diagnostics.h:50
clang::ast_matchers::alignOfExpr
internal::BindableMatcher< Stmt > alignOfExpr(const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher)
Same as unaryExprOrTypeTraitExpr, but only matching alignof.
Definition: ASTMatchers.h:2970
clang::ast_matchers::binaryConditionalOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryConditionalOperator > binaryConditionalOperator
Matches binary conditional operator expressions (GNU extension).
Definition: ASTMatchersInternal.cpp:957
clang
Definition: CalledOnceCheck.h:17
clang::ast_matchers::fixedPointLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, FixedPointLiteral > fixedPointLiteral
Matches fixed point literals.
Definition: ASTMatchersInternal.cpp:928
clang::ast_matchers::dynamic::internal::MatcherDescriptor::create
virtual VariantMatcher create(SourceRange NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error) const =0
clang::ast_matchers::referenceType
const AstTypeMatcher< ReferenceType > referenceType
Matches both lvalue and rvalue reference types.
Definition: ASTMatchersInternal.cpp:1053
clang::ast_matchers::typeAliasTemplateDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TypeAliasTemplateDecl > typeAliasTemplateDecl
Matches type alias template declarations.
Definition: ASTMatchersInternal.cpp:733
clang::ast_matchers::classTemplateSpecializationDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateSpecializationDecl > classTemplateSpecializationDecl
Matches C++ class template specializations.
Definition: ASTMatchersInternal.cpp:750
clang::ast_matchers::defaultStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, DefaultStmt > defaultStmt
Matches default statements inside switch statements.
Definition: ASTMatchersInternal.cpp:910
clang::ast_matchers::cxxNewExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNewExpr > cxxNewExpr
Matches new expressions.
Definition: ASTMatchersInternal.cpp:878
clang::ast_matchers::injectedClassNameType
const AstTypeMatcher< InjectedClassNameType > injectedClassNameType
Matches injected class name types.
Definition: ASTMatchersInternal.cpp:1066
clang::ast_matchers::caseStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CaseStmt > caseStmt
Matches case statements inside switch statements.
Definition: ASTMatchersInternal.cpp:909
clang::ast_matchers::elaboratedType
const AstTypeMatcher< ElaboratedType > elaboratedType
Matches types specified with an elaborated type keyword or with a qualified name.
Definition: ASTMatchersInternal.cpp:1062
clang::ast_matchers::objcMethodDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCMethodDecl > objcMethodDecl
Matches Objective-C method declarations.
Definition: ASTMatchersInternal.cpp:834
REGISTER_MATCHER
#define REGISTER_MATCHER(name)
Definition: Registry.cpp:67
clang::ast_matchers::forStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ForStmt > forStmt
Matches for statements.
Definition: ASTMatchersInternal.cpp:895
clang::ast_matchers::hasName
internal::Matcher< NamedDecl > hasName(StringRef Name)
Matches NamedDecl nodes that have the specified name.
Definition: ASTMatchers.h:3000
clang::ast_matchers::dependentSizedArrayType
const AstTypeMatcher< DependentSizedArrayType > dependentSizedArrayType
Matches C++ arrays whose size is a value-dependent expression.
Definition: ASTMatchersInternal.cpp:1040
clang::ast_matchers::dynamic::internal::MatcherDescriptorPtr
A smart (owning) pointer for MatcherDescriptor.
Definition: Registry.h:38
clang::ast_matchers::classTemplatePartialSpecializationDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplatePartialSpecializationDecl > classTemplatePartialSpecializationDecl
Matches C++ class template partial specializations.
Definition: ASTMatchersInternal.cpp:753
clang::ast_matchers::namedDecl
const internal::VariadicDynCastAllOfMatcher< Decl, NamedDecl > namedDecl
Matches a declaration of anything that could have a name.
Definition: ASTMatchersInternal.cpp:739
clang::ast_matchers::lambdaExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, LambdaExpr > lambdaExpr
Matches lambda expressions.
Definition: ASTMatchersInternal.cpp:818
clang::ast_matchers::accessSpecDecl
const internal::VariadicDynCastAllOfMatcher< Decl, AccessSpecDecl > accessSpecDecl
Matches C++ access specifier declarations.
Definition: ASTMatchersInternal.cpp:758
clang::ast_matchers::cxxTemporaryObjectExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXTemporaryObjectExpr > cxxTemporaryObjectExpr
Matches functional cast expressions having N != 1 arguments.
Definition: ASTMatchersInternal.cpp:980
clang::ast_matchers::unresolvedMemberExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, UnresolvedMemberExpr > unresolvedMemberExpr
Matches unresolved member expressions.
Definition: ASTMatchersInternal.cpp:814
clang::ast_matchers::coawaitExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CoawaitExpr > coawaitExpr
Matches co_await expressions.
Definition: ASTMatchersInternal.cpp:937
clang::ast_matchers::ompExecutableDirective
const internal::VariadicDynCastAllOfMatcher< Stmt, OMPExecutableDirective > ompExecutableDirective
Matches any #pragma omp executable directive.
Definition: ASTMatchersInternal.cpp:1079
clang::ast_matchers::unresolvedLookupExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, UnresolvedLookupExpr > unresolvedLookupExpr
Matches reference to a name that can be looked up during parsing but could not be resolved to a speci...
Definition: ASTMatchersInternal.cpp:862
clang::ast_matchers::dynamic::VariantMatcher::SingleMatcher
static VariantMatcher SingleMatcher(const DynTypedMatcher &Matcher)
Clones the provided matcher.
Definition: VariantValue.cpp:226
clang::ast_matchers::cxxRecordDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXRecordDecl > cxxRecordDecl
Matches C++ class declarations.
Definition: ASTMatchersInternal.cpp:745
clang::ast_matchers::cudaKernelCallExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CUDAKernelCallExpr > cudaKernelCallExpr
Matches CUDA kernel call expression.
Definition: ASTMatchersInternal.cpp:1033
clang::ast_matchers::usingType
const AstTypeMatcher< UsingType > usingType
Matches types specified through a using declaration.
Definition: ASTMatchersInternal.cpp:1063
clang::ast_matchers::dynamic::RegistryData
static llvm::ManagedStatic< RegistryMaps > RegistryData
Definition: Registry.cpp:600
clang::isTemplateInstantiation
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
Definition: Specifiers.h:198
clang::ast_matchers::cxxNoexceptExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNoexceptExpr > cxxNoexceptExpr
Matches noexcept expressions.
Definition: ASTMatchersInternal.cpp:881
clang::ast_matchers::dynamic::ArgKind::MakeMatcherArg
static ArgKind MakeMatcherArg(ASTNodeKind MatcherKind)
Constructor for matcher types.
Definition: VariantValue.h:48
clang::ast_matchers::staticAssertDecl
const internal::VariadicDynCastAllOfMatcher< Decl, StaticAssertDecl > staticAssertDecl
Matches a C++ static_assert declaration.
Definition: ASTMatchersInternal.cpp:961
clang::ast_matchers::dynamic::internal::MatcherDescriptor::isVariadic
virtual bool isVariadic() const =0
Returns whether the matcher is variadic.
REGISTER_OVERLOADED_2
#define REGISTER_OVERLOADED_2(name)
Definition: Registry.cpp:83
clang::ast_matchers::integerLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, IntegerLiteral > integerLiteral
Matches integer literals of all sizes / encodings, e.g.
Definition: ASTMatchersInternal.cpp:924
clang::ast_matchers::cxxConversionDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXConversionDecl > cxxConversionDecl
Matches conversion operator declarations.
Definition: ASTMatchersInternal.cpp:801
clang::ast_matchers::enumType
const AstTypeMatcher< EnumType > enumType
Matches enum types.
Definition: ASTMatchersInternal.cpp:1057
clang::ast_matchers::cxxConstructExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstructExpr > cxxConstructExpr
Matches constructor call expressions (including implicit ones).
Definition: ASTMatchersInternal.cpp:870
REGISTER_MATCHER_OVERLOAD
#define REGISTER_MATCHER_OVERLOAD(name)
Definition: Registry.cpp:71
clang::ast_matchers::objcObjectPointerType
const AstTypeMatcher< ObjCObjectPointerType > objcObjectPointerType
Matches an Objective-C object pointer type, which is different from a pointer type,...
Definition: ASTMatchersInternal.cpp:1052
clang::ast_matchers::templateArgumentLoc
const internal::VariadicAllOfMatcher< TemplateArgumentLoc > templateArgumentLoc
Matches template arguments (with location info).
Definition: ASTMatchersInternal.cpp:762
clang::ast_matchers::varDecl
const internal::VariadicDynCastAllOfMatcher< Decl, VarDecl > varDecl
Matches variable declarations.
Definition: ASTMatchersInternal.cpp:802
clang::ast_matchers::has
const internal::ArgumentAdaptingMatcherFunc< internal::HasMatcher > has
Matches AST nodes that have child AST nodes that match the provided matcher.
Definition: ASTMatchersInternal.cpp:1009
clang::ast_matchers::hasDeclaration
internal::PolymorphicMatcher< internal::HasDeclarationMatcher, void(internal::HasDeclarationSupportedTypes), internal::Matcher< Decl > > hasDeclaration(const internal::Matcher< Decl > &InnerMatcher)
Matches a node if the declaration associated with that node matches the given matcher.
Definition: ASTMatchers.h:3574
clang::ast_matchers::cxxBindTemporaryExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBindTemporaryExpr > cxxBindTemporaryExpr
Matches nodes where temporaries are created.
Definition: ASTMatchersInternal.cpp:875
clang::ast_matchers::templateTypeParmType
const AstTypeMatcher< TemplateTypeParmType > templateTypeParmType
Matches template type parameter types.
Definition: ASTMatchersInternal.cpp:1065
clang::ast_matchers::implicitCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitCastExpr > implicitCastExpr
Matches the implicit cast nodes of Clang's AST.
Definition: ASTMatchersInternal.cpp:975
clang::ast_matchers::declStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclStmt > declStmt
Matches declaration statements.
Definition: ASTMatchersInternal.cpp:811
clang::ast_matchers::dynamic::Registry::isBuilderMatcher
static bool isBuilderMatcher(MatcherCtor Ctor)
Definition: Registry.cpp:611
clang::ast_matchers::fieldDecl
const internal::VariadicDynCastAllOfMatcher< Decl, FieldDecl > fieldDecl
Matches field declarations.
Definition: ASTMatchersInternal.cpp:803
clang::ast_matchers::classTemplateDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateDecl > classTemplateDecl
Matches C++ class template declarations.
Definition: ASTMatchersInternal.cpp:747
clang::ast_matchers::hasOverloadedOperatorName
internal::PolymorphicMatcher< internal::HasOverloadedOperatorNameMatcher, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXOperatorCallExpr, FunctionDecl), std::vector< std::string > > hasOverloadedOperatorName(StringRef Name)
Matches overloaded operator names.
Definition: ASTMatchers.h:3063
clang::ast_matchers::parmVarDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ParmVarDecl > parmVarDecl
Matches parameter variable declarations.
Definition: ASTMatchersInternal.cpp:756
clang::ast_matchers::templateSpecializationType
const AstTypeMatcher< TemplateSpecializationType > templateSpecializationType
Matches template specialization types.
Definition: ASTMatchersInternal.cpp:1058
clang::ast_matchers::conditionalOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, ConditionalOperator > conditionalOperator
Matches conditional operator expressions.
Definition: ASTMatchersInternal.cpp:955
clang::ast_matchers::constantArrayType
const AstTypeMatcher< ConstantArrayType > constantArrayType
Matches C arrays with a specified constant size.
Definition: ASTMatchersInternal.cpp:1037
clang::ast_matchers::continueStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ContinueStmt > continueStmt
Matches continue statements.
Definition: ASTMatchersInternal.cpp:901
clang::ast_matchers::coreturnStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CoreturnStmt > coreturnStmt
Matches co_return statements.
Definition: ASTMatchersInternal.cpp:902
REGISTER_REGEX_MATCHER
#define REGISTER_REGEX_MATCHER(name)
Definition: Registry.cpp:91
clang::ast_matchers::cxxDeductionGuideDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXDeductionGuideDecl > cxxDeductionGuideDecl
Matches user-defined and implicitly generated deduction guide.
Definition: ASTMatchersInternal.cpp:1083
clang::ast_matchers::dynamic::ArgKind::AK_String
@ AK_String
Definition: VariantValue.h:42
clang::ast_matchers::dynamic::ArgKind::AK_Matcher
@ AK_Matcher
Definition: VariantValue.h:37
clang::ast_matchers::sizeOfExpr
internal::BindableMatcher< Stmt > sizeOfExpr(const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher)
Same as unaryExprOrTypeTraitExpr, but only matching sizeof.
Definition: ASTMatchers.h:2979
clang::ast_matchers::qualType
const internal::VariadicAllOfMatcher< QualType > qualType
Matches QualTypes in the clang AST.
Definition: ASTMatchersInternal.cpp:772
clang::ast_matchers::parenType
const AstTypeMatcher< ParenType > parenType
Matches ParenType nodes.
Definition: ASTMatchersInternal.cpp:1048