clang  5.0.0
Registry.cpp
Go to the documentation of this file.
1 //===--- Registry.cpp - Matcher registry -------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief Registry map populated at static initialization time.
12 ///
13 //===------------------------------------------------------------===//
14 
16 #include "Marshallers.h"
18 #include "llvm/ADT/STLExtras.h"
19 #include "llvm/ADT/StringMap.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Support/ManagedStatic.h"
22 #include <set>
23 #include <utility>
24 
25 using namespace clang::ast_type_traits;
26 
27 namespace clang {
28 namespace ast_matchers {
29 namespace dynamic {
30 namespace {
31 
32 using internal::MatcherDescriptor;
33 
34 typedef llvm::StringMap<std::unique_ptr<const MatcherDescriptor>> ConstructorMap;
35 class RegistryMaps {
36 public:
37  RegistryMaps();
38  ~RegistryMaps();
39 
40  const ConstructorMap &constructors() const { return Constructors; }
41 
42 private:
43  void registerMatcher(StringRef MatcherName,
44  std::unique_ptr<MatcherDescriptor> Callback);
45 
46  ConstructorMap Constructors;
47 };
48 
49 void RegistryMaps::registerMatcher(
50  StringRef MatcherName, std::unique_ptr<MatcherDescriptor> Callback) {
51  assert(Constructors.find(MatcherName) == Constructors.end());
52  Constructors[MatcherName] = std::move(Callback);
53 }
54 
55 #define REGISTER_MATCHER(name) \
56  registerMatcher(#name, internal::makeMatcherAutoMarshall( \
57  ::clang::ast_matchers::name, #name));
58 
59 #define REGISTER_MATCHER_OVERLOAD(name) \
60  registerMatcher(#name, \
61  llvm::make_unique<internal::OverloadedMatcherDescriptor>(name##Callbacks))
62 
63 #define SPECIFIC_MATCHER_OVERLOAD(name, Id) \
64  static_cast<::clang::ast_matchers::name##_Type##Id>( \
65  ::clang::ast_matchers::name)
66 
67 #define MATCHER_OVERLOAD_ENTRY(name, Id) \
68  internal::makeMatcherAutoMarshall(SPECIFIC_MATCHER_OVERLOAD(name, Id), \
69  #name)
70 
71 #define REGISTER_OVERLOADED_2(name) \
72  do { \
73  std::unique_ptr<MatcherDescriptor> name##Callbacks[] = { \
74  MATCHER_OVERLOAD_ENTRY(name, 0), \
75  MATCHER_OVERLOAD_ENTRY(name, 1)}; \
76  REGISTER_MATCHER_OVERLOAD(name); \
77  } while (0)
78 
79 /// \brief Generate a registry map with all the known matchers.
80 RegistryMaps::RegistryMaps() {
81  // TODO: Here is the list of the missing matchers, grouped by reason.
82  //
83  // Need Variant/Parser fixes:
84  // ofKind
85  //
86  // Polymorphic + argument overload:
87  // findAll
88  //
89  // Other:
90  // equalsNode
91 
92  REGISTER_OVERLOADED_2(callee);
93  REGISTER_OVERLOADED_2(hasPrefix);
94  REGISTER_OVERLOADED_2(hasType);
95  REGISTER_OVERLOADED_2(isDerivedFrom);
96  REGISTER_OVERLOADED_2(isSameOrDerivedFrom);
98  REGISTER_OVERLOADED_2(pointsTo);
99  REGISTER_OVERLOADED_2(references);
100  REGISTER_OVERLOADED_2(thisPointerType);
101 
102  std::unique_ptr<MatcherDescriptor> equalsCallbacks[] = {
106  };
108 
115  REGISTER_MATCHER(argumentCountIs);
117  REGISTER_MATCHER(arrayType);
119  REGISTER_MATCHER(asString);
121  REGISTER_MATCHER(atomicType);
122  REGISTER_MATCHER(autoType);
125  REGISTER_MATCHER(blockPointerType);
126  REGISTER_MATCHER(booleanType);
128  REGISTER_MATCHER(builtinType);
135  REGISTER_MATCHER(complexType);
139  REGISTER_MATCHER(constantArrayType);
140  REGISTER_MATCHER(containsDeclaration);
172  REGISTER_MATCHER(decayedType);
175  REGISTER_MATCHER(declCountIs);
179  REGISTER_MATCHER(dependentSizedArrayType);
181  REGISTER_MATCHER(designatorCountIs);
184  REGISTER_MATCHER(elaboratedType);
187  REGISTER_MATCHER(enumType);
188  REGISTER_MATCHER(equalsBoundNode);
189  REGISTER_MATCHER(equalsIntegralValue);
196  REGISTER_MATCHER(forEachArgumentWithParam);
197  REGISTER_MATCHER(forEachConstructorInitializer);
199  REGISTER_MATCHER(forEachSwitchCase);
200  REGISTER_MATCHER(forField);
201  REGISTER_MATCHER(forFunction);
205  REGISTER_MATCHER(functionProtoType);
207  REGISTER_MATCHER(functionType);
212  REGISTER_MATCHER(hasAnyArgument);
213  REGISTER_MATCHER(hasAnyConstructorInitializer);
214  REGISTER_MATCHER(hasAnyDeclaration);
216  REGISTER_MATCHER(hasAnyParameter);
217  REGISTER_MATCHER(hasAnySubstatement);
218  REGISTER_MATCHER(hasAnyTemplateArgument);
219  REGISTER_MATCHER(hasAnyUsingShadowDecl);
220  REGISTER_MATCHER(hasArgument);
221  REGISTER_MATCHER(hasArgumentOfType);
223  REGISTER_MATCHER(hasAutomaticStorageDuration);
224  REGISTER_MATCHER(hasBase);
225  REGISTER_MATCHER(hasBitWidth);
226  REGISTER_MATCHER(hasBody);
227  REGISTER_MATCHER(hasCanonicalType);
228  REGISTER_MATCHER(hasCaseConstant);
229  REGISTER_MATCHER(hasCastKind);
230  REGISTER_MATCHER(hasCondition);
231  REGISTER_MATCHER(hasConditionVariableStatement);
232  REGISTER_MATCHER(hasDecayedType);
234  REGISTER_MATCHER(hasDeclContext);
235  REGISTER_MATCHER(hasDeducedType);
237  REGISTER_MATCHER(hasDestinationType);
238  REGISTER_MATCHER(hasDynamicExceptionSpec);
240  REGISTER_MATCHER(hasElementType);
241  REGISTER_MATCHER(hasElse);
242  REGISTER_MATCHER(hasExternalFormalLinkage);
243  REGISTER_MATCHER(hasFalseExpression);
244  REGISTER_MATCHER(hasGlobalStorage);
245  REGISTER_MATCHER(hasImplicitDestinationType);
246  REGISTER_MATCHER(hasInClassInitializer);
247  REGISTER_MATCHER(hasIncrement);
248  REGISTER_MATCHER(hasIndex);
249  REGISTER_MATCHER(hasInitializer);
250  REGISTER_MATCHER(hasKeywordSelector);
251  REGISTER_MATCHER(hasLHS);
252  REGISTER_MATCHER(hasLocalQualifiers);
253  REGISTER_MATCHER(hasLocalStorage);
254  REGISTER_MATCHER(hasLoopInit);
255  REGISTER_MATCHER(hasLoopVariable);
256  REGISTER_MATCHER(hasMethod);
258  REGISTER_MATCHER(hasNullSelector);
259  REGISTER_MATCHER(hasObjectExpression);
260  REGISTER_MATCHER(hasOperatorName);
262  REGISTER_MATCHER(hasParameter);
264  REGISTER_MATCHER(hasQualifier);
265  REGISTER_MATCHER(hasRangeInit);
266  REGISTER_MATCHER(hasReceiverType);
267  REGISTER_MATCHER(hasReplacementType);
268  REGISTER_MATCHER(hasReturnValue);
269  REGISTER_MATCHER(hasRHS);
270  REGISTER_MATCHER(hasSelector);
271  REGISTER_MATCHER(hasSingleDecl);
272  REGISTER_MATCHER(hasSize);
273  REGISTER_MATCHER(hasSizeExpr);
274  REGISTER_MATCHER(hasSourceExpression);
275  REGISTER_MATCHER(hasStaticStorageDuration);
276  REGISTER_MATCHER(hasSyntacticForm);
277  REGISTER_MATCHER(hasTargetDecl);
278  REGISTER_MATCHER(hasTemplateArgument);
279  REGISTER_MATCHER(hasThen);
280  REGISTER_MATCHER(hasThreadStorageDuration);
281  REGISTER_MATCHER(hasTrueExpression);
282  REGISTER_MATCHER(hasTypeLoc);
283  REGISTER_MATCHER(hasUnaryOperand);
284  REGISTER_MATCHER(hasUnarySelector);
285  REGISTER_MATCHER(hasUnderlyingDecl);
286  REGISTER_MATCHER(hasUnqualifiedDesugaredType);
287  REGISTER_MATCHER(hasValueType);
289  REGISTER_MATCHER(ignoringImplicit);
290  REGISTER_MATCHER(ignoringImpCasts);
291  REGISTER_MATCHER(ignoringParenCasts);
292  REGISTER_MATCHER(ignoringParenImpCasts);
293  REGISTER_MATCHER(ignoringParens);
296  REGISTER_MATCHER(incompleteArrayType);
298  REGISTER_MATCHER(injectedClassNameType);
299  REGISTER_MATCHER(innerType);
301  REGISTER_MATCHER(isAnonymous);
302  REGISTER_MATCHER(isAnyCharacter);
303  REGISTER_MATCHER(isAnyPointer);
304  REGISTER_MATCHER(isArrow);
305  REGISTER_MATCHER(isBaseInitializer);
306  REGISTER_MATCHER(isBitField);
307  REGISTER_MATCHER(isCatchAll);
308  REGISTER_MATCHER(isClass);
309  REGISTER_MATCHER(isConst);
310  REGISTER_MATCHER(isConstexpr);
311  REGISTER_MATCHER(isConstQualified);
312  REGISTER_MATCHER(isCopyAssignmentOperator);
313  REGISTER_MATCHER(isCopyConstructor);
314  REGISTER_MATCHER(isDefaultConstructor);
315  REGISTER_MATCHER(isDefaulted);
316  REGISTER_MATCHER(isDefinition);
317  REGISTER_MATCHER(isDeleted);
318  REGISTER_MATCHER(isExceptionVariable);
319  REGISTER_MATCHER(isExplicit);
320  REGISTER_MATCHER(isExplicitTemplateSpecialization);
321  REGISTER_MATCHER(isExpr);
323  REGISTER_MATCHER(isFinal);
324  REGISTER_MATCHER(isInline);
325  REGISTER_MATCHER(isImplicit);
326  REGISTER_MATCHER(isExpansionInFileMatching);
327  REGISTER_MATCHER(isExpansionInMainFile);
328  REGISTER_MATCHER(isInstantiated);
329  REGISTER_MATCHER(isExpansionInSystemHeader);
330  REGISTER_MATCHER(isInteger);
331  REGISTER_MATCHER(isIntegral);
332  REGISTER_MATCHER(isInTemplateInstantiation);
333  REGISTER_MATCHER(isLambda);
334  REGISTER_MATCHER(isListInitialization);
335  REGISTER_MATCHER(isMemberInitializer);
336  REGISTER_MATCHER(isMoveAssignmentOperator);
337  REGISTER_MATCHER(isMoveConstructor);
338  REGISTER_MATCHER(isNoThrow);
339  REGISTER_MATCHER(isOverride);
340  REGISTER_MATCHER(isPrivate);
341  REGISTER_MATCHER(isProtected);
342  REGISTER_MATCHER(isPublic);
343  REGISTER_MATCHER(isPure);
344  REGISTER_MATCHER(isSignedInteger);
345  REGISTER_MATCHER(isStaticStorageClass);
346  REGISTER_MATCHER(isStruct);
348  REGISTER_MATCHER(isUnion);
349  REGISTER_MATCHER(isUnsignedInteger);
350  REGISTER_MATCHER(isVariadic);
351  REGISTER_MATCHER(isVirtual);
352  REGISTER_MATCHER(isVirtualAsWritten);
353  REGISTER_MATCHER(isVolatileQualified);
354  REGISTER_MATCHER(isWritten);
358  REGISTER_MATCHER(lValueReferenceType);
359  REGISTER_MATCHER(matchesName);
360  REGISTER_MATCHER(matchesSelector);
362  REGISTER_MATCHER(member);
364  REGISTER_MATCHER(memberPointerType);
368  REGISTER_MATCHER(namesType);
371  REGISTER_MATCHER(nullPointerConstant);
373  REGISTER_MATCHER(numSelectorArgs);
374  REGISTER_MATCHER(ofClass);
380  REGISTER_MATCHER(objcObjectPointerType);
383  REGISTER_MATCHER(on);
384  REGISTER_MATCHER(onImplicitObjectArgument);
386  REGISTER_MATCHER(parameterCountIs);
389  REGISTER_MATCHER(parenType);
391  REGISTER_MATCHER(pointee);
392  REGISTER_MATCHER(pointerType);
395  REGISTER_MATCHER(realFloatingPointType);
397  REGISTER_MATCHER(recordType);
398  REGISTER_MATCHER(referenceType);
399  REGISTER_MATCHER(refersToDeclaration);
400  REGISTER_MATCHER(refersToIntegralType);
401  REGISTER_MATCHER(refersToType);
402  REGISTER_MATCHER(requiresZeroInitialization);
403  REGISTER_MATCHER(returns);
405  REGISTER_MATCHER(rValueReferenceType);
407  REGISTER_MATCHER(specifiesNamespace);
408  REGISTER_MATCHER(specifiesType);
409  REGISTER_MATCHER(specifiesTypeLoc);
410  REGISTER_MATCHER(statementCountIs);
416  REGISTER_MATCHER(substTemplateTypeParmType);
421  REGISTER_MATCHER(templateArgumentCountIs);
422  REGISTER_MATCHER(templateSpecializationType);
424  REGISTER_MATCHER(templateTypeParmType);
425  REGISTER_MATCHER(throughUsingDecl);
426  REGISTER_MATCHER(to);
431  REGISTER_MATCHER(typedefType);
437  REGISTER_MATCHER(unaryTransformType);
447  REGISTER_MATCHER(variableArrayType);
448  REGISTER_MATCHER(voidType);
450  REGISTER_MATCHER(withInitializer);
451 }
452 
453 RegistryMaps::~RegistryMaps() {}
454 
455 static llvm::ManagedStatic<RegistryMaps> RegistryData;
456 
457 } // anonymous namespace
458 
459 // static
460 llvm::Optional<MatcherCtor> Registry::lookupMatcherCtor(StringRef MatcherName) {
461  auto it = RegistryData->constructors().find(MatcherName);
462  return it == RegistryData->constructors().end()
464  : it->second.get();
465 }
466 
467 namespace {
468 
469 llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
470  const std::set<ASTNodeKind> &KS) {
471  unsigned Count = 0;
472  for (std::set<ASTNodeKind>::const_iterator I = KS.begin(), E = KS.end();
473  I != E; ++I) {
474  if (I != KS.begin())
475  OS << "|";
476  if (Count++ == 3) {
477  OS << "...";
478  break;
479  }
480  OS << *I;
481  }
482  return OS;
483 }
484 
485 } // namespace
486 
487 std::vector<ArgKind> Registry::getAcceptedCompletionTypes(
488  ArrayRef<std::pair<MatcherCtor, unsigned>> Context) {
489  ASTNodeKind InitialTypes[] = {
490  ASTNodeKind::getFromNodeKind<Decl>(),
491  ASTNodeKind::getFromNodeKind<QualType>(),
492  ASTNodeKind::getFromNodeKind<Type>(),
493  ASTNodeKind::getFromNodeKind<Stmt>(),
494  ASTNodeKind::getFromNodeKind<NestedNameSpecifier>(),
495  ASTNodeKind::getFromNodeKind<NestedNameSpecifierLoc>(),
496  ASTNodeKind::getFromNodeKind<TypeLoc>()};
497 
498  // Starting with the above seed of acceptable top-level matcher types, compute
499  // the acceptable type set for the argument indicated by each context element.
500  std::set<ArgKind> TypeSet(std::begin(InitialTypes), std::end(InitialTypes));
501  for (const auto &CtxEntry : Context) {
502  MatcherCtor Ctor = CtxEntry.first;
503  unsigned ArgNumber = CtxEntry.second;
504  std::vector<ArgKind> NextTypeSet;
505  for (const ArgKind &Kind : TypeSet) {
506  if (Kind.getArgKind() == Kind.AK_Matcher &&
507  Ctor->isConvertibleTo(Kind.getMatcherKind()) &&
508  (Ctor->isVariadic() || ArgNumber < Ctor->getNumArgs()))
509  Ctor->getArgKinds(Kind.getMatcherKind(), ArgNumber, NextTypeSet);
510  }
511  TypeSet.clear();
512  TypeSet.insert(NextTypeSet.begin(), NextTypeSet.end());
513  }
514  return std::vector<ArgKind>(TypeSet.begin(), TypeSet.end());
515 }
516 
517 std::vector<MatcherCompletion>
518 Registry::getMatcherCompletions(ArrayRef<ArgKind> AcceptedTypes) {
519  std::vector<MatcherCompletion> Completions;
520 
521  // Search the registry for acceptable matchers.
522  for (const auto &M : RegistryData->constructors()) {
523  const MatcherDescriptor& Matcher = *M.getValue();
524  StringRef Name = M.getKey();
525 
526  std::set<ASTNodeKind> RetKinds;
527  unsigned NumArgs = Matcher.isVariadic() ? 1 : Matcher.getNumArgs();
528  bool IsPolymorphic = Matcher.isPolymorphic();
529  std::vector<std::vector<ArgKind>> ArgsKinds(NumArgs);
530  unsigned MaxSpecificity = 0;
531  for (const ArgKind& Kind : AcceptedTypes) {
532  if (Kind.getArgKind() != Kind.AK_Matcher)
533  continue;
534  unsigned Specificity;
535  ASTNodeKind LeastDerivedKind;
536  if (Matcher.isConvertibleTo(Kind.getMatcherKind(), &Specificity,
537  &LeastDerivedKind)) {
538  if (MaxSpecificity < Specificity)
539  MaxSpecificity = Specificity;
540  RetKinds.insert(LeastDerivedKind);
541  for (unsigned Arg = 0; Arg != NumArgs; ++Arg)
542  Matcher.getArgKinds(Kind.getMatcherKind(), Arg, ArgsKinds[Arg]);
543  if (IsPolymorphic)
544  break;
545  }
546  }
547 
548  if (!RetKinds.empty() && MaxSpecificity > 0) {
549  std::string Decl;
550  llvm::raw_string_ostream OS(Decl);
551 
552  if (IsPolymorphic) {
553  OS << "Matcher<T> " << Name << "(Matcher<T>";
554  } else {
555  OS << "Matcher<" << RetKinds << "> " << Name << "(";
556  for (const std::vector<ArgKind> &Arg : ArgsKinds) {
557  if (&Arg != &ArgsKinds[0])
558  OS << ", ";
559 
560  bool FirstArgKind = true;
561  std::set<ASTNodeKind> MatcherKinds;
562  // Two steps. First all non-matchers, then matchers only.
563  for (const ArgKind &AK : Arg) {
564  if (AK.getArgKind() == ArgKind::AK_Matcher) {
565  MatcherKinds.insert(AK.getMatcherKind());
566  } else {
567  if (!FirstArgKind) OS << "|";
568  FirstArgKind = false;
569  OS << AK.asString();
570  }
571  }
572  if (!MatcherKinds.empty()) {
573  if (!FirstArgKind) OS << "|";
574  OS << "Matcher<" << MatcherKinds << ">";
575  }
576  }
577  }
578  if (Matcher.isVariadic())
579  OS << "...";
580  OS << ")";
581 
582  std::string TypedText = Name;
583  TypedText += "(";
584  if (ArgsKinds.empty())
585  TypedText += ")";
586  else if (ArgsKinds[0][0].getArgKind() == ArgKind::AK_String)
587  TypedText += "\"";
588 
589  Completions.emplace_back(TypedText, OS.str(), MaxSpecificity);
590  }
591  }
592 
593  return Completions;
594 }
595 
596 // static
597 VariantMatcher Registry::constructMatcher(MatcherCtor Ctor,
598  SourceRange NameRange,
600  Diagnostics *Error) {
601  return Ctor->create(NameRange, Args, Error);
602 }
603 
604 // static
605 VariantMatcher Registry::constructBoundMatcher(MatcherCtor Ctor,
606  SourceRange NameRange,
607  StringRef BindID,
609  Diagnostics *Error) {
610  VariantMatcher Out = constructMatcher(Ctor, NameRange, Args, Error);
611  if (Out.isNull()) return Out;
612 
614  if (Result.hasValue()) {
615  llvm::Optional<DynTypedMatcher> Bound = Result->tryBind(BindID);
616  if (Bound.hasValue()) {
617  return VariantMatcher::SingleMatcher(*Bound);
618  }
619  }
620  Error->addError(NameRange, Error->ET_RegistryNotBindable);
621  return VariantMatcher();
622 }
623 
624 } // namespace dynamic
625 } // namespace ast_matchers
626 } // namespace clang
internal::TrueMatcher anything()
Matches any node.
Definition: ASTMatchers.h:133
const internal::ArgumentAdaptingMatcherFunc< internal::HasParentMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc > > LLVM_ATTRIBUTE_UNUSED hasParent
Matches AST nodes that have a parent that matches the provided matcher.
Definition: ASTMatchers.h:2510
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
Definition: ASTMatchers.h:1510
const internal::ArgumentAdaptingMatcherFunc< internal::HasAncestorMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc > > LLVM_ATTRIBUTE_UNUSED hasAncestor
Matches AST nodes that have an ancestor that matches the provided matcher.
Definition: ASTMatchers.h:2527
const internal::VariadicDynCastAllOfMatcher< Stmt, BreakStmt > breakStmt
Matches break statements.
Definition: ASTMatchers.h:1634
const internal::VariadicDynCastAllOfMatcher< Stmt, DoStmt > doStmt
Matches do statements.
Definition: ASTMatchers.h:1624
const internal::VariadicDynCastAllOfMatcher< Stmt, AddrLabelExpr > addrLabelExpr
Matches address of label statements (GNU extension).
Definition: ASTMatchers.h:1688
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryConditionalOperator > binaryConditionalOperator
Matches binary conditional operator expressions (GNU extension).
Definition: ASTMatchers.h:1917
const internal::VariadicDynCastAllOfMatcher< Stmt, StmtExpr > stmtExpr
Matches statement expression (GNU extension).
Definition: ASTMatchers.h:1877
const internal::ArgumentAdaptingMatcherFunc< internal::HasDescendantMatcher > LLVM_ATTRIBUTE_UNUSED hasDescendant
Matches AST nodes that have descendant AST nodes that match the provided matcher. ...
Definition: ASTMatchers.h:2424
const internal::VariadicAllOfMatcher< TemplateName > templateName
Matches template name.
Definition: ASTMatchers.h:457
const internal::VariadicAllOfMatcher< Stmt > stmt
Matches statements.
Definition: ASTMatchers.h:1051
Registry of all known matchers.
const internal::VariadicDynCastAllOfMatcher< Stmt, OpaqueValueExpr > opaqueValueExpr
Matches opaque value expressions.
Definition: ASTMatchers.h:1929
internal::PolymorphicMatcherWithParam1< internal::HasDeclarationMatcher, internal::Matcher< Decl >, void(internal::HasDeclarationSupportedTypes)> hasDeclaration(const internal::Matcher< Decl > &InnerMatcher)
Matches a node if the declaration associated with that node matches the given matcher.
Definition: ASTMatchers.h:2565
const internal::VariadicDynCastAllOfMatcher< Decl, CXXMethodDecl > cxxMethodDecl
Matches method declarations.
Definition: ASTMatchers.h:983
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNullPtrLiteralExpr > cxxNullPtrLiteralExpr
Matches nullptr literal.
Definition: ASTMatchers.h:1859
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDynamicCastExpr > cxxDynamicCastExpr
Matches a dynamic_cast expression.
Definition: ASTMatchers.h:1993
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:81
const internal::ArgumentAdaptingMatcherFunc< internal::ForEachMatcher > LLVM_ATTRIBUTE_UNUSED forEach
Matches AST nodes that have child AST nodes that match the provided matcher.
Definition: ASTMatchers.h:2444
const internal::VariadicDynCastAllOfMatcher< Stmt, LabelStmt > labelStmt
Matches label statements.
Definition: ASTMatchers.h:1676
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXThisExpr > cxxThisExpr
Matches implicit and explicit this expressions.
Definition: ASTMatchers.h:1405
const internal::VariadicDynCastAllOfMatcher< Decl, UsingDecl > usingDecl
Matches using declarations.
Definition: ASTMatchers.h:1291
const internal::VariadicDynCastAllOfMatcher< Decl, ValueDecl > valueDecl
Matches any value declaration.
Definition: ASTMatchers.h:925
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateDecl > classTemplateDecl
Matches C++ class template declarations.
Definition: ASTMatchers.h:373
const internal::VariadicDynCastAllOfMatcher< Decl, EnumConstantDecl > enumConstantDecl
Matches enum constants.
Definition: ASTMatchers.h:975
const DynTypedMatcher *const Matcher
const internal::VariadicDynCastAllOfMatcher< Decl, VarDecl > varDecl
Matches variable declarations.
Definition: ASTMatchers.h:1003
const internal::VariadicDynCastAllOfMatcher< Decl, TypeAliasDecl > typeAliasDecl
Matches type alias declarations.
Definition: ASTMatchers.h:181
const internal::VariadicDynCastAllOfMatcher< Stmt, AsmStmt > asmStmt
Matches asm statements.
Definition: ASTMatchers.h:1782
const internal::VariadicDynCastAllOfMatcher< Stmt, DesignatedInitExpr > designatedInitExpr
Matches C99 designated initializer expressions [C99 6.7.8].
Definition: ASTMatchers.h:2105
const internal::VariadicDynCastAllOfMatcher< Stmt, ConditionalOperator > conditionalOperator
Matches conditional operator expressions.
Definition: ASTMatchers.h:1907
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryExprOrTypeTraitExpr > unaryExprOrTypeTraitExpr
Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
Definition: ASTMatchers.h:2179
const internal::VariadicDynCastAllOfMatcher< Decl, TypeAliasTemplateDecl > typeAliasTemplateDecl
Matches type alias template declarations.
Definition: ASTMatchers.h:191
const internal::VariadicAllOfMatcher< QualType > qualType
Matches QualTypes in the clang AST.
Definition: ASTMatchers.h:2123
const internal::VariadicDynCastAllOfMatcher< Stmt, CaseStmt > caseStmt
Matches case statements inside switch statements.
Definition: ASTMatchers.h:1718
#define REGISTER_OVERLOADED_2(name)
Definition: Registry.cpp:71
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
Definition: ASTMatchers.h:281
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCMessageExpr > objcMessageExpr
Matches ObjectiveC Message invocation expressions.
Definition: ASTMatchers.h:1118
const internal::VariadicDynCastAllOfMatcher< Decl, CXXDestructorDecl > cxxDestructorDecl
Matches explicit C++ destructor declarations.
Definition: ASTMatchers.h:953
const internal::VariadicDynCastAllOfMatcher< Stmt, WhileStmt > whileStmt
Matches while statements.
Definition: ASTMatchers.h:1614
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXTryStmt > cxxTryStmt
Matches try statements.
Definition: ASTMatchers.h:1754
const internal::VariadicDynCastAllOfMatcher< Stmt, CompoundLiteralExpr > compoundLiteralExpr
Matches compound (i.e.
Definition: ASTMatchers.h:1854
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXReinterpretCastExpr > cxxReinterpretCastExpr
Matches a reinterpret_cast expression.
Definition: ASTMatchers.h:1960
const internal::VariadicDynCastAllOfMatcher< Stmt, NullStmt > nullStmt
Matches null statements.
Definition: ASTMatchers.h:1772
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNewExpr > cxxNewExpr
Matches new expressions.
Definition: ASTMatchers.h:1449
const internal::VariadicDynCastAllOfMatcher< Decl, NamedDecl > namedDecl
Matches a declaration of anything that could have a name.
Definition: ASTMatchers.h:305
const internal::VariadicDynCastAllOfMatcher< Decl, TypedefDecl > typedefDecl
Matches typedef declarations.
Definition: ASTMatchers.h:158
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXMemberCallExpr > cxxMemberCallExpr
Matches member call expressions.
Definition: ASTMatchers.h:1105
const internal::VariadicOperatorMatcherFunc< 2, UINT_MAX > eachOf
Matches if any of the given matchers matches.
Definition: ASTMatchers.h:2150
const internal::VariadicDynCastAllOfMatcher< Stmt, DefaultStmt > defaultStmt
Matches default statements inside switch statements.
Definition: ASTMatchers.h:1728
const internal::VariadicDynCastAllOfMatcher< Stmt, ExprWithCleanups > exprWithCleanups
Matches expressions that introduce cleanups to be run at the end of the sub-expression's evaluation...
Definition: ASTMatchers.h:1203
const internal::VariadicDynCastAllOfMatcher< Stmt, CompoundStmt > compoundStmt
Matches compound statements.
Definition: ASTMatchers.h:1736
const internal::VariadicDynCastAllOfMatcher< Decl, ParmVarDecl > parmVarDecl
Matches parameter variable declarations.
Definition: ASTMatchers.h:409
const internal::VariadicDynCastAllOfMatcher< Stmt, ReturnStmt > returnStmt
Matches return statements.
Definition: ASTMatchers.h:1654
const internal::VariadicDynCastAllOfMatcher< Decl, TranslationUnitDecl > translationUnitDecl
Matches the top declaration context.
Definition: ASTMatchers.h:147
const internal::VariadicDynCastAllOfMatcher< Decl, FriendDecl > friendDecl
Matches friend declarations.
Definition: ASTMatchers.h:1041
internal::Matcher< Stmt > sizeOfExpr(const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher)
Same as unaryExprOrTypeTraitExpr, but only matching sizeof.
Definition: ASTMatchers.h:2218
Functions templates and classes to wrap matcher construct functions.
const internal::VariadicDynCastAllOfMatcher< Decl, StaticAssertDecl > staticAssertDecl
Matches a C++ static_assert declaration.
Definition: ASTMatchers.h:1946
const internal::VariadicDynCastAllOfMatcher< Decl, LabelDecl > labelDecl
Matches a declaration of label.
Definition: ASTMatchers.h:316
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclStmt > declStmt
Matches declaration statements.
Definition: ASTMatchers.h:1063
internal::PolymorphicMatcherWithParam1< internal::HasOverloadedOperatorNameMatcher, StringRef, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXOperatorCallExpr, FunctionDecl)> hasOverloadedOperatorName(StringRef Name)
Matches overloaded operator names.
Definition: ASTMatchers.h:2304
detail::InMemoryDirectory::const_iterator I
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryOperator > unaryOperator
Matches unary operator expressions.
Definition: ASTMatchers.h:1897
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXStdInitializerListExpr > cxxStdInitializerListExpr
Matches C++ initializer list expressions.
Definition: ASTMatchers.h:1238
const internal::VariadicDynCastAllOfMatcher< Stmt, MemberExpr > memberExpr
Matches member expressions.
Definition: ASTMatchers.h:1076
bool isNull() const
Whether the matcher is null.
Definition: VariantValue.h:159
const internal::VariadicDynCastAllOfMatcher< Stmt, InitListExpr > initListExpr
Matches init list expressions.
Definition: ASTMatchers.h:1215
const internal::VariadicOperatorMatcherFunc< 2, UINT_MAX > allOf
Matches if all given matchers match.
Definition: ASTMatchers.h:2164
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXFunctionalCastExpr > cxxFunctionalCastExpr
Matches functional cast expressions.
Definition: ASTMatchers.h:2075
const internal::VariadicDynCastAllOfMatcher< Stmt, ArraySubscriptExpr > arraySubscriptExpr
Matches array subscript expressions.
Definition: ASTMatchers.h:1471
ASTContext * Context
const internal::VariadicDynCastAllOfMatcher< Stmt, LambdaExpr > lambdaExpr
Matches lambda expressions.
Definition: ASTMatchers.h:1094
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryOperator > binaryOperator
Matches binary operator expressions.
Definition: ASTMatchers.h:1887
const internal::VariadicAllOfMatcher< NestedNameSpecifier > nestedNameSpecifier
Matches nested name specifiers.
Definition: ASTMatchers.h:5251
bool equals(const til::SExpr *E1, const til::SExpr *E2)
const internal::ArgumentAdaptingMatcherFunc< internal::ForEachDescendantMatcher > LLVM_ATTRIBUTE_UNUSED forEachDescendant
Matches AST nodes that have descendant AST nodes that match the provided matcher. ...
Definition: ASTMatchers.h:2473
const internal::VariadicDynCastAllOfMatcher< Stmt, IntegerLiteral > integerLiteral
Matches integer literals of all sizes / encodings, e.g.
Definition: ASTMatchers.h:1825
const internal::VariadicDynCastAllOfMatcher< Stmt, ForStmt > forStmt
Matches for statements.
Definition: ASTMatchers.h:1536
MatchFinder::MatchCallback * Callback
const internal::VariadicOperatorMatcherFunc< 1, 1 > unless
Matches if the provided matcher does not match.
Definition: ASTMatchers.h:2538
const internal::VariadicAllOfMatcher< NestedNameSpecifierLoc > nestedNameSpecifierLoc
Same as nestedNameSpecifier but matches NestedNameSpecifierLoc.
Definition: ASTMatchers.h:5255
const internal::VariadicDynCastAllOfMatcher< Stmt, GotoStmt > gotoStmt
Matches goto statements.
Definition: ASTMatchers.h:1665
#define REGISTER_MATCHER(name)
Definition: Registry.cpp:55
const internal::VariadicDynCastAllOfMatcher< Decl, RecordDecl > recordDecl
Matches class, struct, and union declarations.
Definition: ASTMatchers.h:352
virtual VariantMatcher create(SourceRange NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error) const =0
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXTemporaryObjectExpr > cxxTemporaryObjectExpr
Matches functional cast expressions having N != 1 arguments.
Definition: ASTMatchers.h:2085
const internal::VariadicDynCastAllOfMatcher< Stmt, PredefinedExpr > predefinedExpr
Matches predefined identifier expressions [C99 6.4.2.2].
Definition: ASTMatchers.h:2095
const internal::VariadicDynCastAllOfMatcher< Stmt, MaterializeTemporaryExpr > materializeTemporaryExpr
Matches nodes where temporaries are materialized.
Definition: ASTMatchers.h:1439
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXForRangeStmt > cxxForRangeStmt
Matches range-based for statements.
Definition: ASTMatchers.h:1576
const internal::VariadicFunction< internal::Matcher< NamedDecl >, StringRef, internal::hasAnyNameFunc > hasAnyName
Matches NamedDecl nodes that have any of the specified names.
Definition: ASTMatchers.h:2257
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXStaticCastExpr > cxxStaticCastExpr
Matches a C++ static_cast expression.
Definition: ASTMatchers.h:1977
const internal::VariadicDynCastAllOfMatcher< Stmt, AtomicExpr > atomicExpr
Matches atomic builtins.
Definition: ASTMatchers.h:1869
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
Definition: Specifiers.h:166
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCProtocolDecl > objcProtocolDecl
Matches Objective-C protocol declarations.
Definition: ASTMatchers.h:1140
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDeleteExpr > cxxDeleteExpr
Matches delete expressions.
Definition: ASTMatchers.h:1459
const internal::VariadicDynCastAllOfMatcher< Stmt, SwitchCase > switchCase
Matches case and default statements inside switch statements.
Definition: ASTMatchers.h:1708
Helper class to manage error messages.
Definition: Diagnostics.h:51
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCInterfaceDecl > objcInterfaceDecl
Matches Objective-C interface declarations.
Definition: ASTMatchers.h:1129
const internal::VariadicAllOfMatcher< TypeLoc > typeLoc
Matches TypeLocs in the clang AST.
Definition: ASTMatchers.h:2129
ArgStream addError(SourceRange Range, ErrorType Error)
Add an error to the diagnostics.
Definition: Diagnostics.cpp:66
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBindTemporaryExpr > cxxBindTemporaryExpr
Matches nodes where temporaries are created.
Definition: ASTMatchers.h:1417
const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingValueDecl > unresolvedUsingValueDecl
Matches unresolved using value declarations.
Definition: ASTMatchers.h:1337
Kind
const internal::VariadicDynCastAllOfMatcher< Stmt, CharacterLiteral > characterLiteral
Matches character literals (also matches wchar_t).
Definition: ASTMatchers.h:1817
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclRefExpr > declRefExpr
Matches expressions that refer to declarations.
Definition: ASTMatchers.h:1519
const internal::VariadicAllOfMatcher< CXXCtorInitializer > cxxCtorInitializer
Matches constructor initializers.
Definition: ASTMatchers.h:435
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXThrowExpr > cxxThrowExpr
Matches throw expressions.
Definition: ASTMatchers.h:1763
const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitCastExpr > implicitCastExpr
Matches the implicit cast nodes of Clang's AST.
Definition: ASTMatchers.h:2048
const internal::ArgumentAdaptingMatcherFunc< internal::HasMatcher > LLVM_ATTRIBUTE_UNUSED has
Matches AST nodes that have child AST nodes that match the provided matcher.
Definition: ASTMatchers.h:2407
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXOperatorCallExpr > cxxOperatorCallExpr
Matches overloaded operator calls.
Definition: ASTMatchers.h:1502
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateSpecializationDecl > classTemplateSpecializationDecl
Matches C++ class template specializations.
Definition: ASTMatchers.h:387
internal::Matcher< Stmt > alignOfExpr(const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher)
Same as unaryExprOrTypeTraitExpr, but only matching alignof.
Definition: ASTMatchers.h:2210
static bool hasAttr(const FunctionDecl *D, bool IgnoreImplicitAttr)
Definition: SemaCUDA.cpp:97
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionDecl > functionDecl
Matches function declarations.
Definition: ASTMatchers.h:1021
const internal::VariadicDynCastAllOfMatcher< Decl, CXXConstructorDecl > cxxConstructorDecl
Matches C++ constructor declarations.
Definition: ASTMatchers.h:940
const internal::VariadicDynCastAllOfMatcher< Decl, AccessSpecDecl > accessSpecDecl
Matches C++ access specifier declarations.
Definition: ASTMatchers.h:424
virtual bool isVariadic() const =0
Returns whether the matcher is variadic.
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCPropertyDecl > objcPropertyDecl
Matches Objective-C property declarations.
Definition: ASTMatchers.h:1192
const internal::VariadicDynCastAllOfMatcher< Stmt, ExplicitCastExpr > explicitCastExpr
Matches explicit cast expressions.
Definition: ASTMatchers.h:2040
const internal::VariadicDynCastAllOfMatcher< Stmt, SubstNonTypeTemplateParmExpr > substNonTypeTemplateParmExpr
Matches substitutions of non-type template parameters.
Definition: ASTMatchers.h:1280
virtual unsigned getNumArgs() const =0
Returns the number of arguments accepted by the matcher if not variadic.
const internal::VariadicDynCastAllOfMatcher< Stmt, StringLiteral > stringLiteral
Matches string literals (also matches wide string literals).
Definition: ASTMatchers.h:1803
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDefaultArgExpr > cxxDefaultArgExpr
Matches the value of a default argument at the call site.
Definition: ASTMatchers.h:1484
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstCastExpr > cxxConstCastExpr
Matches a const_cast expression.
Definition: ASTMatchers.h:2005
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionTemplateDecl > functionTemplateDecl
Matches C++ function template declarations.
Definition: ASTMatchers.h:1031
StringRef Name
Definition: USRFinder.cpp:123
const internal::VariadicDynCastAllOfMatcher< Decl, EnumDecl > enumDecl
Matches enum declarations.
Definition: ASTMatchers.h:963
const internal::VariadicDynCastAllOfMatcher< Stmt, ParenExpr > parenExpr
Matches parentheses used in expressions.
Definition: ASTMatchers.h:1367
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
Definition: ASTMatchers.h:2126
const internal::VariadicDynCastAllOfMatcher< Decl, TemplateTypeParmDecl > templateTypeParmDecl
Matches template type parameter declarations.
Definition: ASTMatchers.h:481
detail::InMemoryDirectory::const_iterator E
const internal::VariadicDynCastAllOfMatcher< Stmt, CUDAKernelCallExpr > cudaKernelCallExpr
Matches CUDA kernel call expression.
Definition: ASTMatchers.h:5617
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCIvarDecl > objcIvarDecl
Matches Objective-C instance variable declarations.
Definition: ASTMatchers.h:1180
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXUnresolvedConstructExpr > cxxUnresolvedConstructExpr
Matches unresolved constructor call expressions.
Definition: ASTMatchers.h:1393
const internal::VariadicDynCastAllOfMatcher< Decl, UsingDirectiveDecl > usingDirectiveDecl
Matches using namespace declarations.
Definition: ASTMatchers.h:1304
const internal::VariadicDynCastAllOfMatcher< Stmt, CStyleCastExpr > cStyleCastExpr
Matches a C-style cast expression.
Definition: ASTMatchers.h:2015
const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingTypenameDecl > unresolvedUsingTypenameDecl
Matches unresolved using value declarations that involve the typename.
Definition: ASTMatchers.h:1356
#define MATCHER_OVERLOAD_ENTRY(name, Id)
Definition: Registry.cpp:67
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstructExpr > cxxConstructExpr
Matches constructor call expressions (including implicit ones).
Definition: ASTMatchers.h:1381
const internal::VariadicDynCastAllOfMatcher< Stmt, FloatingLiteral > floatLiteral
Matches float literals of all sizes / encodings, e.g.
Definition: ASTMatchers.h:1836
const internal::VariadicDynCastAllOfMatcher< Stmt, IfStmt > ifStmt
Matches if statements.
Definition: ASTMatchers.h:1527
const internal::VariadicDynCastAllOfMatcher< Stmt, CallExpr > callExpr
Matches call expressions.
Definition: ASTMatchers.h:1086
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCCategoryDecl > objcCategoryDecl
Matches Objective-C category declarations.
Definition: ASTMatchers.h:1151
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXCatchStmt > cxxCatchStmt
Matches catch statements.
Definition: ASTMatchers.h:1745
internal::Matcher< BinaryOperator > hasEitherOperand(const internal::Matcher< Expr > &InnerMatcher)
Matches if either the left hand side or the right hand side of a binary operator matches.
Definition: ASTMatchers.h:3916
const internal::VariadicOperatorMatcherFunc< 2, UINT_MAX > anyOf
Matches if any of the given matchers matches.
Definition: ASTMatchers.h:2157
const internal::VariadicDynCastAllOfMatcher< Stmt, ContinueStmt > continueStmt
Matches continue statements.
Definition: ASTMatchers.h:1644
const internal::VariadicAllOfMatcher< TemplateArgument > templateArgument
Matches template arguments.
Definition: ASTMatchers.h:446
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
Definition: ASTMatchers.h:2063
internal::Matcher< NamedDecl > hasName(const std::string &Name)
Matches NamedDecl nodes that have the specified name.
Definition: ASTMatchers.h:2239
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCMethodDecl > objcMethodDecl
Matches Objective-C method declarations.
Definition: ASTMatchers.h:1167
const internal::VariadicDynCastAllOfMatcher< Decl, TypedefNameDecl > typedefNameDecl
Matches typedef name declarations.
Definition: ASTMatchers.h:170
const internal::VariadicDynCastAllOfMatcher< Stmt, ParenListExpr > parenListExpr
Matches paren list expressions.
Definition: ASTMatchers.h:1266
const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitValueInitExpr > implicitValueInitExpr
Matches implicit initializers of init list expressions.
Definition: ASTMatchers.h:1249
raw_ostream & operator<<(raw_ostream &OS, ASTNodeKind K)
const internal::VariadicDynCastAllOfMatcher< Decl, CXXConversionDecl > cxxConversionDecl
Matches conversion operator declarations.
Definition: ASTMatchers.h:992
const internal::VariadicDynCastAllOfMatcher< Decl, NamespaceDecl > namespaceDecl
Matches a declaration of a namespace.
Definition: ASTMatchers.h:327
const internal::VariadicDynCastAllOfMatcher< Stmt, UserDefinedLiteral > userDefinedLiteral
Matches user defined literal operator call.
Definition: ASTMatchers.h:1843
const internal::VariadicDynCastAllOfMatcher< Stmt, SwitchStmt > switchStmt
Matches switch statements.
Definition: ASTMatchers.h:1698
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBoolLiteralExpr > cxxBoolLiteral
Matches bool literals.
Definition: ASTMatchers.h:1792
const internal::VariadicDynCastAllOfMatcher< Decl, FieldDecl > fieldDecl
Matches field declarations.
Definition: ASTMatchers.h:1013
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: ASTMatchers.h:1322
ConstructorMap Constructors
Definition: Registry.cpp:46
virtual void getArgKinds(ast_type_traits::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...
const internal::VariadicDynCastAllOfMatcher< Decl, NamespaceAliasDecl > namespaceAliasDecl
Matches a declaration of a namespace alias.
Definition: ASTMatchers.h:339
virtual bool isConvertibleTo(ast_type_traits::ASTNodeKind Kind, unsigned *Specificity=nullptr, ast_type_traits::ASTNodeKind *LeastDerivedKind=nullptr) const =0
Returns whether this matcher is convertible to the given type.
const internal::VariadicDynCastAllOfMatcher< Decl, CXXRecordDecl > cxxRecordDecl
Matches C++ class declarations.
Definition: ASTMatchers.h:363
const internal::VariadicDynCastAllOfMatcher< Decl, DeclaratorDecl > declaratorDecl
Matches declarator declarations (field, variable, function and non-type template parameter declaratio...
Definition: ASTMatchers.h:399
const NamedDecl * Result
Definition: USRFinder.cpp:70
llvm::Optional< DynTypedMatcher > getSingleMatcher() const
Return a single matcher, if there is no ambiguity.
static bool isExternC(const NamedDecl *ND)
Definition: Mangle.cpp:60
#define REGISTER_MATCHER_OVERLOAD(name)
Definition: Registry.cpp:59
const internal::VariadicDynCastAllOfMatcher< Stmt, GNUNullExpr > gnuNullExpr
Matches GNU __null expression.
Definition: ASTMatchers.h:1862