summaryrefslogtreecommitdiffstats
path: root/docs/LibASTMatchersReference.html
Commit message (Collapse)AuthorAgeFilesLines
* Added an AST matcher for declarations that are in the `std` namespaceDmitri Gribenko2019-05-031-0/+23
| | | | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61480 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359876 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Introduce Objective-C matchers `isClassMessage`, ↵Ben Hamilton2019-04-221-1/+38
| | | | | | | | | | | | | | | | | | | | | | | `isClassMethod`, and `isInstanceMethod` Summary: isClassMessage is an equivalent to isInstanceMessage for ObjCMessageExpr, but matches message expressions to classes. isClassMethod and isInstanceMethod check whether a method declaration (or definition) is for a class method or instance method (respectively). Contributed by @mywman! Reviewers: benhamilton, klimek, mwyman Reviewed By: benhamilton, mwyman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60920 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358904 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing a typo; NFC.Aaron Ballman2019-04-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357579 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatcher] Add clang-query disclaimer to two more matchers that take enumRoman Lebedev2019-03-211-0/+6
| | | | | | | | | | | As we have figured out in https://reviews.llvm.org/D57112 and https://bugs.llvm.org/show_bug.cgi?id=41176 this kind-of works, but needs special care. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356677 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers][OpenMP] OpenMP Structured-block-related matchersRoman Lebedev2019-03-211-0/+45
| | | | | | | | | | | | | | | | | Summary: Exposes to the for ASTMatchers the interface/modelling of OpenMP structured-block. Reviewers: gribozavr, aaron.ballman, JonasToth, george.karpenkov Reviewed By: gribozavr, aaron.ballman Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang, #openmp Differential Revision: https://reviews.llvm.org/D59463 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356676 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTTypeTraits][ASTMatchers][OpenMP] OMPClause handlingRoman Lebedev2019-03-211-0/+71
| | | | | | | | | | | | | | | | | | | Summary: `OMPClause` is the base class, it is not descendant from **any** other class, therefore for it to work with e.g. `VariadicDynCastAllOfMatcher<>`, it needs to be handled here. Reviewers: sbenza, bkramer, pcc, klimek, hokein, gribozavr, aaron.ballman, george.karpenkov Reviewed By: gribozavr, aaron.ballman Subscribers: guansong, jdoerfert, alexfh, ABataev, cfe-commits Tags: #openmp, #clang Differential Revision: https://reviews.llvm.org/D57112 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356675 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers][OpenMP] Add base ompExecutableDirective() matcher.Roman Lebedev2019-03-211-0/+14
| | | | | | | | | | | | | | | | | | Summary: A simple matcher for `OMPExecutableDirective` Stmt type. Split off from D57113. Reviewers: gribozavr, aaron.ballman, JonasToth, george.karpenkov Reviewed By: gribozavr, aaron.ballman Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59453 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356674 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add support for importing ChooseExpr AST nodes.Tom Roeder2019-02-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This allows ASTs to be merged when they contain ChooseExpr (the GNU __builtin_choose_expr construction). This is needed, for example, for cross-CTU analysis of C code that makes use of __builtin_choose_expr. The node is already supported in the AST, but it didn't have a matcher in ASTMatchers. So, this change adds the matcher and adds support to ASTImporter. This was originally reviewed and approved in https://reviews.llvm.org/D58292 and submitted as r354832. It was reverted in r354839 due to failures on the Windows CI builds. This version fixes the test failures on Windows, which were caused by differences in template expansion between versions of clang on different OSes. The version of clang built with MSVC and running on Windows never expands the template in the C++ test in ImportExpr.ImportChooseExpr in clang/unittests/AST/ASTImporter.cpp, but the version on Linux does for the empty arguments and -fms-compatibility. So, this version of the patch drops the C++ test for __builtin_choose_expr, since that version was written to catch regressions of the logic for isConditionTrue() in the AST import code for ChooseExpr, and those regressions are also caught by ASTImporterOptionSpecificTestBase.ImportChooseExpr, which does work on Windows. Reviewers: shafik, a_sidorin, martong, aaron.ballman, rnk, a.sidorin Subscribers: cfe-commits, jdoerfert, rnkovacs, aaron.ballman Tags: #clang Differential Revision: https://reviews.llvm.org/D58663 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354916 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r354832 "[ASTImporter] Add support for importing ChooseExpr AST nodes."Reid Kleckner2019-02-261-5/+0
| | | | | | Test does not pass on Windows git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354839 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add support for importing ChooseExpr AST nodes.Tom Roeder2019-02-251-0/+5
| | | | | | | | | | | | | | | | | | | | | Summary: This allows ASTs to be merged when they contain ChooseExpr (the GNU __builtin_choose_expr construction). This is needed, for example, for cross-CTU analysis of C code that makes use of __builtin_choose_expr. The node is already supported in the AST, but it didn't have a matcher in ASTMatchers. So, this change adds the matcher and adds support to ASTImporter. Reviewers: shafik, a_sidorin, martong, aaron.ballman Subscribers: aaron.ballman, rnkovacs, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58292 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354832 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.Yitzhak Mandelbaum2019-02-081-32/+79
| | | | | | | | | | | | | | | | Specifically: * fixes the comments on `hasObjectExpression`, * clarifies comments on `thisPointerType` and `on`, * adds comments to `onImplicitObjectArgument`. It also updates associated reference docs (using the doc tool). Reviewers: alexfh, steveire, aaron.ballman Differential Revision: https://reviews.llvm.org/D56849 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353532 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Add AST matcher for initializer list membersHyrum Wright2019-01-071-1/+10
| | | | | | | | | | | | | | Summary: Much like hasArg for various call expressions, this allows LibTooling users to match against a member of an initializer list. This is currently being used as part of the abseil-duration-scale clang-tidy check. Differential Revision: https://reviews.llvm.org/D56090 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350523 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Fix redecl chain of classes and class templatesGabor Marton2018-12-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The crux of the issue that is being fixed is that lookup could not find previous decls of a friend class. The solution involves making the friend declarations visible in their decl context (i.e. adding them to the lookup table). Also, we simplify `VisitRecordDecl` greatly. This fix involves two other repairs (without these the unittests fail): (1) We could not handle the addition of injected class types properly when a redecl chain was involved, now this is fixed. (2) DeclContext::removeDecl failed if the lookup table in Vector form did not contain the to be removed element. This caused troubles in ASTImporter::ImportDeclContext. This is also fixed. Reviewers: a_sidorin, balazske, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D53655 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349349 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Add AST matcher for block expressions 🔍Stephane Moore2018-12-131-0/+8
| | | | | | | | | | | | | | | | | | Summary: This change adds a new AST matcher for block expressions. Test Notes: Ran the clang unit tests. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55546 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349004 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Store "UsesADL" information in CallExpr.Eric Fiselier2018-12-121-0/+22
| | | | | | | | | | | | | | | | | | | | | Summary: Currently the Clang AST doesn't store information about how the callee of a CallExpr was found. Specifically if it was found using ADL. However, this information is invaluable to tooling. Consider a tool which renames usages of a function. If the originally CallExpr was formed using ADL, then the tooling may need to additionally qualify the replacement. Without information about how the callee was found, the tooling is left scratching it's head. Additionally, we want to be able to match ADL calls as quickly as possible, which means avoiding computing the answer on the fly. This patch changes `CallExpr` to store whether it's callee was found using ADL. It does not change the size of any AST nodes. Reviewers: fowles, rsmith, klimek, shafik Reviewed By: rsmith Subscribers: aaron.ballman, riccibruno, calabrese, titus, cfe-commits Differential Revision: https://reviews.llvm.org/D55534 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348977 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop stripping comments from AST matcher example code.Aaron Ballman2018-12-111-71/+70
| | | | | | The AST matcher documentation dumping script was being a bit over-zealous about stripping comment markers, which ended up causing comments in example code to stop being comments. Fix that by only stripping comments at the start of a line, rather than removing any forward slash (which also impacts prose text). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348891 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert rL347462 "[ASTMatchers] Add hasSideEffect() matcher."Clement Courbet2018-11-221-18/+0
| | | | | | Breaks some buildbots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347463 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Add hasSideEffect() matcher.Clement Courbet2018-11-221-0/+18
| | | | | | | | | | | | Summary: Exposes Expr::HasSideEffects. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D54830 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347462 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Re-generate ast matchers doc after rL346455.Clement Courbet2018-11-221-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347453 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] overload ignoringParens for ExprJonas Toth2018-11-091-0/+11
| | | | | | | | | | | | | | | | Summary: This patch allows fixing PR39583. Reviewers: aaron.ballman, sbenza, klimek Reviewed By: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D54307 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346554 91177308-0d34-0410-b5e6-96231b3b80d8
* Update our URLs in clang doc to use httpsSylvestre Ledru2018-11-041-658/+658
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346101 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the isStaticLocal() AST matcher for matching on local static variables.Aaron Ballman2018-10-291-0/+12
| | | | | | Patch by Joe Ranieri. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345502 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove non-existant typeloc matchers from documentationStephen Kelly2018-10-091-107/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344023 91177308-0d34-0410-b5e6-96231b3b80d8
* Regenerate AST Matcher docsStephen Kelly2018-10-091-7/+29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344022 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Let isArrow also support UnresolvedMemberExpr, ↵Shuai Wang2018-09-171-0/+61
| | | | | | | | | | | | CXXDependentScopeMemberExpr Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52157 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342407 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] add three matchers for dependent expressionsJonas Toth2018-09-111-0/+40
| | | | | | | | | | | | | | | | | | | Summary: The new matchers can be used to check if an expression is type-, value- or instantiation-dependent in a templated context. These matchers are used in a clang-tidy check and generally useful as the problem of unresolved templates occurs more often in clang-tidy and they provide an easy way to check for this issue. Reviewers: aaron.ballman, alexfh, klimek Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51880 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341958 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Let hasObjectExpression also support UnresolvedMemberExpr, ↵Shuai Wang2018-08-231-0/+28
| | | | | | | | | | | | CXXDependentScopeMemberExpr Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50617 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340547 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Let hasAnyArgument also support CXXUnresolvedConstructExprShuai Wang2018-08-121-2/+21
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50605 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339530 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Add matchers unresolvedMemberExpr, cxxDependentScopeMemberExprShuai Wang2018-08-121-1/+26
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50606 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339522 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's ↵George Karpenkov2018-07-271-0/+30
| | | | | | | | | | | | | declaration. ObjCIvarExpr is *not* a subclass of MemberExpr, and a separate matcher is required to support it. Adding a hasDeclaration support as well, as it's not very useful without it. Differential Revision: https://reviews.llvm.org/D49701 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338137 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] fix the missing documentation for new decltypeType matcherJonas Toth2018-07-261-0/+25
| | | | | | | | | | | | | | Summary: Regenerate the Matchers documentation, forgotten in the original patch. Reviewers: alexfh, aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49850 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338022 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Add an isMain() matcherGeorge Karpenkov2018-07-231-0/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D49615 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337761 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] [NFC] Regenerate HTML docs.George Karpenkov2018-07-231-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337760 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Introduce Objective-C matchers `hasReceiver` and ↵George Karpenkov2018-07-161-0/+25
| | | | | | | | `isInstanceMessage` for ObjCMessageExpr Differential Revision: https://reviews.llvm.org/D49333 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337209 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] A matcher for Objective-C @autoreleasepoolGeorge Karpenkov2018-07-061-8/+66
| | | | | | Differential Revision: https://reviews.llvm.org/D48910 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336468 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Introduce a blockDecl matcher for matching block declarationsGeorge Karpenkov2018-05-161-4/+81
| | | | | | | | Blocks can be matched just as well as functions or Objective-C methods. Differential Revision: https://reviews.llvm.org/D46980 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332545 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Overload isConstexpr for ifStmtsGabor Horvath2018-05-081-2/+27
| | | | | | | Differential Revision: https://reviews.llvm.org/D46233 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331759 91177308-0d34-0410-b5e6-96231b3b80d8
* Regenerated AST Matchers doc.Alexander Kornienko2018-04-301-6/+8
| | | | | | Backported a minor fix to the comment in the header. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331207 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329399 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Introduce a matcher for matching any given Objective-C selectorGeorge Karpenkov2018-03-291-0/+11
| | | | | | | | Incudes a tiny related refactoring. Differential Revision: https://reviews.llvm.org/D44858 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328747 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Extend hasParameter and hasAnyParameter matches to handle ↵George Karpenkov2018-03-291-2/+58
| | | | | | | | Objective-C methods Differential Revision: https://reviews.llvm.org/D44707 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328746 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Add isAssignmentOperator matcherPeter Szecsi2018-03-271-0/+26
| | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328618 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Remove extra qualifier for consistency ↵Clement Courbet2018-03-211-1/+1
| | | | | | | | (LibASTMatchersReference.html) + Regenerate doc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328087 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Regenerate doc.Clement Courbet2018-03-211-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328086 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatcher] Extend hasAnyArgument to ObjCMessageExprGeorge Karpenkov2018-03-071-2/+33
| | | | | | | | | | | | | | | Currently hasArgument works with both ObjC messages and function calls, but not hasAnyArgument. This patch fixes that discrepancy, as it's often more convenient to use hasAnyArgument. On a more general note, it would be great to have a common superclass for objc-call and function call, and a matcher matching that, but that's probably a job for another commit. Differential Revision: https://reviews.llvm.org/D44169 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326865 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Regenerate documentation after r325678Eric Liu2018-02-211-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325682 91177308-0d34-0410-b5e6-96231b3b80d8
* Add hasTrailingReturn AST matcherJulie Hockett2018-01-221-0/+9
| | | | | | | | Adds AST matcher for a FunctionDecl that has a trailing return type. Differential Revision: https://reviews.llvm.org/D42273 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323158 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] [NFC] Fix code examplesFangrui Song2018-01-221-29/+31
| | | | | | | | Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42213 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323157 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatcher] Add isScoped matcher for enumDecl.Haojian Wu2018-01-181-0/+9
| | | | | | | | | | | | Summary: Reviewers: bkramer, aaron.ballman Subscribers: aaron.ballman, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D42185 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322826 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Add isNoReturn() match narrower for FunctionDeclarationsRoman Lebedev2018-01-171-0/+14
| | | | | | | | | | | | | | Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: dblaikie, klimek, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D41455 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322746 91177308-0d34-0410-b5e6-96231b3b80d8