summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers/Dynamic
Commit message (Collapse)AuthorAgeFilesLines
...
* [ASTMatchers] Introduce Objective-C matchers `hasReceiver` and ↵George Karpenkov2018-07-161-0/+2
| | | | | | | | `isInstanceMessage` for ObjCMessageExpr Differential Revision: https://reviews.llvm.org/D49333 llvm-svn: 337209
* [ASTMatchers] A matcher for Objective-C @autoreleasepoolGeorge Karpenkov2018-07-061-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D48910 llvm-svn: 336468
* [ASTMatchers] Introduce a blockDecl matcher for matching block declarationsGeorge Karpenkov2018-05-161-0/+1
| | | | | | | | Blocks can be matched just as well as functions or Objective-C methods. Differential Revision: https://reviews.llvm.org/D46980 llvm-svn: 332545
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-094-41/+41
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [ASTMatchers] Introduce a matcher for matching any given Objective-C selectorGeorge Karpenkov2018-03-291-0/+1
| | | | | | | | Incudes a tiny related refactoring. Differential Revision: https://reviews.llvm.org/D44858 llvm-svn: 328747
* [clang] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-03-271-2/+2
| | | | | | | | | | | r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. llvm-svn: 328636
* [ASTMatchers] Add isAssignmentOperator matcherPeter Szecsi2018-03-271-0/+1
| | | | | | | | | | | Adding a matcher for BinaryOperator and cxxOperatorCallExpr to be able to decide whether it is any kind of assignment operator or not. This would be useful since allows us to easily detect assignments via matchers for static analysis (Tidy, SA) purposes. Differential Revision: https://reviews.llvm.org/D44893 llvm-svn: 328618
* Add hasTrailingReturn AST matcherJulie Hockett2018-01-221-0/+1
| | | | | | | | Adds AST matcher for a FunctionDecl that has a trailing return type. Differential Revision: https://reviews.llvm.org/D42273 llvm-svn: 323158
* [ASTMatcher] Add isScoped matcher for enumDecl.Haojian Wu2018-01-181-0/+1
| | | | | | | | | | | | Summary: Reviewers: bkramer, aaron.ballman Subscribers: aaron.ballman, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D42185 llvm-svn: 322826
* [ASTMatchers] Add isNoReturn() match narrower for FunctionDeclarationsRoman Lebedev2018-01-171-0/+1
| | | | | | | | | | | | | | Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: dblaikie, klimek, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D41455 llvm-svn: 322746
* Remove creation of out-of-bounds value of enumeration type (resulting in UB).Richard Smith2017-12-081-12/+10
| | | | | | | Also remove unnecessary initialization of out-parameters with this value, so that MSan is able to catch errors appropriately. llvm-svn: 320212
* Add the hasDefinition() AST matcher to match class declarations that also ↵Aaron Ballman2017-11-291-0/+1
| | | | | | | | have a definition. Patch by Julie Hockett. llvm-svn: 319360
* [ASTMatchers] Matchers for new[] operatorsAdam Balogh2017-11-231-0/+2
| | | | | | | | Two new matchers for `CXXNewExpr` are added which may be useful e.g. in `clang-tidy` checkers. One of them is `isArray` which matches `new[]` but not plain `new`. The other one, `hasArraySize` matches `new[]` for a given size. llvm-svn: 318909
* Add an AST matcher for hasDefaultArgument() to match on parameter ↵Aaron Ballman2017-11-211-0/+1
| | | | | | | | declarations that have a default value. Patch by Julie Hockett. llvm-svn: 318794
* Add ObjC exception statement AST matchersDave Lee2017-11-111-0/+4
| | | | | | | | | | | | | | Summary: Add AST matchers for Objective-C @throw, @try, @catch and @finally. Reviewers: aaron.ballman, malcolm.parsons, alexshap, compnerd Reviewed By: aaron.ballman Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D39940 llvm-svn: 317992
* [ASTMatchers] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-013-68/+125
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 317137
* Add objcCategoryImplDecl matcherDave Lee2017-10-261-0/+1
| | | | | | | | | | | | | | | | | Summary: Add `objcCategoryImplDecl` which matches ObjC category definitions (`@implementation`). This matcher complements `objcCategoryDecl` (`@interface`) which was added in D30854. Reviewers: aaron.ballman, malcolm.parsons, alexshap Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D39293 llvm-svn: 316670
* [ASTMatchers] Expose forEachOverriden in dynamic AST matchers.Benjamin Kramer2017-10-231-0/+1
| | | | llvm-svn: 316344
* Add objcImplementationDecl matcherDave Lee2017-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Add the `objcImplementationDecl` matcher. See related: D30854 Tested with: ``` ./tools/clang/unittests/ASTMatchers/ASTMatchersTests ``` Reviewers: aaron.ballman, compnerd, alexshap Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37643 llvm-svn: 312889
* Register linkageSpecDecl matcherDave Lee2017-08-311-0/+1
| | | | | | | | | | | | | | | | | Summary: This allows `linkageSpecDecl` to be used from `clang-query`. See also D31869 which similary adds `isStaticStorageClass`. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D37346 llvm-svn: 312283
* [ASTMatchers] Fix use after free.Benjamin Kramer2017-06-091-1/+2
| | | | | | Found by asan. llvm-svn: 305094
* [ASTMatchers] Add clang-query support for equals matcherPeter Wu2017-06-081-9/+19
| | | | | | | | | | | | | Summary: This allows the clang-query tool to use matchers like "integerLiteral(equals(32))". For this to work, an overloaded function is added for each possible parameter type. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D33094 llvm-svn: 305022
* [ASTMatchers] Add support for floatLiteralsPeter Wu2017-06-084-15/+81
| | | | | | | | | | | | | Summary: Needed to support something like "floatLiteral(equals(1.0))". The parser for floating point numbers is kept simple, so instead of ".1" you have to use "0.1". Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D33135 llvm-svn: 305021
* [ASTMatchers] Add support for boolean literalsPeter Wu2017-06-083-2/+52
| | | | | | | | | | | | | Summary: Recognize boolean literals for future extensions ("equals(true)"). Note that a specific VariantValue constructor is added to resolve ambiguity (like "Value = 5") between unsigned and bool. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D33093 llvm-svn: 305020
* 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
* 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
* [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
* 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
OpenPOWER on IntegriCloud