summaryrefslogtreecommitdiffstats
path: root/clang/docs/LibASTMatchersReference.html
Commit message (Collapse)AuthorAgeFilesLines
...
* [ASTMatchers] Add isLambda() matcher.Samuel Benzaquen2016-06-281-0/+11
| | | | llvm-svn: 274015
* IgnoringImplicit matcher.Cong Liu2016-06-241-3/+22
| | | | llvm-svn: 273659
* Revert "[ASTMatchers] New forEachOverriden matcher."Chandler Carruth2016-06-111-24/+0
| | | | | | | This reverts commit r272386. It doesn't compile with MSVC and those bots have been red the entire day as a consequence. llvm-svn: 272453
* [ASTMatchers] New forEachOverriden matcher.Clement Courbet2016-06-101-0/+24
| | | | | | Matches methods overridden by the given method. llvm-svn: 272386
* Make isNoThrow and hasDynamicExceptionSpec polymorphic so they can be used ↵Aaron Ballman2016-06-071-4/+36
| | | | | | | | with both functionDecl and functionPrototype matchers. Patch by Don Hinton. llvm-svn: 272028
* Adding an AST matcher to ignore parenthesis in *types* (rather than ↵Aaron Ballman2016-06-061-0/+15
| | | | | | expressions). This is required for traversing certain types (like function pointer types). llvm-svn: 271927
* [ASTMatchers] Add support of hasCondition for SwitchStmt.Etienne Bergeron2016-05-301-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The switch statement could be added to the hasCondition matcher. Example: ``` clang-query> match switchStmt(hasCondition(ignoringImpCasts(declRefExpr()))) ``` Output: ``` Match #1: Binding for "root": SwitchStmt 0x2f9b528 </usr/local/google/home/etienneb/examples/enum.cc:35:3, line:38:3> |-<<<NULL>>> |-ImplicitCastExpr 0x2f9b510 <line:35:11> 'int' <IntegralCast> | `-ImplicitCastExpr 0x2f9b4f8 <col:11> 'enum Color' <LValueToRValue> | `-DeclRefExpr 0x2f9b4d0 <col:11> 'enum Color' lvalue Var 0x2f9a118 'C' 'enum Color' `-CompoundStmt 0x2f9b610 <col:14, line:38:3> |-CaseStmt 0x2f9b578 <line:36:3, col:22> | |-ImplicitCastExpr 0x2f9b638 <col:8> 'int' <IntegralCast> | | `-DeclRefExpr 0x2f9b550 <col:8> 'enum Size' EnumConstant 0x2f99e40 'Small' 'enum Size' | |-<<<NULL>>> | `-ReturnStmt 0x2f9b5d0 <col:15, col:22> | `-IntegerLiteral 0x2f9b5b0 <col:22> 'int' 1 `-DefaultStmt 0x2f9b5f0 <line:37:3, col:12> `-BreakStmt 0x2f9b5e8 <col:12> 1 match. ``` Reviewers: aaron.ballman, sbenza, klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D20767 llvm-svn: 271208
* [ASTMatcher] Add a node matcher for UnresolvedLookupExpr.Haojian Wu2016-05-181-0/+15
| | | | | | | | | | Reviewers: alexfh, aaron.ballman Subscribers: aaron.ballman, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D20360 llvm-svn: 269916
* Add the hasDynamicExceptionSpec() AST matcher to match function declarations ↵Aaron Ballman2016-05-161-0/+16
| | | | | | | | that have a dynamic exception specification. Patch by Don Hinton. llvm-svn: 269662
* Add an AST matcher for CastExpr kindEtienne Bergeron2016-05-131-0/+9
| | | | | | | | | | | | | | Summary: This AST matcher will match a given CastExpr kind. It's an narrowing matcher on CastExpr. Reviewers: klimek, alexfh, sbenza, aaron.ballman Subscribers: Prazek, jroelofs, aaron.ballman, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D19871 llvm-svn: 269460
* Add an AST matcher for string-literal lengthEtienne Bergeron2016-05-121-4/+29
| | | | | | | | | | | | | | | | Summary: This patch is adding support for a matcher to check string literal length. This matcher is used in clang-tidy checkers and is part of this refactoring: see: http://reviews.llvm.org/D19841 Reviewers: sbenza, klimek, aaron.ballman Subscribers: alexfh, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D19876 llvm-svn: 269274
* Fix the doc extraction script to work with hasAnyName and with equalsNode.Samuel Benzaquen2016-05-041-3/+34
| | | | | | | | | The change from llvm::VariadicFunction to internal::VariadicFunction broke the extraction of hasAnyName(). equalsNode was broken because the argument type is 'const XXXX*' and the internal space caused a failure on the regex. llvm-svn: 268548
* [ASTMatchers] New matcher forFunctionGabor Horvath2016-05-041-0/+14
| | | | | | | | | | | | Summary: Matcher proposed in the review of checker misc-assign-operator (name pending). Its goal is to find the direct enclosing function declaration of a statement and run the inner matcher on it. Two version is attached in this patch (thus it will not compile), to be decided which approach to take. The second one always chooses one single parent while the first one does a depth-first search upwards (thus a height-first search) and returns the first positive match of the inner matcher (thus it always returns zero or one matches, not more). Further questions: is it enough to implement it in-place, or ASTMatchersInternals or maybe ASTMatchFinder should be involved? Reviewers: sbenza Subscribers: aaron.ballman, klimek, o.gyorgy, xazax.hun, cfe-commits Differential Revision: http://reviews.llvm.org/D19357 llvm-svn: 268490
* Add typedefNameDecl() and typeAliasDecl() to the AST matchers; improves ↵Aaron Ballman2016-04-141-2/+25
| | | | | | | | hasType() to match on TypedefNameDecl nodes. Patch by Clement Courbet. llvm-svn: 266331
* Add AST Matchers for CXXConstructorDecl::isDelegatingConstructor and ↵Alexander Kornienko2016-04-131-13/+38
| | | | | | | | | | | | | | | | CXXMethodDecl::isUserProvided. Summary: Added two AST matchers: isDelegatingConstructor for CXXConstructorDecl::IsDelegatingConstructor; and isUserProvided corresponding to CXXMethodDecl::isUserProvided. Reviewers: aaron.ballman, alexfh Subscribers: klimek, cfe-commits Patch by Michael Miller! Differential Revision: http://reviews.llvm.org/D19038 llvm-svn: 266189
* [ASTMatchers] Existing matcher hasAnyArgument fixedGabor Horvath2016-03-301-10/+0
| | | | | | | | | | | | Summary: A checker (will be uploaded after this patch) needs to check implicit casts. The checker needs matcher hasAnyArgument but it ignores implicit casts and parenthesized expressions which disables checking of implicit casts for arguments in the checker. However the documentation of the matcher contains a FIXME that this should be removed once separate matchers for ignoring implicit casts and parenthesized expressions are ready. Since these matchers were already there the fix could be executed. Only one Clang checker was affected which was also fixed (ignoreParenImpCasts added) and is separately uploaded. Third party checkers (not in the Clang repository) may be affected by this fix so the fix must be emphasized in the release notes. Reviewers: klimek, sbenza, alexfh Subscribers: alexfh, klimek, xazax.hun, cfe-commits Differential Revision: http://reviews.llvm.org/D18243 llvm-svn: 264855
* [ASTMatchers] New matcher hasReturnValue addedAlexander Kornienko2016-03-221-0/+12
| | | | | | | | | | | | | | Summary: A checker (will be uploaded after this patch) needs to check implicit casts. Existing generic matcher "has" ignores implicit casts and parenthesized expressions and no specific matcher for matching return value expression preexisted. The patch adds such a matcher (hasReturnValue). Reviewers: klimek, sbenza Subscribers: xazax.hun, klimek, cfe-commits Patch by Ádám Balogh! Differential Revision: http://reviews.llvm.org/D17986 llvm-svn: 264037
* Adding new AST matchers for: addrLabelExpr, atomicExpr, ↵Aaron Ballman2016-03-091-73/+243
| | | | | | | | binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr. Patch by Aleksei Sidorin. llvm-svn: 263027
* [ASTMatchers] Add matcher hasAnyName.Samuel Benzaquen2016-02-221-0/+10
| | | | | | | | | | | | Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...) Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D17163 llvm-svn: 261574
* Add an AST matcher for real floating-point types. e.g., float, double, long ↵Aaron Ballman2016-02-181-18/+40
| | | | | | double, but not complex. llvm-svn: 261221
* Add a nullPointerConstant() AST matcher to handle variations of null pointer ↵Aaron Ballman2016-02-161-0/+17
| | | | | | constants in one matcher. llvm-svn: 261008
* Reapply r259210 with a fix for RegistryTest.cpp.Aaron Ballman2016-02-011-8/+64
| | | | | | Patch by Richard Thomson. llvm-svn: 259359
* Revert r259210 "Extend hasType narrowing matcher for TypedefDecls, add ↵Hans Wennborg2016-01-291-64/+8
| | | | | | | | functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes." It didn't pass check-clang. llvm-svn: 259218
* Extend hasType narrowing matcher for TypedefDecls, add functionProtoType ↵Aaron Ballman2016-01-291-8/+64
| | | | | | | | matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes. Patch by Richard Thomson llvm-svn: 259210
* Improving documentation for the isMoveAssignmentOperator AST matcher.Aaron Ballman2016-01-231-5/+7
| | | | | | Patch by Jonathan Coe. llvm-svn: 258628
* Properly encode the &lt; entity; it was missing the semicolon. Regenerating ↵Aaron Ballman2016-01-221-520/+520
| | | | | | the AST matcher reference after fixing the issue. Thanks to Richard for noticing the issue and bringing it to my attention! llvm-svn: 258579
* Add am AST matcher for isMoveAssignmentOperator.Aaron Ballman2016-01-221-0/+15
| | | | | | Patch by Jonathan Coe. llvm-svn: 258573
* Add an isVirtualAsWritten AST matcher.Nico Weber2016-01-211-0/+14
| | | | | | http://reviews.llvm.org/D16394 llvm-svn: 258415
* When dumping documentation for AST matchers, do something more useful with ↵Aaron Ballman2016-01-211-16/+17
| | | | | | | | \see doxygen commands. Ideally this would link to the target of \see, but for now it translates \see into "See also: " Regenerate the AST documentation for this new functionality. llvm-svn: 258401
* Add AST matcher support for FunctionDecls with the hasBody matcher.Aaron Ballman2016-01-201-8/+21
| | | | | | Patch by Aleksei Sidorin. llvm-svn: 258322
* Add AST matcher for paren expressions.Aaron Ballman2016-01-201-0/+8
| | | | | | Patch by Adrian Zgorzałek. llvm-svn: 258321
* Add an AST matcher for checking whether a function is defaulted.Aaron Ballman2016-01-181-0/+11
| | | | | | Patch by Jonathan Coe. llvm-svn: 258072
* Augments r258042; changes the AST matcher tests to use matchesNot and ↵Aaron Ballman2016-01-181-0/+34
| | | | | | EXPECT_TRUE instead of EXPECT_FALSE. Adds a matcher test to ensure that static member functions are properly handled. Generates the documentation from the matcher. llvm-svn: 258070
* [ASTMatchers] Fix typo in booleanType() doc.Samuel Benzaquen2015-12-221-0/+22
| | | | | | | Fix typo in booleanType() doc and recreate the LibASTMatchersReference.html reference document. llvm-svn: 256284
* Add a narrowing AST matcher that matches on a FunctionDecl with a ↵Aaron Ballman2015-12-021-0/+14
| | | | | | non-throwing exception specification. llvm-svn: 254516
* Add an AST matcher for narrowing when a type is volatile-qualified.Aaron Ballman2015-11-231-0/+17
| | | | llvm-svn: 253882
* Regenerate ASTMatchersReference without CRLF.Benjamin Kramer2015-11-201-139/+139
| | | | llvm-svn: 253654
* Fix ASTMatcher reference newlines and make the generator script windows-proof.Benjamin Kramer2015-11-201-4688/+4688
| | | | llvm-svn: 253653
* Re-committing r253473 after hopefully fixing the bot breakage. There was a ↵Aaron Ballman2015-11-181-0/+73
| | | | | | copy-pasta issue that my local testing did not catch. llvm-svn: 253481
* Reverting r253473 while I investigate build bot failures.Aaron Ballman2015-11-181-73/+0
| | | | llvm-svn: 253475
* Adding AST matchers for VarDecl storage durations. Can now determine whether ↵Aaron Ballman2015-11-181-0/+73
| | | | | | a VarDecl has automatic, static, or thread storage duration. This also updates the documentation for matchers, which appear to be missing some previous additions. llvm-svn: 253473
* Add an AST node matcher for TemplateTypeParmDecl objects.Eric Fiselier2015-10-171-1/+11
| | | | llvm-svn: 250602
* Add decayedType and hasDecayedType AST matchersMatthias Gehre2015-10-121-0/+17
| | | | | | | | | | | | Summary: Add decayedType and hasDecayedType AST matchers Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13639 llvm-svn: 250114
* Adding an AST node matcher for NonTypeTemplateParmDecl objects.Aaron Ballman2015-10-051-1/+11
| | | | llvm-svn: 249341
* Adding a narrowing AST matcher for FunctionDecl::isVariadic(), plus tests ↵Aaron Ballman2015-10-051-0/+12
| | | | | | and documentation. llvm-svn: 249321
* Rename AST node matchers to match the AST node names directly. Part of this ↵Aaron Ballman2015-09-171-336/+405
| | | | | | rename also splits recordDecl() (which used to match CXXRecordDecl) into recordDecl() (that matches RecordDecl) and cxxRecordDecl (that matches CXXRecordDecl). Also adds isStruct(), isUnion(), and isClass() narrowing matchers for RecordDecl objects. llvm-svn: 247885
* Fixed HasDeclarationMatcher to properly convert all types into decls where ↵Aaron Ballman2015-09-111-3/+69
| | | | | | | | | | | | | | possible. Added objcObjectPointerType(), objcInterfaceDecl(), templateTypeParmType(), injectedClassNameType(), and unresolvedUsingTypenameDecl(). Updated documentation for pointerType() to call out that it does not match ObjCObjectPointerType types. Changed pointsTo() to handle ObjCObjectPointerType as well as PointerType. While this may seem like a lot of unrelated changes, they all relate back to fixing HasDeclarationMatcher. This now allows us to write a matcher like: varDecl(hasType(namedDecl(hasName("Foo")))) that matches code using typedefs, objc interfaces, template type parameters, injected class names, or unresolved using typenames. llvm-svn: 247404
* Updating the AST matcher documentation with a new entry; NFC.Aaron Ballman2015-08-281-0/+14
| | | | llvm-svn: 246324
* Adding an AST matcher for namespaceAliasDecl.Aaron Ballman2015-08-281-0/+11
| | | | llvm-svn: 246322
* Add AST narrowing matchers for inline and anonymous namespaces. Since the ↵Aaron Ballman2015-08-181-4504/+4545
| | | | | | inline keyword can also be specified on a FunctionDecl, this is a polymorphic matcher. llvm-svn: 245337
OpenPOWER on IntegriCloud