summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers
Commit message (Collapse)AuthorAgeFilesLines
...
* Add cxxStdInitializerListExpr AST matcherJakub Kuderski2017-05-051-0/+1
| | | | | | | | | | | | | | | | | Summary: This adds a new ASTMatcher for CXXStdInitializerListExprs that matches C++ initializer list expressions. The primary motivation is to use it to fix [[ https://bugs.llvm.org/show_bug.cgi?id=32896 | PR32896 ]] (review here [[ https://reviews.llvm.org/D32767 | D32767 ]]). Reviewers: alexfh, Prazek, aaron.ballman Reviewed By: alexfh, aaron.ballman Subscribers: malcolm.parsons, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D32810 llvm-svn: 302287
* [clang] Register isConstexpr matcherAlexander Shaposhnikov2017-04-161-0/+1
| | | | | | | | | | | | | This diff registers isConstexpr matcher. Test plan: make check-all check that "match varDecl(isConstexpr())" works in clang-query Differential revision: https://reviews.llvm.org/D32112 llvm-svn: 300427
* Add isStaticStorageClass to the dynamic matcher registry so that it can be ↵Aaron Ballman2017-04-151-0/+1
| | | | | | | | used from clang-query. Patch by Dave Lee. llvm-svn: 300400
* [ASTMatchers] add typeAliasTemplateDecl matcher.Eric Liu2017-03-281-0/+1
| | | | | | | | | | | | Reviewers: hokein, aaron.ballman Reviewed By: aaron.ballman Subscribers: aaron.ballman, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D28671 llvm-svn: 298912
* Add AST matchers for ObjCProtocolDecl, ObjCCategoryDecl, ObjCMethodDecl, ↵Aaron Ballman2017-03-151-0/+5
| | | | | | | | ObjCIvarDecl, and ObjCPropertyDecl. Patch by Dave Lee. llvm-svn: 297882
* Move VariantMatcher's Payload to std::shared_ptr rather than IntrusiveRefCntPtrDavid Blaikie2017-01-051-3/+5
| | | | llvm-svn: 291156
* [ASTMatchers] Add hasInClassInitializer traversal matcher for FieldDecl.Malcolm Parsons2016-12-241-0/+1
| | | | | | | | | | | | | | | Summary: I needed to know whether a FieldDecl had an in-class initializer for D26453. I used a narrowing matcher there, but a traversal matcher might be generally useful. Reviewers: sbenza, bkramer, klimek, aaron.ballman Subscribers: aaron.ballman, Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D28034 llvm-svn: 290492
* [ASTMatcher] Add hasReplacementType matcher for SubstTemplateTypeParmTypeMalcolm Parsons2016-12-081-0/+1
| | | | | | | | | | | | Summary: Needed for https://reviews.llvm.org/D27166 Reviewers: sbenza, bkramer, klimek Subscribers: aemerson, cfe-commits Differential Revision: https://reviews.llvm.org/D27447 llvm-svn: 289042
* Adds hasUnqualifiedDesugaredType to allow matching through type sugar.Manuel Klimek2016-12-011-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D27207 llvm-svn: 288366
* [AST] Convert Marshallers to use unique_ptr.Justin Lebar2016-10-102-60/+62
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D25425 llvm-svn: 283773
* Complete support for the cxxCtorInitializer() AST matcher so that it can be ↵Aaron Ballman2016-09-261-0/+38
| | | | | | used as a top-level matcher. llvm-svn: 282417
* Add an AST matcher for external formal linkage.Aaron Ballman2016-08-171-0/+1
| | | | | | Patch by Visoiu Mistrih llvm-svn: 278926
* [ASTMatchers] Add templateTypeParmDecl() to Registry.cppMartin Bohme2016-08-121-0/+1
| | | | | | | | | | | | | | Summary: This appears to have been forgotten when templateTypeParmDecl() was initially added. Reviewers: alexfh, aaron.ballman Subscribers: aaron.ballman, klimek, aemerson, rengolin, samparker, cfe-commits Differential Revision: https://reviews.llvm.org/D23448 llvm-svn: 278507
* [ASTMatchers] Add matchers canReferToDecl() and hasUnderlyingDecl()Martin Bohme2016-08-091-0/+2
| | | | | | | | | | | | Summary: Required for D22220 Reviewers: sbenza, klimek, aaron.ballman, alexfh Subscribers: alexfh, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D23004 llvm-svn: 278123
* [ASTMatcher] Add templateName matcher.Haojian Wu2016-07-291-0/+1
| | | | | | | | | | Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D22963 llvm-svn: 277155
* Move some IntrusiveRefCntPtrs instead of copying.Benjamin Kramer2016-07-211-6/+7
| | | | | | No functionality change intended. llvm-svn: 276292
* [NFC] Header cleanupMehdi Amini2016-07-181-1/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* [ASTMatchers] isSignedInteger() and isUnsignedInteger()Clement Courbet2016-07-121-0/+2
| | | | | | | | Complementary to isInteger(), these match signed and unsigned integers respectively. Review: http://reviews.llvm.org/D21989 llvm-svn: 275157
* Add AST matchers for handling bit-fields and narrowing based on their width.Aaron Ballman2016-07-061-0/+2
| | | | llvm-svn: 274652
* [ASTMatcher] Add a node matcher for EnumType.Haojian Wu2016-06-301-0/+1
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D21860 llvm-svn: 274217
* [ASTMatchers] Add isLambda() matcher.Samuel Benzaquen2016-06-281-0/+1
| | | | llvm-svn: 274015
* IgnoringImplicit matcher.Cong Liu2016-06-241-0/+1
| | | | llvm-svn: 273659
* Apply some suggestions from clang-tidy's performance-unnecessary-value-param.Benjamin Kramer2016-06-151-1/+1
| | | | | | No functionality change intended. llvm-svn: 272789
* Adding an AST matcher to ignore parenthesis in *types* (rather than ↵Aaron Ballman2016-06-061-0/+1
| | | | | | expressions). This is required for traversing certain types (like function pointer types). llvm-svn: 271927
* [ASTMatcher] Add a node matcher for UnresolvedLookupExpr.Haojian Wu2016-05-181-0/+1
| | | | | | | | | | 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/+1
| | | | | | | | that have a dynamic exception specification. Patch by Don Hinton. llvm-svn: 269662
* Add an AST matcher for CastExpr kindEtienne Bergeron2016-05-132-0/+23
| | | | | | | | | | | | | | 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
* [ASTMatchers] New matcher forFunctionGabor Horvath2016-05-041-0/+1
| | | | | | | | | | | | 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
* [ASTMatchers] Do not try to memoize nodes we can't compare.Samuel Benzaquen2016-04-191-19/+30
| | | | | | | | | | | | | | | | Summary: Prevent hasAncestor from comparing nodes that are not supported. hasDescendant was fixed some time ago to avoid this problem. I'm applying the same fix to hasAncestor: if any object in the Builder map is not comparable, skip the cache. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D19231 llvm-svn: 266748
* Add typedefNameDecl() and typeAliasDecl() to the AST matchers; improves ↵Aaron Ballman2016-04-141-0/+2
| | | | | | | | hasType() to match on TypedefNameDecl nodes. Patch by Clement Courbet. llvm-svn: 266331
* [ASTMatchers] Add own version of VariadicFunction.Samuel Benzaquen2016-03-251-5/+6
| | | | | | | | | | | | | | | | Summary: llvm::VariadicFunction is only being used by ASTMatchers. Having our own copy here allows us to remove the other one from llvm/ADT. Also, we can extend the API to meet our needs without modifying the common implementation. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D18275 llvm-svn: 264417
* [ASTMatchers] New matcher hasReturnValue addedAlexander Kornienko2016-03-221-0/+1
| | | | | | | | | | | | | | 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-0/+13
| | | | | | | | binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr. Patch by Aleksei Sidorin. llvm-svn: 263027
* Fix a -Wunused-variable diagnostic.Alexander Kornienko2016-02-231-0/+2
| | | | llvm-svn: 261626
* Fix Visual Studio build after r261574Hans Wennborg2016-02-221-3/+3
| | | | llvm-svn: 261583
* [ASTMatchers] Add matcher hasAnyName.Samuel Benzaquen2016-02-222-51/+108
| | | | | | | | | | | | 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-0/+1
| | | | | | double, but not complex. llvm-svn: 261221
* Add a nullPointerConstant() AST matcher to handle variations of null pointer ↵Aaron Ballman2016-02-161-0/+1
| | | | | | constants in one matcher. llvm-svn: 261008
* Add isAnyPointer() matchers. Register missing matchers.Felix Berger2016-02-151-0/+2
| | | | | | | | | | | | | Summary: The isAnyPointer() matcher is useful for http://reviews.llvm.org/D15623. Reviewers: alexfh, klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15819 llvm-svn: 260872
* Reduce the number of implicit StringRef->std::string conversions by ↵Benjamin Kramer2016-02-131-2/+3
| | | | | | | | threading StringRef through more APIs. No functionality change intended. llvm-svn: 260815
* Simplify and rename ASTMatchFinder's getCXXRecordDecl to make it more obviousRichard Smith2016-02-091-41/+23
| | | | | | what it's actually trying to do. llvm-svn: 260277
* Pass /bigobj when building lib/ASTMatchers/Dynamic/Registry.cppReid Kleckner2016-02-091-0/+9
| | | | | | | | | This is the third time it has crossed the 2^16 section limit. We've already spent time optimizing this file to reduce template instantiations, and it's not clear that there is anymore low hanging fruit. llvm-svn: 260267
* Registering the gnuNullExpr AST matcher as a dynamic matcher so that it is ↵Aaron Ballman2016-02-091-0/+1
| | | | | | available from clang-query. llvm-svn: 260222
* [ASTMatchers] Allow hasName() to look through inline namespacesSamuel Benzaquen2016-02-051-21/+125
| | | | | | | | | | | | | | | | | Summary: Allow hasName() to look through inline namespaces. This will fix the interaction between some clang-tidy checks and libc++. libc++ defines names in an inline namespace named std::<version_#>. When we try to match a name using hasName("std::xxx") it fails to match and the clang-tidy check does not work. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D15506 llvm-svn: 259898
* Reapply r259210 with a fix for RegistryTest.cpp.Aaron Ballman2016-02-011-0/+1
| | | | | | Patch by Richard Thomson. llvm-svn: 259359
* Revert r259210 "Extend hasType narrowing matcher for TypedefDecls, add ↵Hans Wennborg2016-01-291-1/+0
| | | | | | | | 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-0/+1
| | | | | | | | matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes. Patch by Richard Thomson llvm-svn: 259210
* Remove autoconf supportChris Bieneman2016-01-262-28/+0
| | | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 llvm-svn: 258862
* Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.Eugene Zelenko2016-01-261-9/+7
| | | | | | Differential revision: http://reviews.llvm.org/D16567 llvm-svn: 258836
* Add am AST matcher for isMoveAssignmentOperator.Aaron Ballman2016-01-221-0/+1
| | | | | | Patch by Jonathan Coe. llvm-svn: 258573
OpenPOWER on IntegriCloud