clang 8.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 /// Registry map populated at static initialization time.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "clang/ASTMatchers/Dynamic/Registry.h"
16 #include "Marshallers.h"
17 #include "clang/AST/ASTTypeTraits.h"
18 #include "clang/ASTMatchers/ASTMatchers.h"
19 #include "clang/ASTMatchers/Dynamic/Diagnostics.h"
20 #include "clang/ASTMatchers/Dynamic/VariantValue.h"
21 #include "llvm/ADT/Optional.h"
22 #include "llvm/ADT/STLExtras.h"
23 #include "llvm/ADT/StringMap.h"
24 #include "llvm/ADT/StringRef.h"
25 #include "llvm/Support/ManagedStatic.h"
26 #include "llvm/Support/raw_ostream.h"
27 #include <cassert>
28 #include <iterator>
29 #include <memory>
30 #include <set>
31 #include <string>
32 #include <utility>
33 #include <vector>
34
35 using namespace clang::ast_type_traits;
36
37 namespace clang {
38 namespace ast_matchers {
39 namespace dynamic {
40
41 namespace {
42
43 using internal::MatcherDescriptor;
44
45 using ConstructorMap = llvm::StringMap<std::unique_ptr<const MatcherDescriptor>>;
46
47 class RegistryMaps {
48 public:
49 RegistryMaps();
50 ~RegistryMaps();
51
52 const ConstructorMap &constructors() const { return Constructors; }
53
54 private:
55 void registerMatcher(StringRef MatcherName,
56 std::unique_ptr<MatcherDescriptor> Callback);
57
58 ConstructorMap Constructors;
59 };
60
61 } // namespace
62
63 void RegistryMaps::registerMatcher(
64 StringRef MatcherName, std::unique_ptr<MatcherDescriptor> Callback) {
65 assert(Constructors.find(MatcherName) == Constructors.end());
66 Constructors[MatcherName] = std::move(Callback);
67 }
68
69 #define REGISTER_MATCHER(name) \
70 registerMatcher(#name, internal::makeMatcherAutoMarshall( \
71 ::clang::ast_matchers::name, #name));
72
73 #define REGISTER_MATCHER_OVERLOAD(name) \
74 registerMatcher(#name, \
75 llvm::make_unique<internal::OverloadedMatcherDescriptor>(name##Callbacks))
76
77 #define SPECIFIC_MATCHER_OVERLOAD(name, Id) \
78 static_cast<::clang::ast_matchers::name##_Type##Id>( \
79 ::clang::ast_matchers::name)
80
81 #define MATCHER_OVERLOAD_ENTRY(name, Id) \
82 internal::makeMatcherAutoMarshall(SPECIFIC_MATCHER_OVERLOAD(name, Id), \
83 #name)
84
85 #define REGISTER_OVERLOADED_2(name) \
86 do { \
87 std::unique_ptr<MatcherDescriptor> name##Callbacks[] = { \
88 MATCHER_OVERLOAD_ENTRY(name, 0), \
89 MATCHER_OVERLOAD_ENTRY(name, 1)}; \
90 REGISTER_MATCHER_OVERLOAD(name); \
91 } while (false)
92
93 /// Generate a registry map with all the known matchers.
94 RegistryMaps::RegistryMaps() {
95 // TODO: Here is the list of the missing matchers, grouped by reason.
96 //
97 // Need Variant/Parser fixes:
98 // ofKind
99 //
100 // Polymorphic + argument overload:
101 // findAll
102 //
103 // Other:
104 // equalsNode
105
106 REGISTER_OVERLOADED_2(callee);
107 REGISTER_OVERLOADED_2(hasPrefix);
108 REGISTER_OVERLOADED_2(hasType);
109 REGISTER_OVERLOADED_2(ignoringParens);
110 REGISTER_OVERLOADED_2(isDerivedFrom);
111 REGISTER_OVERLOADED_2(isSameOrDerivedFrom);
112 REGISTER_OVERLOADED_2(loc);
113 REGISTER_OVERLOADED_2(pointsTo);
114 REGISTER_OVERLOADED_2(references);
115 REGISTER_OVERLOADED_2(thisPointerType);
116
117 std::unique_ptr<MatcherDescriptor> equalsCallbacks[] = {
118 MATCHER_OVERLOAD_ENTRY(equals, 0),
119 MATCHER_OVERLOAD_ENTRY(equals, 1),
120 MATCHER_OVERLOAD_ENTRY(equals, 2),
121 };
122 REGISTER_MATCHER_OVERLOAD(equals);
123
124 REGISTER_MATCHER(accessSpecDecl);
125 REGISTER_MATCHER(addrLabelExpr);
126 REGISTER_MATCHER(alignOfExpr);
127 REGISTER_MATCHER(allOf);
128 REGISTER_MATCHER(anyOf);
129 REGISTER_MATCHER(anything);
130 REGISTER_MATCHER(argumentCountIs);
131 REGISTER_MATCHER(arraySubscriptExpr);
132 REGISTER_MATCHER(arrayType);
133 REGISTER_MATCHER(asmStmt);
134 REGISTER_MATCHER(asString);
135 REGISTER_MATCHER(atomicExpr);
136 REGISTER_MATCHER(atomicType);
137 REGISTER_MATCHER(autoreleasePoolStmt)
138 REGISTER_MATCHER(autoType);
139 REGISTER_MATCHER(binaryConditionalOperator);
140 REGISTER_MATCHER(binaryOperator);
141 REGISTER_MATCHER(blockDecl);
142 REGISTER_MATCHER(blockExpr);
143 REGISTER_MATCHER(blockPointerType);
144 REGISTER_MATCHER(booleanType);
145 REGISTER_MATCHER(breakStmt);
146 REGISTER_MATCHER(builtinType);
147 REGISTER_MATCHER(callExpr);
148 REGISTER_MATCHER(caseStmt);
149 REGISTER_MATCHER(castExpr);
150 REGISTER_MATCHER(characterLiteral);
151 REGISTER_MATCHER(classTemplateDecl);
152 REGISTER_MATCHER(classTemplateSpecializationDecl);
153 REGISTER_MATCHER(complexType);
154 REGISTER_MATCHER(compoundLiteralExpr);
155 REGISTER_MATCHER(compoundStmt);
156 REGISTER_MATCHER(conditionalOperator);
157 REGISTER_MATCHER(constantArrayType);
158 REGISTER_MATCHER(constantExpr);
159 REGISTER_MATCHER(containsDeclaration);
160 REGISTER_MATCHER(continueStmt);
161 REGISTER_MATCHER(cStyleCastExpr);
162 REGISTER_MATCHER(cudaKernelCallExpr);
163 REGISTER_MATCHER(cxxBindTemporaryExpr);
164 REGISTER_MATCHER(cxxBoolLiteral);
165 REGISTER_MATCHER(cxxCatchStmt);
166 REGISTER_MATCHER(cxxConstCastExpr);
167 REGISTER_MATCHER(cxxConstructExpr);
168 REGISTER_MATCHER(cxxConstructorDecl);
169 REGISTER_MATCHER(cxxConversionDecl);
170 REGISTER_MATCHER(cxxCtorInitializer);
171 REGISTER_MATCHER(cxxDefaultArgExpr);
172 REGISTER_MATCHER(cxxDeleteExpr);
173 REGISTER_MATCHER(cxxDependentScopeMemberExpr);
174 REGISTER_MATCHER(cxxDestructorDecl);
175 REGISTER_MATCHER(cxxDynamicCastExpr);
176 REGISTER_MATCHER(cxxForRangeStmt);
177 REGISTER_MATCHER(cxxFunctionalCastExpr);
178 REGISTER_MATCHER(cxxMemberCallExpr);
179 REGISTER_MATCHER(cxxMethodDecl);
180 REGISTER_MATCHER(cxxNewExpr);
181 REGISTER_MATCHER(cxxNullPtrLiteralExpr);
182 REGISTER_MATCHER(cxxOperatorCallExpr);
183 REGISTER_MATCHER(cxxRecordDecl);
184 REGISTER_MATCHER(cxxReinterpretCastExpr);
185 REGISTER_MATCHER(cxxStaticCastExpr);
186 REGISTER_MATCHER(cxxStdInitializerListExpr);
187 REGISTER_MATCHER(cxxTemporaryObjectExpr);
188 REGISTER_MATCHER(cxxThisExpr);
189 REGISTER_MATCHER(cxxThrowExpr);
190 REGISTER_MATCHER(cxxTryStmt);
191 REGISTER_MATCHER(cxxUnresolvedConstructExpr);
192 REGISTER_MATCHER(decayedType);
193 REGISTER_MATCHER(decl);
194 REGISTER_MATCHER(declaratorDecl);
195 REGISTER_MATCHER(declCountIs);
196 REGISTER_MATCHER(declRefExpr);
197 REGISTER_MATCHER(declStmt);
198 REGISTER_MATCHER(decltypeType);
199 REGISTER_MATCHER(defaultStmt);
200 REGISTER_MATCHER(dependentSizedArrayType);
201 REGISTER_MATCHER(designatedInitExpr);
202 REGISTER_MATCHER(designatorCountIs);
203 REGISTER_MATCHER(doStmt);
204 REGISTER_MATCHER(eachOf);
205 REGISTER_MATCHER(elaboratedType);
206 REGISTER_MATCHER(enumConstantDecl);
207 REGISTER_MATCHER(enumDecl);
208 REGISTER_MATCHER(enumType);
209 REGISTER_MATCHER(equalsBoundNode);
210 REGISTER_MATCHER(equalsIntegralValue);
211 REGISTER_MATCHER(explicitCastExpr);
212 REGISTER_MATCHER(expr);
213 REGISTER_MATCHER(exprWithCleanups);
214 REGISTER_MATCHER(fieldDecl);
215 REGISTER_MATCHER(indirectFieldDecl);
216 REGISTER_MATCHER(floatLiteral);
217 REGISTER_MATCHER(forEach);
218 REGISTER_MATCHER(forEachArgumentWithParam);
219 REGISTER_MATCHER(forEachConstructorInitializer);
220 REGISTER_MATCHER(forEachDescendant);
221 REGISTER_MATCHER(forEachOverridden);
222 REGISTER_MATCHER(forEachSwitchCase);
223 REGISTER_MATCHER(forField);
224 REGISTER_MATCHER(forFunction);
225 REGISTER_MATCHER(forStmt);
226 REGISTER_MATCHER(friendDecl);
227 REGISTER_MATCHER(functionDecl);
228 REGISTER_MATCHER(functionProtoType);
229 REGISTER_MATCHER(functionTemplateDecl);
230 REGISTER_MATCHER(functionType);
231 REGISTER_MATCHER(gnuNullExpr);
232 REGISTER_MATCHER(gotoStmt);
233 REGISTER_MATCHER(has);
234 REGISTER_MATCHER(hasAncestor);
235 REGISTER_MATCHER(hasAnyArgument);
236 REGISTER_MATCHER(hasAnyConstructorInitializer);
237 REGISTER_MATCHER(hasAnyDeclaration);
238 REGISTER_MATCHER(hasAnyName);
239 REGISTER_MATCHER(hasAnyParameter);
240 REGISTER_MATCHER(hasAnySelector);
241 REGISTER_MATCHER(hasAnySubstatement);
242 REGISTER_MATCHER(hasAnyTemplateArgument);
243 REGISTER_MATCHER(hasAnyUsingShadowDecl);
244 REGISTER_MATCHER(hasArgument);
245 REGISTER_MATCHER(hasArgumentOfType);
246 REGISTER_MATCHER(hasArraySize);
247 REGISTER_MATCHER(hasAttr);
248 REGISTER_MATCHER(hasAutomaticStorageDuration);
249 REGISTER_MATCHER(hasBase);
250 REGISTER_MATCHER(hasBitWidth);
251 REGISTER_MATCHER(hasBody);
252 REGISTER_MATCHER(hasCanonicalType);
253 REGISTER_MATCHER(hasCaseConstant);
254 REGISTER_MATCHER(hasCastKind);
255 REGISTER_MATCHER(hasCondition);
256 REGISTER_MATCHER(hasConditionVariableStatement);
257 REGISTER_MATCHER(hasDecayedType);
258 REGISTER_MATCHER(hasDeclaration);
259 REGISTER_MATCHER(hasDeclContext);
260 REGISTER_MATCHER(hasDeducedType);
261 REGISTER_MATCHER(hasDefaultArgument);
262 REGISTER_MATCHER(hasDefinition);
263 REGISTER_MATCHER(hasDescendant);
264 REGISTER_MATCHER(hasDestinationType);
265 REGISTER_MATCHER(hasDynamicExceptionSpec);
266 REGISTER_MATCHER(hasEitherOperand);
267 REGISTER_MATCHER(hasElementType);
268 REGISTER_MATCHER(hasElse);
269 REGISTER_MATCHER(hasExternalFormalLinkage);
270 REGISTER_MATCHER(hasFalseExpression);
271 REGISTER_MATCHER(hasGlobalStorage);
272 REGISTER_MATCHER(hasImplicitDestinationType);
273 REGISTER_MATCHER(hasInClassInitializer);
274 REGISTER_MATCHER(hasIncrement);
275 REGISTER_MATCHER(hasIndex);
276 REGISTER_MATCHER(hasInit);
277 REGISTER_MATCHER(hasInitializer);
278 REGISTER_MATCHER(hasKeywordSelector);
279 REGISTER_MATCHER(hasLHS);
280 REGISTER_MATCHER(hasLocalQualifiers);
281 REGISTER_MATCHER(hasLocalStorage);
282 REGISTER_MATCHER(hasLoopInit);
283 REGISTER_MATCHER(hasLoopVariable);
284 REGISTER_MATCHER(hasMethod);
285 REGISTER_MATCHER(hasName);
286 REGISTER_MATCHER(hasNullSelector);
287 REGISTER_MATCHER(hasObjectExpression);
288 REGISTER_MATCHER(hasOperatorName);
289 REGISTER_MATCHER(hasOverloadedOperatorName);
290 REGISTER_MATCHER(hasParameter);
291 REGISTER_MATCHER(hasParent);
292 REGISTER_MATCHER(hasQualifier);
293 REGISTER_MATCHER(hasRangeInit);
294 REGISTER_MATCHER(hasReceiver);
295 REGISTER_MATCHER(hasReceiverType);
296 REGISTER_MATCHER(hasReplacementType);
297 REGISTER_MATCHER(hasReturnValue);
298 REGISTER_MATCHER(hasRHS);
299 REGISTER_MATCHER(hasSelector);
300 REGISTER_MATCHER(hasSingleDecl);
301 REGISTER_MATCHER(hasSize);
302 REGISTER_MATCHER(hasSizeExpr);
303 REGISTER_MATCHER(hasSourceExpression);
304 REGISTER_MATCHER(hasSpecializedTemplate);
305 REGISTER_MATCHER(hasStaticStorageDuration);
306 REGISTER_MATCHER(hasSyntacticForm);
307 REGISTER_MATCHER(hasTargetDecl);
308 REGISTER_MATCHER(hasTemplateArgument);
309 REGISTER_MATCHER(hasThen);
310 REGISTER_MATCHER(hasThreadStorageDuration);
311 REGISTER_MATCHER(hasTrailingReturn);
312 REGISTER_MATCHER(hasTrueExpression);
313 REGISTER_MATCHER(hasTypeLoc);
314 REGISTER_MATCHER(hasUnaryOperand);
315 REGISTER_MATCHER(hasUnarySelector);
316 REGISTER_MATCHER(hasUnderlyingDecl);
317 REGISTER_MATCHER(hasUnderlyingType);
318 REGISTER_MATCHER(hasUnqualifiedDesugaredType);
319 REGISTER_MATCHER(hasValueType);
320 REGISTER_MATCHER(ifStmt);
321 REGISTER_MATCHER(ignoringImpCasts);
322 REGISTER_MATCHER(ignoringImplicit);
323 REGISTER_MATCHER(ignoringParenCasts);
324 REGISTER_MATCHER(ignoringParenImpCasts);
325 REGISTER_MATCHER(imaginaryLiteral);
326 REGISTER_MATCHER(implicitCastExpr);
327 REGISTER_MATCHER(implicitValueInitExpr);
328 REGISTER_MATCHER(incompleteArrayType);
329 REGISTER_MATCHER(initListExpr);
330 REGISTER_MATCHER(injectedClassNameType);
331 REGISTER_MATCHER(innerType);
332 REGISTER_MATCHER(integerLiteral);
333 REGISTER_MATCHER(isAnonymous);
334 REGISTER_MATCHER(isAnyCharacter);
335 REGISTER_MATCHER(isAnyPointer);
336 REGISTER_MATCHER(isArray);
337 REGISTER_MATCHER(isArrow);
338 REGISTER_MATCHER(isAssignmentOperator);
339 REGISTER_MATCHER(isBaseInitializer);
340 REGISTER_MATCHER(isBitField);
341 REGISTER_MATCHER(isCatchAll);
342 REGISTER_MATCHER(isClass);
343 REGISTER_MATCHER(isConst);
344 REGISTER_MATCHER(isConstexpr);
345 REGISTER_MATCHER(isConstQualified);
346 REGISTER_MATCHER(isCopyAssignmentOperator);
347 REGISTER_MATCHER(isCopyConstructor);
348 REGISTER_MATCHER(isDefaultConstructor);
349 REGISTER_MATCHER(isDefaulted);
350 REGISTER_MATCHER(isDefinition);
351 REGISTER_MATCHER(isDeleted);
352 REGISTER_MATCHER(isDelegatingConstructor);
353 REGISTER_MATCHER(isExceptionVariable);
354 REGISTER_MATCHER(isExpansionInFileMatching);
355 REGISTER_MATCHER(isExpansionInMainFile);
356 REGISTER_MATCHER(isExpansionInSystemHeader);
357 REGISTER_MATCHER(isExplicit);
358 REGISTER_MATCHER(isExplicitTemplateSpecialization);
359 REGISTER_MATCHER(isExpr);
360 REGISTER_MATCHER(isExternC);
361 REGISTER_MATCHER(isFinal);
362 REGISTER_MATCHER(isImplicit);
363 REGISTER_MATCHER(isInline);
364 REGISTER_MATCHER(isInstanceMessage);
365 REGISTER_MATCHER(isInstantiated);
366 REGISTER_MATCHER(isInstantiationDependent);
367 REGISTER_MATCHER(isInteger);
368 REGISTER_MATCHER(isIntegral);
369 REGISTER_MATCHER(isInTemplateInstantiation);
370 REGISTER_MATCHER(isLambda);
371 REGISTER_MATCHER(isListInitialization);
372 REGISTER_MATCHER(isMain);
373 REGISTER_MATCHER(isMemberInitializer);
374 REGISTER_MATCHER(isMoveAssignmentOperator);
375 REGISTER_MATCHER(isMoveConstructor);
376 REGISTER_MATCHER(isNoReturn);
377 REGISTER_MATCHER(isNoThrow);
378 REGISTER_MATCHER(isOverride);
379 REGISTER_MATCHER(isPrivate);
380 REGISTER_MATCHER(isProtected);
381 REGISTER_MATCHER(isPublic);
382 REGISTER_MATCHER(isPure);
383 REGISTER_MATCHER(isScoped);
384 REGISTER_MATCHER(isSignedInteger);
385 REGISTER_MATCHER(isStaticLocal);
386 REGISTER_MATCHER(isStaticStorageClass);
387 REGISTER_MATCHER(isStruct);
388 REGISTER_MATCHER(isTemplateInstantiation);
389 REGISTER_MATCHER(isTypeDependent);
390 REGISTER_MATCHER(isUnion);
391 REGISTER_MATCHER(isUnsignedInteger);
392 REGISTER_MATCHER(isUserProvided);
393 REGISTER_MATCHER(isValueDependent);
394 REGISTER_MATCHER(isVariadic);
395 REGISTER_MATCHER(isVirtual);
396 REGISTER_MATCHER(isVirtualAsWritten);
397 REGISTER_MATCHER(isVolatileQualified);
398 REGISTER_MATCHER(isWritten);
399 REGISTER_MATCHER(labelDecl);
400 REGISTER_MATCHER(labelStmt);
401 REGISTER_MATCHER(lambdaExpr);
402 REGISTER_MATCHER(linkageSpecDecl);
403 REGISTER_MATCHER(lValueReferenceType);
404 REGISTER_MATCHER(matchesName);
405 REGISTER_MATCHER(matchesSelector);
406 REGISTER_MATCHER(materializeTemporaryExpr);
407 REGISTER_MATCHER(member);
408 REGISTER_MATCHER(memberExpr);
409 REGISTER_MATCHER(memberPointerType);
410 REGISTER_MATCHER(namedDecl);
411 REGISTER_MATCHER(namespaceAliasDecl);
412 REGISTER_MATCHER(namespaceDecl);
413 REGISTER_MATCHER(namesType);
414 REGISTER_MATCHER(nestedNameSpecifier);
415 REGISTER_MATCHER(nestedNameSpecifierLoc);
416 REGISTER_MATCHER(nonTypeTemplateParmDecl);
417 REGISTER_MATCHER(nullPointerConstant);
418 REGISTER_MATCHER(nullStmt);
419 REGISTER_MATCHER(numSelectorArgs);
420 REGISTER_MATCHER(objcCatchStmt);
421 REGISTER_MATCHER(objcCategoryDecl);
422 REGISTER_MATCHER(objcCategoryImplDecl);
423 REGISTER_MATCHER(objcFinallyStmt);
424 REGISTER_MATCHER(objcImplementationDecl);
425 REGISTER_MATCHER(objcInterfaceDecl);
426 REGISTER_MATCHER(objcIvarDecl);
427 REGISTER_MATCHER(objcIvarRefExpr);
428 REGISTER_MATCHER(objcMessageExpr);
429 REGISTER_MATCHER(objcMethodDecl);
430 REGISTER_MATCHER(objcObjectPointerType);
431 REGISTER_MATCHER(objcPropertyDecl);
432 REGISTER_MATCHER(objcProtocolDecl);
433 REGISTER_MATCHER(objcThrowStmt);
434 REGISTER_MATCHER(objcTryStmt);
435 REGISTER_MATCHER(ofClass);
436 REGISTER_MATCHER(on);
437 REGISTER_MATCHER(onImplicitObjectArgument);
438 REGISTER_MATCHER(opaqueValueExpr);
439 REGISTER_MATCHER(parameterCountIs);
440 REGISTER_MATCHER(parenExpr);
441 REGISTER_MATCHER(parenListExpr);
442 REGISTER_MATCHER(parenType);
443 REGISTER_MATCHER(parmVarDecl);
444 REGISTER_MATCHER(pointee);
445 REGISTER_MATCHER(pointerType);
446 REGISTER_MATCHER(predefinedExpr);
447 REGISTER_MATCHER(qualType);
448 REGISTER_MATCHER(realFloatingPointType);
449 REGISTER_MATCHER(recordDecl);
450 REGISTER_MATCHER(recordType);
451 REGISTER_MATCHER(referenceType);
452 REGISTER_MATCHER(refersToDeclaration);
453 REGISTER_MATCHER(refersToIntegralType);
454 REGISTER_MATCHER(refersToType);
455 REGISTER_MATCHER(refersToTemplate);
456 REGISTER_MATCHER(requiresZeroInitialization);
457 REGISTER_MATCHER(returns);
458 REGISTER_MATCHER(returnStmt);
459 REGISTER_MATCHER(rValueReferenceType);
460 REGISTER_MATCHER(sizeOfExpr);
461 REGISTER_MATCHER(specifiesNamespace);
462 REGISTER_MATCHER(specifiesType);
463 REGISTER_MATCHER(specifiesTypeLoc);
464 REGISTER_MATCHER(statementCountIs);
465 REGISTER_MATCHER(staticAssertDecl);
466 REGISTER_MATCHER(stmt);
467 REGISTER_MATCHER(stmtExpr);
468 REGISTER_MATCHER(stringLiteral);
469 REGISTER_MATCHER(substNonTypeTemplateParmExpr);
470 REGISTER_MATCHER(substTemplateTypeParmType);
471 REGISTER_MATCHER(switchCase);
472 REGISTER_MATCHER(switchStmt);
473 REGISTER_MATCHER(tagType);
474 REGISTER_MATCHER(templateArgument);
475 REGISTER_MATCHER(templateArgumentCountIs);
476 REGISTER_MATCHER(templateName);
477 REGISTER_MATCHER(templateSpecializationType);
478 REGISTER_MATCHER(templateTypeParmDecl);
479 REGISTER_MATCHER(templateTypeParmType);
480 REGISTER_MATCHER(throughUsingDecl);
481 REGISTER_MATCHER(to);
482 REGISTER_MATCHER(translationUnitDecl);
483 REGISTER_MATCHER(type);
484 REGISTER_MATCHER(typeAliasDecl);
485 REGISTER_MATCHER(typeAliasTemplateDecl);
486 REGISTER_MATCHER(typedefDecl);
487 REGISTER_MATCHER(typedefNameDecl);
488 REGISTER_MATCHER(typedefType);
489 REGISTER_MATCHER(typeLoc);
490 REGISTER_MATCHER(unaryExprOrTypeTraitExpr);
491 REGISTER_MATCHER(unaryOperator);
492 REGISTER_MATCHER(unaryTransformType);
493 REGISTER_MATCHER(unless);
494 REGISTER_MATCHER(unresolvedLookupExpr);
495 REGISTER_MATCHER(unresolvedMemberExpr);
496 REGISTER_MATCHER(unresolvedUsingTypenameDecl);
497 REGISTER_MATCHER(unresolvedUsingValueDecl);
498 REGISTER_MATCHER(userDefinedLiteral);
499 REGISTER_MATCHER(usesADL);
500 REGISTER_MATCHER(usingDecl);
501 REGISTER_MATCHER(usingDirectiveDecl);
502 REGISTER_MATCHER(valueDecl);
503 REGISTER_MATCHER(varDecl);
504 REGISTER_MATCHER(variableArrayType);
505 REGISTER_MATCHER(voidType);
506 REGISTER_MATCHER(whileStmt);
507 REGISTER_MATCHER(withInitializer);
508 }
509
510 RegistryMaps::~RegistryMaps() = default;
511
512 static llvm::ManagedStatic<RegistryMaps> RegistryData;
513
514 // static
515 llvm::Optional<MatcherCtor> Registry::lookupMatcherCtor(StringRef MatcherName) {
516 auto it = RegistryData->constructors().find(MatcherName);
517 return it == RegistryData->constructors().end()
518 ? llvm::Optional<MatcherCtor>()
519 : it->second.get();
520 }
521
522 static llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
523 const std::set<ASTNodeKind> &KS) {
524 unsigned Count = 0;
525 for (std::set<ASTNodeKind>::const_iterator I = KS.begin(), E = KS.end();
526 I != E; ++I) {
527 if (I != KS.begin())
528 OS << "|";
529 if (Count++ == 3) {
530 OS << "...";
531 break;
532 }
533 OS << *I;
534 }
535 return OS;
536 }
537
538 std::vector<ArgKind> Registry::getAcceptedCompletionTypes(
539 ArrayRef<std::pair<MatcherCtor, unsigned>> Context) {
540 ASTNodeKind InitialTypes[] = {
541 ASTNodeKind::getFromNodeKind<Decl>(),
542 ASTNodeKind::getFromNodeKind<QualType>(),
543 ASTNodeKind::getFromNodeKind<Type>(),
544 ASTNodeKind::getFromNodeKind<Stmt>(),
545 ASTNodeKind::getFromNodeKind<NestedNameSpecifier>(),
546 ASTNodeKind::getFromNodeKind<NestedNameSpecifierLoc>(),
547 ASTNodeKind::getFromNodeKind<TypeLoc>()};
548
549 // Starting with the above seed of acceptable top-level matcher types, compute
550 // the acceptable type set for the argument indicated by each context element.
551 std::set<ArgKind> TypeSet(std::begin(InitialTypes), std::end(InitialTypes));
552 for (const auto &CtxEntry : Context) {
553 MatcherCtor Ctor = CtxEntry.first;
554 unsigned ArgNumber = CtxEntry.second;
555 std::vector<ArgKind> NextTypeSet;
556 for (const ArgKind &Kind : TypeSet) {
557 if (Kind.getArgKind() == Kind.AK_Matcher &&
558 Ctor->isConvertibleTo(Kind.getMatcherKind()) &&
559 (Ctor->isVariadic() || ArgNumber < Ctor->getNumArgs()))
560 Ctor->getArgKinds(Kind.getMatcherKind(), ArgNumber, NextTypeSet);
561 }
562 TypeSet.clear();
563 TypeSet.insert(NextTypeSet.begin(), NextTypeSet.end());
564 }
565 return std::vector<ArgKind>(TypeSet.begin(), TypeSet.end());
566 }
567
568 std::vector<MatcherCompletion>
569 Registry::getMatcherCompletions(ArrayRef<ArgKind> AcceptedTypes) {
570 std::vector<MatcherCompletion> Completions;
571
572 // Search the registry for acceptable matchers.
573 for (const auto &M : RegistryData->constructors()) {
574 const MatcherDescriptor& Matcher = *M.getValue();
575 StringRef Name = M.getKey();
576
577 std::set<ASTNodeKind> RetKinds;
578 unsigned NumArgs = Matcher.isVariadic() ? 1 : Matcher.getNumArgs();
579 bool IsPolymorphic = Matcher.isPolymorphic();
580 std::vector<std::vector<ArgKind>> ArgsKinds(NumArgs);
581 unsigned MaxSpecificity = 0;
582 for (const ArgKind& Kind : AcceptedTypes) {
583 if (Kind.getArgKind() != Kind.AK_Matcher)
584 continue;
585 unsigned Specificity;
586 ASTNodeKind LeastDerivedKind;
587 if (Matcher.isConvertibleTo(Kind.getMatcherKind(), &Specificity,
588 &LeastDerivedKind)) {
589 if (MaxSpecificity < Specificity)
590 MaxSpecificity = Specificity;
591 RetKinds.insert(LeastDerivedKind);
592 for (unsigned Arg = 0; Arg != NumArgs; ++Arg)
593 Matcher.getArgKinds(Kind.getMatcherKind(), Arg, ArgsKinds[Arg]);
594 if (IsPolymorphic)
595 break;
596 }
597 }
598
599 if (!RetKinds.empty() && MaxSpecificity > 0) {
600 std::string Decl;
601 llvm::raw_string_ostream OS(Decl);
602
603 if (IsPolymorphic) {
604 OS << "Matcher<T> " << Name << "(Matcher<T>";
605 } else {
606 OS << "Matcher<" << RetKinds << "> " << Name << "(";
607 for (const std::vector<ArgKind> &Arg : ArgsKinds) {
608 if (&Arg != &ArgsKinds[0])
609 OS << ", ";
610
611 bool FirstArgKind = true;
612 std::set<ASTNodeKind> MatcherKinds;
613 // Two steps. First all non-matchers, then matchers only.
614 for (const ArgKind &AK : Arg) {
615 if (AK.getArgKind() == ArgKind::AK_Matcher) {
616 MatcherKinds.insert(AK.getMatcherKind());
617 } else {
618 if (!FirstArgKind) OS << "|";
619 FirstArgKind = false;
620 OS << AK.asString();
621 }
622 }
623 if (!MatcherKinds.empty()) {
624 if (!FirstArgKind) OS << "|";
625 OS << "Matcher<" << MatcherKinds << ">";
626 }
627 }
628 }
629 if (Matcher.isVariadic())
630 OS << "...";
631 OS << ")";
632
633 std::string TypedText = Name;
634 TypedText += "(";
635 if (ArgsKinds.empty())
636 TypedText += ")";
637 else if (ArgsKinds[0][0].getArgKind() == ArgKind::AK_String)
638 TypedText += "\"";
639
640 Completions.emplace_back(TypedText, OS.str(), MaxSpecificity);
641 }
642 }
643
644 return Completions;
645 }
646
647 VariantMatcher Registry::constructMatcher(MatcherCtor Ctor,
648 SourceRange NameRange,
649 ArrayRef<ParserValue> Args,
650 Diagnostics *Error) {
651 return Ctor->create(NameRange, Args, Error);
652 }
653
654 VariantMatcher Registry::constructBoundMatcher(MatcherCtor Ctor,
655 SourceRange NameRange,
656 StringRef BindID,
657 ArrayRef<ParserValue> Args,
658 Diagnostics *Error) {
659 VariantMatcher Out = constructMatcher(Ctor, NameRange, Args, Error);
660 if (Out.isNull()) return Out;
661
662 llvm::Optional<DynTypedMatcher> Result = Out.getSingleMatcher();
663 if (Result.hasValue()) {
664 llvm::Optional<DynTypedMatcher> Bound = Result->tryBind(BindID);
665 if (Bound.hasValue()) {
666 return VariantMatcher::SingleMatcher(*Bound);
667 }
668 }
669 Error->addError(NameRange, Error->ET_RegistryNotBindable);
670 return VariantMatcher();
671 }
672
673 } // namespace dynamic
674 } // namespace ast_matchers
675 } // namespace clang
clang::ast_matchers::cxxThisExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXThisExpr > cxxThisExpr
Matches implicit and explicit this expressions.
Definition: ASTMatchersInternal.cpp:677
clang::ast_matchers::anything
internal::TrueMatcher anything()
Matches any node.
Definition: ASTMatchers.h:168
clang::ast_matchers::nonTypeTemplateParmDecl
const internal::VariadicDynCastAllOfMatcher< Decl, NonTypeTemplateParmDecl > nonTypeTemplateParmDecl
Matches non-type template parameter declarations.
Definition: ASTMatchersInternal.cpp:588
clang::ast_matchers::objcThrowStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtThrowStmt > objcThrowStmt
Matches Objective-C @throw statements.
Definition: ASTMatchersInternal.cpp:646
clang::ast_matchers::callExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CallExpr > callExpr
Matches call expressions.
Definition: ASTMatchersInternal.cpp:622
clang::ast_matchers::parenExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ParenExpr > parenExpr
Matches parentheses used in expressions.
Definition: ASTMatchersInternal.cpp:672
clang::ast_matchers::typedefDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TypedefDecl > typedefDecl
Matches typedef declarations.
Definition: ASTMatchersInternal.cpp:555
clang::ast_matchers::linkageSpecDecl
const internal::VariadicDynCastAllOfMatcher< Decl, LinkageSpecDecl > linkageSpecDecl
Matches a declaration of a linkage specification.
Definition: ASTMatchersInternal.cpp:563
clang::ast_matchers::decltypeType
const AstTypeMatcher< DecltypeType > decltypeType
Matches types nodes representing C++11 decltype(<expr>) types.
Definition: ASTMatchersInternal.cpp:816
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:786
clang::ast_matchers::unaryTransformType
const AstTypeMatcher< UnaryTransformType > unaryTransformType
Matches types nodes representing unary type transformations.
Definition: ASTMatchersInternal.cpp:830
clang::ast_matchers::stmt
const internal::VariadicAllOfMatcher< Stmt > stmt
Matches statements.
Definition: ASTMatchersInternal.cpp:615
clang::ast_matchers::cxxUnresolvedConstructExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXUnresolvedConstructExpr > cxxUnresolvedConstructExpr
Matches unresolved constructor call expressions.
Definition: ASTMatchersInternal.cpp:676
clang::ast_matchers::objcInterfaceDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCInterfaceDecl > objcInterfaceDecl
Matches Objective-C interface declarations.
Definition: ASTMatchersInternal.cpp:629
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:783
clang::ast_matchers::cxxBindTemporaryExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBindTemporaryExpr > cxxBindTemporaryExpr
Matches nodes where temporaries are created.
Definition: ASTMatchersInternal.cpp:679
clang::ast_matchers::recordDecl
const internal::VariadicDynCastAllOfMatcher< Decl, RecordDecl > recordDecl
Matches class, struct, and union declarations.
Definition: ASTMatchersInternal.cpp:569
Registry.h
Registry of all known matchers.
clang::ast_matchers::hasDeclaration
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:2865
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:782
clang::ast_matchers::tagType
const AstTypeMatcher< TagType > tagType
Matches tag types (record and enum types).
Definition: ASTMatchersInternal.cpp:832
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:773
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:87
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:785
clang::ast_matchers::functionType
const AstTypeMatcher< FunctionType > functionType
Matches FunctionType nodes.
Definition: ASTMatchersInternal.cpp:817
IteratorComparison::isAssignmentOperator
bool isAssignmentOperator(OverloadedOperatorKind OK)
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:724
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:834
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:770
clang::ast_matchers::autoType
const AstTypeMatcher< AutoType > autoType
Matches types nodes representing C++11 auto types.
Definition: ASTMatchersInternal.cpp:815
clang::ast_matchers::rValueReferenceType
const AstTypeMatcher< RValueReferenceType > rValueReferenceType
Matches rvalue reference types.
Definition: ASTMatchersInternal.cpp:826
clang::ast_matchers::dynamic::VariantMatcher::getSingleMatcher
llvm::Optional< DynTypedMatcher > getSingleMatcher() const
Return a single matcher, if there is no ambiguity.
Definition: VariantValue.cpp:239
clang::ast_matchers::templateName
const internal::VariadicAllOfMatcher< TemplateName > templateName
Matches template name.
Definition: ASTMatchersInternal.cpp:586
clang::ast_matchers::objcTryStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtTryStmt > objcTryStmt
Matches Objective-C statements.
Definition: ASTMatchersInternal.cpp:647
clang::ast_matchers::pointerType
const AstTypeMatcher< PointerType > pointerType
Matches pointer types, but does not match Objective-C object pointer types.
Definition: ASTMatchersInternal.cpp:822
clang::ast_matchers::expr
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
Definition: ASTMatchersInternal.cpp:690
clang::ast_matchers::allOf
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> allOf
Matches if all given matchers match.
Definition: ASTMatchersInternal.cpp:776
clang::ast_matchers::binaryOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryOperator > binaryOperator
Matches binary operator expressions.
Definition: ASTMatchersInternal.cpp:735
clang::ast_matchers::cxxStdInitializerListExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXStdInitializerListExpr > cxxStdInitializerListExpr
Matches C++ initializer list expressions.
Definition: ASTMatchersInternal.cpp:656
clang::ast_matchers::objcIvarRefExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCIvarRefExpr > objcIvarRefExpr
Matches a reference to an ObjCIvar.
Definition: ASTMatchersInternal.cpp:692
clang::ast_matchers::varDecl
const internal::VariadicDynCastAllOfMatcher< Decl, VarDecl > varDecl
Matches variable declarations.
Definition: ASTMatchersInternal.cpp:607
clang::ast_matchers::functionDecl
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionDecl > functionDecl
Matches function declarations.
Definition: ASTMatchersInternal.cpp:611
clang::ast_matchers::blockExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, BlockExpr > blockExpr
Matches a reference to a block.
Definition: ASTMatchersInternal.cpp:693
clang::ast_matchers::namedDecl
const internal::VariadicDynCastAllOfMatcher< Decl, NamedDecl > namedDecl
Matches a declaration of anything that could have a name.
Definition: ASTMatchersInternal.cpp:564
clang::ast_matchers::builtinType
const AstTypeMatcher< BuiltinType > builtinType
Matches builtin Types.
Definition: ASTMatchersInternal.cpp:807
clang::ast_matchers::dynamic::RegistryData
static llvm::ManagedStatic< RegistryMaps > RegistryData
Definition: Registry.cpp:512
clang::ast_matchers::cxxThrowExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXThrowExpr > cxxThrowExpr
Matches throw expressions.
Definition: ASTMatchersInternal.cpp:713
clang::ast_matchers::enumDecl
const internal::VariadicDynCastAllOfMatcher< Decl, EnumDecl > enumDecl
Matches enum declarations.
Definition: ASTMatchersInternal.cpp:601
clang::ast_matchers::recordType
const AstTypeMatcher< RecordType > recordType
Matches record types (e.g.
Definition: ASTMatchersInternal.cpp:831
REGISTER_OVERLOADED_2
#define REGISTER_OVERLOADED_2(name)
Definition: Registry.cpp:85
clang::ast_matchers::classTemplateDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateDecl > classTemplateDecl
Matches C++ class template declarations.
Definition: ASTMatchersInternal.cpp:572
clang::ast_matchers::objcCategoryDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCCategoryDecl > objcCategoryDecl
Matches Objective-C category declarations.
Definition: ASTMatchersInternal.cpp:635
llvm::Optional
Definition: LLVM.h:38
clang::ast_matchers::cxxOperatorCallExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXOperatorCallExpr > cxxOperatorCallExpr
Matches overloaded operator calls.
Definition: ASTMatchersInternal.cpp:689
clang::ast_matchers::typeAliasTemplateDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TypeAliasTemplateDecl > typeAliasTemplateDecl
Matches type alias template declarations.
Definition: ASTMatchersInternal.cpp:560
clang::ast_matchers::designatedInitExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, DesignatedInitExpr > designatedInitExpr
Matches C99 designated initializer expressions [C99 6.7.8].
Definition: ASTMatchersInternal.cpp:767
clang::ast_matchers::injectedClassNameType
const AstTypeMatcher< InjectedClassNameType > injectedClassNameType
Matches injected class name types.
Definition: ASTMatchersInternal.cpp:836
clang::ast_matchers::cxxNullPtrLiteralExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNullPtrLiteralExpr > cxxNullPtrLiteralExpr
Matches nullptr literal.
Definition: ASTMatchersInternal.cpp:730
clang::ast_matchers::constantExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ConstantExpr > constantExpr
Matches a constant expression wrapper.
Definition: ASTMatchersInternal.cpp:671
clang::ast_matchers::dependentSizedArrayType
const AstTypeMatcher< DependentSizedArrayType > dependentSizedArrayType
Matches C++ arrays whose size is a value-dependent expression.
Definition: ASTMatchersInternal.cpp:811
clang::ast_matchers::cxxTryStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXTryStmt > cxxTryStmt
Matches try statements.
Definition: ASTMatchersInternal.cpp:712
clang::ast_matchers::cxxStaticCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXStaticCastExpr > cxxStaticCastExpr
Matches a C++ static_cast expression.
Definition: ASTMatchersInternal.cpp:748
clang::ast_matchers::typedefType
const AstTypeMatcher< TypedefType > typedefType
Matches typedef types.
Definition: ASTMatchersInternal.cpp:827
clang::ast_matchers::gotoStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, GotoStmt > gotoStmt
Matches goto statements.
Definition: ASTMatchersInternal.cpp:703
clang::ast_matchers::complexType
const AstTypeMatcher< ComplexType > complexType
Matches C99 complex types.
Definition: ASTMatchersInternal.cpp:809
clang::ast_matchers::cxxFunctionalCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXFunctionalCastExpr > cxxFunctionalCastExpr
Matches functional cast expressions.
Definition: ASTMatchersInternal.cpp:761
clang::ast_matchers::cxxReinterpretCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXReinterpretCastExpr > cxxReinterpretCastExpr
Matches a reinterpret_cast expression.
Definition: ASTMatchersInternal.cpp:746
clang::ast_matchers::dynamic::internal::MatcherDescriptor
Matcher descriptor interface.
Definition: Marshallers.h:173
clang::ast_matchers::floatLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, FloatingLiteral > floatLiteral
Matches float literals of all sizes / encodings, e.g.
Definition: ASTMatchersInternal.cpp:723
clang::ast_matchers::declStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclStmt > declStmt
Matches declaration statements.
Definition: ASTMatchersInternal.cpp:616
clang::ast_matchers::opaqueValueExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, OpaqueValueExpr > opaqueValueExpr
Matches opaque value expressions.
Definition: ASTMatchersInternal.cpp:742
clang::ast_matchers::memberPointerType
const AstTypeMatcher< MemberPointerType > memberPointerType
Matches member pointer types.
Definition: ASTMatchersInternal.cpp:821
clang::ast_matchers::declRefExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclRefExpr > declRefExpr
Matches expressions that refer to declarations.
Definition: ASTMatchersInternal.cpp:691
clang::ast_matchers::ifStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, IfStmt > ifStmt
Matches if statements.
Definition: ASTMatchersInternal.cpp:694
clang::ast_matchers::namespaceDecl
const internal::VariadicDynCastAllOfMatcher< Decl, NamespaceDecl > namespaceDecl
Matches a declaration of a namespace.
Definition: ASTMatchersInternal.cpp:566
clang::ast_matchers::dynamic::Diagnostics::ET_RegistryNotBindable
Definition: Diagnostics.h:66
ASTMatchers.h
clang::ast_matchers::implicitValueInitExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitValueInitExpr > implicitValueInitExpr
Matches implicit initializers of init list expressions.
Definition: ASTMatchersInternal.cpp:658
clang::ast_matchers::switchCase
const internal::VariadicDynCastAllOfMatcher< Stmt, SwitchCase > switchCase
Matches case and default statements inside switch statements.
Definition: ASTMatchersInternal.cpp:707
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:779
clang::ast_matchers::userDefinedLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, UserDefinedLiteral > userDefinedLiteral
Matches user defined literal operator call.
Definition: ASTMatchersInternal.cpp:726
clang::ast_matchers::sizeOfExpr
internal::Matcher< Stmt > sizeOfExpr(const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher)
Same as unaryExprOrTypeTraitExpr, but only matching sizeof.
Definition: ASTMatchers.h:2505
Marshallers.h
Functions templates and classes to wrap matcher construct functions.
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:813
clang::ast_matchers::castExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang&#39;s AST.
Definition: ASTMatchersInternal.cpp:759
clang::ast_matchers::hasOverloadedOperatorName
internal::PolymorphicMatcherWithParam1< internal::HasOverloadedOperatorNameMatcher, StringRef, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXOperatorCallExpr, FunctionDecl)> hasOverloadedOperatorName(StringRef Name)
Matches overloaded operator names.
Definition: ASTMatchers.h:2589
clang::ast_matchers::valueDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ValueDecl > valueDecl
Matches any value declaration.
Definition: ASTMatchersInternal.cpp:596
clang::ast_matchers::objcPropertyDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCPropertyDecl > objcPropertyDecl
Matches Objective-C property declarations.
Definition: ASTMatchersInternal.cpp:644
clang::ast_matchers::objcFinallyStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtFinallyStmt > objcFinallyStmt
Matches Objective-C statements.
Definition: ASTMatchersInternal.cpp:651
llvm::ArrayRef
Definition: LLVM.h:32
clang::ast_matchers::functionTemplateDecl
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionTemplateDecl > functionTemplateDecl
Matches C++ function template declarations.
Definition: ASTMatchersInternal.cpp:613
clang::ast_matchers::cxxCatchStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXCatchStmt > cxxCatchStmt
Matches catch statements.
Definition: ASTMatchersInternal.cpp:711
clang::ast_matchers::classTemplateSpecializationDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateSpecializationDecl > classTemplateSpecializationDecl
Matches C++ class template specializations.
Definition: ASTMatchersInternal.cpp:575
clang::ast_matchers::materializeTemporaryExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, MaterializeTemporaryExpr > materializeTemporaryExpr
Matches nodes where temporaries are materialized.
Definition: ASTMatchersInternal.cpp:681
clang::ast_matchers::caseStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CaseStmt > caseStmt
Matches case statements inside switch statements.
Definition: ASTMatchersInternal.cpp:708
ASTTypeTraits.h
clang::ast_matchers::parenType
const AstTypeMatcher< ParenType > parenType
Matches ParenType nodes.
Definition: ASTMatchersInternal.cpp:819
clang::ast_matchers::usingDirectiveDecl
const internal::VariadicDynCastAllOfMatcher< Decl, UsingDirectiveDecl > usingDirectiveDecl
Matches using namespace declarations.
Definition: ASTMatchersInternal.cpp:664
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:789
clang::ast_matchers::asmStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, AsmStmt > asmStmt
Matches asm statements.
Definition: ASTMatchersInternal.cpp:715
clang::ast_matchers::autoreleasePoolStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAutoreleasePoolStmt > autoreleasePoolStmt
Matches an Objective-C autorelease pool statement.
Definition: ASTMatchersInternal.cpp:552
clang::ast_matchers::unresolvedUsingTypenameDecl
const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingTypenameDecl > unresolvedUsingTypenameDecl
Matches unresolved using value declarations that involve the typename.
Definition: ASTMatchersInternal.cpp:670
clang::ast_matchers::memberExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, MemberExpr > memberExpr
Matches member expressions.
Definition: ASTMatchersInternal.cpp:617
clang::ast_matchers::addrLabelExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, AddrLabelExpr > addrLabelExpr
Matches address of label statements (GNU extension).
Definition: ASTMatchersInternal.cpp:705
clang::threadSafety::sx::equals
bool equals(const til::SExpr *E1, const til::SExpr *E2)
Definition: ThreadSafetyCommon.h:64
clang::ast_matchers::explicitCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ExplicitCastExpr > explicitCastExpr
Matches explicit cast expressions.
Definition: ASTMatchersInternal.cpp:756
clang::ast_matchers::switchStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, SwitchStmt > switchStmt
Matches switch statements.
Definition: ASTMatchersInternal.cpp:706
clang::ast_type_traits
Definition: ASTTypeTraits.h:39
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:666
clang::ast_matchers::binaryConditionalOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryConditionalOperator > binaryConditionalOperator
Matches binary conditional operator expressions (GNU extension).
Definition: ASTMatchersInternal.cpp:740
clang::ast_matchers::decl
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
Definition: ASTMatchersInternal.cpp:561
clang::ast_matchers::incompleteArrayType
const AstTypeMatcher< IncompleteArrayType > incompleteArrayType
Matches C arrays with unspecified size.
Definition: ASTMatchersInternal.cpp:812
clang::ast_matchers::labelStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, LabelStmt > labelStmt
Matches label statements.
Definition: ASTMatchersInternal.cpp:704
clang::ast_matchers::cStyleCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CStyleCastExpr > cStyleCastExpr
Matches a C-style cast expression.
Definition: ASTMatchersInternal.cpp:754
clang::ast_matchers::namespaceAliasDecl
const internal::VariadicDynCastAllOfMatcher< Decl, NamespaceAliasDecl > namespaceAliasDecl
Matches a declaration of a namespace alias.
Definition: ASTMatchersInternal.cpp:568
REGISTER_MATCHER
#define REGISTER_MATCHER(name)
Definition: Registry.cpp:69
clang::ast_matchers::fieldDecl
const internal::VariadicDynCastAllOfMatcher< Decl, FieldDecl > fieldDecl
Matches field declarations.
Definition: ASTMatchersInternal.cpp:608
clang::ast_matchers::dynamic::internal::MatcherDescriptor::create
virtual VariantMatcher create(SourceRange NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error) const =0
clang::ast_matchers::unresolvedMemberExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, UnresolvedMemberExpr > unresolvedMemberExpr
Matches unresolved member expressions.
Definition: ASTMatchersInternal.cpp:619
clang::ast_matchers::conditionalOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, ConditionalOperator > conditionalOperator
Matches conditional operator expressions.
Definition: ASTMatchersInternal.cpp:738
Diagnostics.h
Diagnostics class to manage error messages.
clang::ast_matchers::arrayType
const AstTypeMatcher< ArrayType > arrayType
Matches all kinds of arrays.
Definition: ASTMatchersInternal.cpp:808
clang::ast_matchers::typedefNameDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TypedefNameDecl > typedefNameDecl
Matches typedef name declarations.
Definition: ASTMatchersInternal.cpp:557
clang::ast_matchers::substNonTypeTemplateParmExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, SubstNonTypeTemplateParmExpr > substNonTypeTemplateParmExpr
Matches substitutions of non-type template parameters.
Definition: ASTMatchersInternal.cpp:661
clang::ast_matchers::returnStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ReturnStmt > returnStmt
Matches return statements.
Definition: ASTMatchersInternal.cpp:702
clang::ast_matchers::functionProtoType
const AstTypeMatcher< FunctionProtoType > functionProtoType
Matches FunctionProtoType nodes.
Definition: ASTMatchersInternal.cpp:818
clang::ast_matchers::cudaKernelCallExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CUDAKernelCallExpr > cudaKernelCallExpr
Matches CUDA kernel call expression.
Definition: ASTMatchersInternal.cpp:806
hasDefinition
static bool hasDefinition(const ObjCObjectPointerType *ObjPtr)
Definition: DynamicTypeChecker.cpp:149
clang::ast_matchers::atomicType
const AstTypeMatcher< AtomicType > atomicType
Matches atomic types.
Definition: ASTMatchersInternal.cpp:814
clang::ast_matchers::objcCategoryImplDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCCategoryImplDecl > objcCategoryImplDecl
Matches Objective-C category definitions.
Definition: ASTMatchersInternal.cpp:637
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&#39;s evaluation...
Definition: ASTMatchersInternal.cpp:653
clang::ast_matchers::friendDecl
const internal::VariadicDynCastAllOfMatcher< Decl, FriendDecl > friendDecl
Matches friend declarations.
Definition: ASTMatchersInternal.cpp:614
clang::ast_matchers::doStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, DoStmt > doStmt
Matches do statements.
Definition: ASTMatchersInternal.cpp:699
clang::ast_matchers::hasAncestor
const internal::ArgumentAdaptingMatcherFunc< internal::HasAncestorMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc > > hasAncestor
Matches AST nodes that have an ancestor that matches the provided matcher.
Definition: ASTMatchersInternal.cpp:799
clang::isTemplateInstantiation
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
Definition: Specifiers.h:170
clang::ast_matchers::templateSpecializationType
const AstTypeMatcher< TemplateSpecializationType > templateSpecializationType
Matches template specialization types.
Definition: ASTMatchersInternal.cpp:829
clang::ast_matchers::dynamic::Diagnostics
Helper class to manage error messages.
Definition: Diagnostics.h:51
clang::ast_matchers::nestedNameSpecifierLoc
const internal::VariadicAllOfMatcher< NestedNameSpecifierLoc > nestedNameSpecifierLoc
Same as nestedNameSpecifier but matches NestedNameSpecifierLoc.
Definition: ASTMatchersInternal.cpp:804
clang::ast_matchers::dynamic::Diagnostics::addError
ArgStream addError(SourceRange Range, ErrorType Error)
Add an error to the diagnostics.
Definition: Diagnostics.cpp:66
clang::ast_matchers::predefinedExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, PredefinedExpr > predefinedExpr
Matches predefined identifier expressions [C99 6.4.2.2].
Definition: ASTMatchersInternal.cpp:765
Kind
Kind
Definition: ChrootChecker.cpp:29
clang::ast_matchers::labelDecl
const internal::VariadicDynCastAllOfMatcher< Decl, LabelDecl > labelDecl
Matches a declaration of label.
Definition: ASTMatchersInternal.cpp:565
clang::ast_matchers::dynamic::SourceRange
Definition: Diagnostics.h:37
clang::ast_matchers::cxxMemberCallExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXMemberCallExpr > cxxMemberCallExpr
Matches member call expressions.
Definition: ASTMatchersInternal.cpp:625
clang::ast_matchers::parmVarDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ParmVarDecl > parmVarDecl
Matches parameter variable declarations.
Definition: ASTMatchersInternal.cpp:581
clang::ast_matchers::cxxConstCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstCastExpr > cxxConstCastExpr
Matches a const_cast expression.
Definition: ASTMatchersInternal.cpp:752
clang::ast_matchers::typeAliasDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TypeAliasDecl > typeAliasDecl
Matches type alias declarations.
Definition: ASTMatchersInternal.cpp:558
clang::ast_matchers::cxxCtorInitializer
const internal::VariadicAllOfMatcher< CXXCtorInitializer > cxxCtorInitializer
Matches constructor initializers.
Definition: ASTMatchersInternal.cpp:584
clang::ast_matchers::gnuNullExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, GNUNullExpr > gnuNullExpr
Matches GNU __null expression.
Definition: ASTMatchersInternal.cpp:731
clang::ast_matchers::breakStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, BreakStmt > breakStmt
Matches break statements.
Definition: ASTMatchersInternal.cpp:700
clang::ast_matchers::cxxMethodDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXMethodDecl > cxxMethodDecl
Matches method declarations.
Definition: ASTMatchersInternal.cpp:604
clang::ast_matchers::cxxDynamicCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDynamicCastExpr > cxxDynamicCastExpr
Matches a dynamic_cast expression.
Definition: ASTMatchersInternal.cpp:750
clang::ast_matchers::alignOfExpr
internal::Matcher< Stmt > alignOfExpr(const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher)
Same as unaryExprOrTypeTraitExpr, but only matching alignof.
Definition: ASTMatchers.h:2496
hasAttr
static bool hasAttr(const FunctionDecl *D, bool IgnoreImplicitAttr)
Definition: SemaCUDA.cpp:99
clang::ast_matchers::defaultStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, DefaultStmt > defaultStmt
Matches default statements inside switch statements.
Definition: ASTMatchersInternal.cpp:709
clang::ast_matchers::translationUnitDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TranslationUnitDecl > translationUnitDecl
Matches the top declaration context.
Definition: ASTMatchersInternal.cpp:554
clang::ast_matchers::cxxForRangeStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXForRangeStmt > cxxForRangeStmt
Matches range-based for statements.
Definition: ASTMatchersInternal.cpp:697
clang::ast_matchers::typeLoc
const internal::VariadicAllOfMatcher< TypeLoc > typeLoc
Matches TypeLocs in the clang AST.
Definition: ASTMatchersInternal.cpp:593
clang::ast_matchers::integerLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, IntegerLiteral > integerLiteral
Matches integer literals of all sizes / encodings, e.g.
Definition: ASTMatchersInternal.cpp:722
clang::ast_matchers::cxxConstructExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstructExpr > cxxConstructExpr
Matches constructor call expressions (including implicit ones).
Definition: ASTMatchersInternal.cpp:674
clang::ast_matchers::qualType
const internal::VariadicAllOfMatcher< QualType > qualType
Matches QualTypes in the clang AST.
Definition: ASTMatchersInternal.cpp:591
clang::ast_matchers::templateTypeParmDecl
const internal::VariadicDynCastAllOfMatcher< Decl, TemplateTypeParmDecl > templateTypeParmDecl
Matches template type parameter declarations.
Definition: ASTMatchersInternal.cpp:590
clang::ast_matchers::objcMethodDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCMethodDecl > objcMethodDecl
Matches Objective-C method declarations.
Definition: ASTMatchersInternal.cpp:639
clang::ast_matchers::usingDecl
const internal::VariadicDynCastAllOfMatcher< Decl, UsingDecl > usingDecl
Matches using declarations.
Definition: ASTMatchersInternal.cpp:662
clang::ast_matchers::arraySubscriptExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ArraySubscriptExpr > arraySubscriptExpr
Matches array subscript expressions.
Definition: ASTMatchersInternal.cpp:685
clang::ast_matchers::dynamic::internal::MatcherDescriptor::isVariadic
virtual bool isVariadic() const =0
Returns whether the matcher is variadic.
clang::ast_matchers::unaryExprOrTypeTraitExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryExprOrTypeTraitExpr > unaryExprOrTypeTraitExpr
Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
Definition: ASTMatchersInternal.cpp:595
clang::ast_matchers::hasParent
const internal::ArgumentAdaptingMatcherFunc< internal::HasParentMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc > > hasParent
Matches AST nodes that have a parent that matches the provided matcher.
Definition: ASTMatchersInternal.cpp:794
clang::ast_matchers::objcIvarDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCIvarDecl > objcIvarDecl
Matches Objective-C instance variable declarations.
Definition: ASTMatchersInternal.cpp:642
clang::ast_matchers::unless
const internal::VariadicOperatorMatcherFunc< 1, 1 > unless
Matches if the provided matcher does not match.
Definition: ASTMatchersInternal.cpp:800
clang::ast_matchers::forStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ForStmt > forStmt
Matches for statements.
Definition: ASTMatchersInternal.cpp:695
clang::ast_type_traits::ASTNodeKind
Kind identifier.
Definition: ASTTypeTraits.h:46
clang::ast_matchers::dynamic::internal::MatcherDescriptor::getNumArgs
virtual unsigned getNumArgs() const =0
Returns the number of arguments accepted by the matcher if not variadic.
clang::ast_matchers::objcImplementationDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCImplementationDecl > objcImplementationDecl
Matches Objective-C implementation declarations.
Definition: ASTMatchersInternal.cpp:631
clang::ast_matchers::compoundLiteralExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CompoundLiteralExpr > compoundLiteralExpr
Matches compound (i.e.
Definition: ASTMatchersInternal.cpp:728
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::ast_matchers::atomicExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, AtomicExpr > atomicExpr
Matches atomic builtins.
Definition: ASTMatchersInternal.cpp:732
clang::ast_matchers::staticAssertDecl
const internal::VariadicDynCastAllOfMatcher< Decl, StaticAssertDecl > staticAssertDecl
Matches a C++ static_assert declaration.
Definition: ASTMatchersInternal.cpp:744
clang::ast_matchers::elaboratedType
const AstTypeMatcher< ElaboratedType > elaboratedType
Matches types specified with an elaborated type keyword or with a qualified name. ...
Definition: ASTMatchersInternal.cpp:833
clang::ast_matchers::parenListExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ParenListExpr > parenListExpr
Matches paren list expressions.
Definition: ASTMatchersInternal.cpp:659
clang::ast_matchers::cxxConversionDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXConversionDecl > cxxConversionDecl
Matches conversion operator declarations.
Definition: ASTMatchersInternal.cpp:606
clang::ast_matchers::templateArgument
const internal::VariadicAllOfMatcher< TemplateArgument > templateArgument
Matches template arguments.
Definition: ASTMatchersInternal.cpp:585
clang::ast_matchers::objcProtocolDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCProtocolDecl > objcProtocolDecl
Matches Objective-C protocol declarations.
Definition: ASTMatchersInternal.cpp:633
ast_matchers
clang::ast_matchers::decayedType
const AstTypeMatcher< DecayedType > decayedType
Matches decayed type Example matches i[] in declaration of f.
Definition: ASTMatchersInternal.cpp:837
clang::ast_matchers::cxxRecordDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXRecordDecl > cxxRecordDecl
Matches C++ class declarations.
Definition: ASTMatchersInternal.cpp:570
clang::ast_matchers::cxxDefaultArgExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDefaultArgExpr > cxxDefaultArgExpr
Matches the value of a default argument at the call site.
Definition: ASTMatchersInternal.cpp:687
type
clang::ast_matchers::unresolvedUsingValueDecl
const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingValueDecl > unresolvedUsingValueDecl
Matches unresolved using value declarations.
Definition: ASTMatchersInternal.cpp:668
clang::ast_matchers::nullStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, NullStmt > nullStmt
Matches null statements.
Definition: ASTMatchersInternal.cpp:714
clang::ast_matchers::dynamic::VariantMatcher::isNull
bool isNull() const
Whether the matcher is null.
Definition: VariantValue.h:159
clang::ast_matchers::indirectFieldDecl
const internal::VariadicDynCastAllOfMatcher< Decl, IndirectFieldDecl > indirectFieldDecl
Matches indirect field declarations.
Definition: ASTMatchersInternal.cpp:610
MATCHER_OVERLOAD_ENTRY
#define MATCHER_OVERLOAD_ENTRY(name, Id)
Definition: Registry.cpp:81
clang::ast_matchers::lambdaExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, LambdaExpr > lambdaExpr
Matches lambda expressions.
Definition: ASTMatchersInternal.cpp:623
clang::ast_matchers::cxxNewExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNewExpr > cxxNewExpr
Matches new expressions.
Definition: ASTMatchersInternal.cpp:682
clang::ast_matchers::initListExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, InitListExpr > initListExpr
Matches init list expressions.
Definition: ASTMatchersInternal.cpp:654
clang::ast_matchers::cxxDeleteExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDeleteExpr > cxxDeleteExpr
Matches delete expressions.
Definition: ASTMatchersInternal.cpp:683
clang::ast_matchers::continueStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ContinueStmt > continueStmt
Matches continue statements.
Definition: ASTMatchersInternal.cpp:701
clang::ast_matchers::enumConstantDecl
const internal::VariadicDynCastAllOfMatcher< Decl, EnumConstantDecl > enumConstantDecl
Matches enum constants.
Definition: ASTMatchersInternal.cpp:603
clang::ast_matchers::objcCatchStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtCatchStmt > objcCatchStmt
Matches Objective-C statements.
Definition: ASTMatchersInternal.cpp:649
clang::ast_matchers::hasEitherOperand
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:4391
clang::ast_matchers::dynamic::VariantMatcher
A variant matcher object.
Definition: VariantValue.h:93
clang::ast_matchers::unaryOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryOperator > unaryOperator
Matches unary operator expressions.
Definition: ASTMatchersInternal.cpp:736
clang::ast_matchers::characterLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, CharacterLiteral > characterLiteral
Matches character literals (also matches wchar_t).
Definition: ASTMatchersInternal.cpp:720
clang::ast_matchers::cxxTemporaryObjectExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXTemporaryObjectExpr > cxxTemporaryObjectExpr
Matches functional cast expressions having N != 1 arguments.
Definition: ASTMatchersInternal.cpp:763
clang::ast_matchers::cxxConstructorDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXConstructorDecl > cxxConstructorDecl
Matches C++ constructor declarations.
Definition: ASTMatchersInternal.cpp:598
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:621
clang::ast_matchers::implicitCastExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitCastExpr > implicitCastExpr
Matches the implicit cast nodes of Clang&#39;s AST.
Definition: ASTMatchersInternal.cpp:758
clang::ast_matchers::nestedNameSpecifier
const internal::VariadicAllOfMatcher< NestedNameSpecifier > nestedNameSpecifier
Matches nested name specifiers.
Definition: ASTMatchersInternal.cpp:802
clang::ast_matchers::cxxBoolLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBoolLiteralExpr > cxxBoolLiteral
Matches bool literals.
Definition: ASTMatchersInternal.cpp:717
clang::ast_matchers::hasName
internal::Matcher< NamedDecl > hasName(const std::string &Name)
Matches NamedDecl nodes that have the specified name.
Definition: ASTMatchers.h:2526
clang::ast_matchers::stmtExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, StmtExpr > stmtExpr
Matches statement expression (GNU extension).
Definition: ASTMatchersInternal.cpp:733
clang::ast_matchers::objcObjectPointerType
const AstTypeMatcher< ObjCObjectPointerType > objcObjectPointerType
Matches an Objective-C object pointer type, which is different from a pointer type, despite being syntactically similar.
Definition: ASTMatchersInternal.cpp:823
clang::ast_type_traits::operator<<
raw_ostream & operator<<(raw_ostream &OS, ASTNodeKind K)
Definition: ASTTypeTraits.h:195
clang::ast_matchers::accessSpecDecl
const internal::VariadicDynCastAllOfMatcher< Decl, AccessSpecDecl > accessSpecDecl
Matches C++ access specifier declarations.
Definition: ASTMatchersInternal.cpp:583
clang::ast_matchers::templateTypeParmType
const AstTypeMatcher< TemplateTypeParmType > templateTypeParmType
Matches template type parameter types.
Definition: ASTMatchersInternal.cpp:835
VariantValue.h
Polymorphic value type.
clang::ast_matchers::compoundStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, CompoundStmt > compoundStmt
Matches compound statements.
Definition: ASTMatchersInternal.cpp:710
clang::ast_matchers::stringLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, StringLiteral > stringLiteral
Matches string literals (also matches wide string literals).
Definition: ASTMatchersInternal.cpp:718
clang::ast_matchers::blockDecl
const internal::VariadicDynCastAllOfMatcher< Decl, BlockDecl > blockDecl
Matches block declarations.
Definition: ASTMatchersInternal.cpp:641
clang::ast_matchers::constantArrayType
const AstTypeMatcher< ConstantArrayType > constantArrayType
Matches C arrays with a specified constant size.
Definition: ASTMatchersInternal.cpp:810
clang::ast_matchers::dynamic::internal::MatcherDescriptor::getArgKinds
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...
clang::ast_matchers::dynamic::internal::MatcherDescriptor::isConvertibleTo
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.
clang::ast_matchers::cxxDestructorDecl
const internal::VariadicDynCastAllOfMatcher< Decl, CXXDestructorDecl > cxxDestructorDecl
Matches explicit C++ destructor declarations.
Definition: ASTMatchersInternal.cpp:600
clang::ast_matchers::referenceType
const AstTypeMatcher< ReferenceType > referenceType
Matches both lvalue and rvalue reference types.
Definition: ASTMatchersInternal.cpp:824
clang::ast_matchers::dynamic::ArgKind
Kind identifier.
Definition: VariantValue.h:34
clang::ast_matchers::objcMessageExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCMessageExpr > objcMessageExpr
Matches ObjectiveC Message invocation expressions.
Definition: ASTMatchersInternal.cpp:627
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:580
clang::ast_matchers::lValueReferenceType
const AstTypeMatcher< LValueReferenceType > lValueReferenceType
Matches lvalue reference types.
Definition: ASTMatchersInternal.cpp:825
clang::ast_matchers::whileStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, WhileStmt > whileStmt
Matches while statements.
Definition: ASTMatchersInternal.cpp:698
clang::ast_matchers::enumType
const AstTypeMatcher< EnumType > enumType
Matches enum types.
Definition: ASTMatchersInternal.cpp:828
clang::ast_matchers::blockPointerType
const AstTypeMatcher< BlockPointerType > blockPointerType
Matches block pointer types, i.e.
Definition: ASTMatchersInternal.cpp:820
isExternC
static bool isExternC(const NamedDecl *ND)
Definition: Mangle.cpp:54
REGISTER_MATCHER_OVERLOAD
#define REGISTER_MATCHER_OVERLOAD(name)
Definition: Registry.cpp:73