summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a matcher for SubstNonTypeTemplateParmExpr.Alexander Kornienko2014-06-291-0/+11
| | | | | | | | | | | | Reviewers: klimek, djasper Reviewed By: djasper Subscribers: klimek, aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D4327 llvm-svn: 212001
* Remove llvm:: from uses of ArrayRef.Craig Topper2014-06-281-1/+1
| | | | llvm-svn: 211987
* Do not store duplicate parents when memoization data is available.Samuel Benzaquen2014-06-131-0/+21
| | | | | | | | | | | | | | Summary: Do not store duplicate parents when memoization data is available. This does not solve the duplication problem, but ameliorates it. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D4124 llvm-svn: 210902
* [C++11] Use 'nullptr'. Unittests edition.Craig Topper2014-06-083-17/+20
| | | | llvm-svn: 210423
* Add hasLocalStorage/hasGlobalStorage matchers.Samuel Benzaquen2014-06-051-0/+12
| | | | | | | | | | | | | | Summary: Add hasLocalStorage/hasGlobalStorage matchers for VarDecl nodes. Update the doc. Also add them to the dynamic registry. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D4034 llvm-svn: 210278
* Make equalsNode work with pointers to subtypes.Manuel Klimek2014-05-271-8/+16
| | | | llvm-svn: 209652
* Adds child traversal matchers for IfStmt's then and else branches.Manuel Klimek2014-05-271-0/+11
| | | | llvm-svn: 209649
* Allow hasBody on CXXForRangeStmt nodes and update the docs.Manuel Klimek2014-05-272-1/+3
| | | | llvm-svn: 209647
* Add the hasRangeInit() matcher for range-based for loop.Manuel Klimek2014-05-231-0/+3
| | | | llvm-svn: 209533
* [ASTMatchers] Move the 'isImplicit' matcher from CXXConstructorDecl to Decl.Joey Gouly2014-05-161-0/+3
| | | | llvm-svn: 209006
* Fix 3 test-only leaks found by LSan.Nico Weber2014-04-241-4/+6
| | | | llvm-svn: 207068
* Add support for named values in the parser.Samuel Benzaquen2014-04-143-14/+58
| | | | | | | | | | | | Summary: Add support for named values in the parser. Reviewers: pcc CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D3276 llvm-svn: 206176
* Revert "Add support for named values in the parser."Samuel Benzaquen2014-04-032-30/+0
| | | | | | | | This was submitted before it was ready. This reverts commit 62060a01e095cf35eb9ca42a333752d12714f35c. llvm-svn: 205533
* Add matcher for ExprWithCleanups.Samuel Benzaquen2014-04-021-0/+9
| | | | | | | | | | | | Summary: Add matcher for ExprWithCleanups. Reviewers: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D3248 llvm-svn: 205420
* Add support for named values in the parser.Samuel Benzaquen2014-04-022-0/+30
| | | | | | | | | | | | | | | | | | | | Summary: Add support for named values in the parser. This allows injection of arbitrary constants using a custom Sema object. Completions are not supported right now. Will be used by clang_query to support the 'let' command. Usage example: clang_query> let unique_ptr recordDecl(hasName("unique_ptr")) clang_query> match varDecl(hasType(unique_ptr)) Reviewers: klimek, pcc CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D3229 llvm-svn: 205419
* Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda ↵David Blaikie2014-04-021-1/+1
| | | | | | | | | | | | at ... )') For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. llvm-svn: 205398
* Use the new Windows environment for target detectionSaleem Abdulrasool2014-03-271-2/+3
| | | | | | | | | This follows the LLVM change to canonicalise the Windows target triple spellings. Rather than treating each Windows environment as a single entity, the environments are now modelled properly as an environment. This is a mechanical change to convert the triple use to reflect that change. llvm-svn: 204978
* Fixes a bug in DynTypedNode.Manuel Klimek2014-03-251-1/+32
| | | | | | | | Two DynTypedNodes can be equal if they do not have the same node type, because DynTypedNodes for the same underlying object might have been created from different types (for example, Decl vs VarDecl). llvm-svn: 204722
* Add loc() to the dynamic registry.Samuel Benzaquen2014-03-101-1/+20
| | | | | | | | | | | | | | | | | | Summary: Add loc() to the dynamic registry. Other fixes: - Fix the polymorphic variant value to accept an exact match, even if there are other possible conversions. - Fix specifiesTypeLoc() to not crash on an empty NestedNameSpecifierLoc. Reviewers: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2928 llvm-svn: 203467
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-073-9/+13
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Speculatively fix MSVC buildbotsDavid Majnemer2014-03-051-5/+9
| | | | llvm-svn: 202938
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-022-2/+2
| | | | llvm-svn: 202625
* ASTMatchers: added CXXMethodDecl matcher isPure()Dmitri Gribenko2014-02-241-0/+7
| | | | | | | | | | | | | The isPure() CXXMethodDecl matcher matches pure method declaration like "A::x" in this example: class A { virtual void x() = 0; } Patch by Konrad Kleine. llvm-svn: 202012
* Add TemplateSpecializationType polymorphism for hasTemplateArgument andPeter Collingbourne2014-02-201-0/+24
| | | | | | | | | | | hasAnyTemplateArgument, and (out of necessity) an isExpr matcher. Also updates the TemplateArgument doxygen to reflect reality for non-canonical template arguments. Differential Revision: http://llvm-reviews.chandlerc.com/D2810 llvm-svn: 201804
* clang/unittests/AST,ASTMatchers: Remove _MSC_VER.NAKAMURA Takumi2014-02-161-15/+18
| | | | llvm-svn: 201485
* Consistently print anonymous namespace names as "<anonymous namespace>"David Blaikie2014-02-141-1/+1
| | | | | | | | | | | For some reason we have two bits of code handling this printing: lib/AST/Decl.cpp: OS << "<anonymous namespace>"; lib/AST/TypePrinter.cpp: OS << "<anonymous namespace>::"; it would be nice if we only had one... llvm-svn: 201437
* Add isListInitialization matcher.Peter Collingbourne2014-02-061-0/+11
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2708 llvm-svn: 200949
* PR18128: a lambda capture-default is not permitted for a non-local lambdaRichard Smith2014-02-061-1/+1
| | | | | | expression. llvm-svn: 200948
* Added the hasLoopVariable sub-matcher for forRangeStmt.Alexander Kornienko2014-02-051-0/+5
| | | | | | | | | | | | | | | | | | | Summary: This sub-matcher makes it possible to access directly the range-based for loop variable: forRangeStmt(hasLoopVariable(anything()).bind(...)). I've tried to re-generate the docs, but the diffs seem to include much more than this change could cause, so I'd better leave docs update to someone who knows the intended changes in the contents better. Reviewers: klimek Reviewed By: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2702 llvm-svn: 200850
* Introduce Parser::completeExpression.Peter Collingbourne2014-01-301-0/+14
| | | | | | | | | This function returns a list of completions for a given expression and completion position. Differential Revision: http://llvm-reviews.chandlerc.com/D2261 llvm-svn: 200497
* Introduce Registry::getCompletions.Peter Collingbourne2014-01-231-0/+85
| | | | | | | | | | This returns a list of valid (and useful) completions for a context (a list of outer matchers), ordered by decreasing relevance then alphabetically. It will be used by the matcher parser to implement completion. Differential Revision: http://llvm-reviews.chandlerc.com/D2210 llvm-svn: 199950
* Fix string-literal to char* conversion in overload resolution for C++11Ismail Pazarbasi2014-01-171-2/+2
| | | | | | | | String literal to char* conversion is deprecated in C++03, and is removed in C++11. We still accept this conversion in C++11 mode as an extension, if we find it in the best viable function. llvm-svn: 199513
* DynamicASTMatchers/VariantValueTest.cpp: It works with msvcrt since ↵NAKAMURA Takumi2014-01-121-1/+1
| | | | | | setmode(stderr, O_BINARY) were removed. llvm-svn: 199059
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-072-6/+4
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* Fix 'declartion' typosAlp Toker2014-01-051-1/+1
| | | | llvm-svn: 198549
* [CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each ↵NAKAMURA Takumi2013-12-102-7/+17
| | | | | | CMakeLists.txt. llvm-svn: 196916
* Split registry matcher resolution into a lookup phase and a construction phase.Peter Collingbourne2013-11-232-13/+44
| | | | | | | | The looked-up matchers will be used during code completion. Differential Revision: http://llvm-reviews.chandlerc.com/D2207 llvm-svn: 195534
* Make the negative test more specific.Samuel Benzaquen2013-11-221-6/+6
| | | | | | | | | | | | | | Summary: Make the negative test more specific. Otherwise it can accidentally match injected code. Reviewers: aaron.ballman CC: klimek, cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D2257 llvm-svn: 195512
* Add support for the 'unless' matcher in the dynamic layer.Samuel Benzaquen2013-11-221-1/+22
| | | | | | | | | | | | Summary: Add support for the 'unless' matcher in the dynamic layer. Reviewers: klimek CC: cfe-commits, revane, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2247 llvm-svn: 195466
* Add partial support for the hasDeclaration() matcher in the dynamic layer.Samuel Benzaquen2013-11-181-0/+13
| | | | | | | | | | | | | | Summary: Add partial support for the hasDeclaration() matcher in the dynamic layer. This matcher has some special logic to allow any type that has a getDecl() method. We do not support this right now. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1889 llvm-svn: 195013
* Introduce MatchFinder::matchAST.Peter Collingbourne2013-11-072-0/+29
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2115 llvm-svn: 194223
* Re-introduce MatchFinder::addDynamicMatcher.Peter Collingbourne2013-11-072-2/+35
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2114 llvm-svn: 194222
* Introduce BoundNodes::getMap.Peter Collingbourne2013-11-061-0/+6
| | | | | | | | | The purpose of this function is to allow clients of the dynamic AST matcher to enumerate each binding. Differential Revision: http://llvm-reviews.chandlerc.com/D2095 llvm-svn: 194112
* Resubmit "Refactor DynTypedMatcher into a value type class, just like ↵Samuel Benzaquen2013-10-291-56/+19
| | | | | | | | | | | | | | Matcher<T>." Summary: This resubmits r193100, plus a fix for a breakage with MSVC. Reviewers: klimek, rnk CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D2005 llvm-svn: 193613
* Revert "Refactor DynTypedMatcher into a value type class, just like Matcher<T>."Reid Kleckner2013-10-211-19/+56
| | | | | | | | | This reverts commit r193100. It was failing to compile with MSVC 2012 while instantiating llvm::Optional<DynTypedMatcher>. llvm-svn: 193123
* Refactor DynTypedMatcher into a value type class, just like Matcher<T>.Samuel Benzaquen2013-10-211-56/+19
| | | | | | | | | | | | | | | | Summary: Refactor DynTypedMatcher into a value type class, just like Matcher<T>. This simplifies its usage and removes the virtual hierarchy from Matcher<T>. It also enables planned changes to replace MatcherInteface<T>. Too many instantiaions of this class hierarchy has been causing Registry.cpp.o to bloat in size and number of symbols. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1661 llvm-svn: 193100
* Teach RAV to visit parameter variable declarations of implicit functions. ↵Michael Han2013-09-111-1/+5
| | | | | | | | | | | | | | | Fixes PR16182. Normally RAV visits parameter variable declarations of a function by traversing the TypeLoc of the parameter declarations. However, for implicit functions, their parameters don't have any TypeLoc, because they are implicit. So for implicit functions, we visit their parameter variable declarations by traversing them through the function declaration, and visit them accordingly. Reviewed by Richard Smith and Manuel Klimek. llvm-svn: 190528
* Reduce the number of symbols by changing how templates are instantiated per ↵Samuel Benzaquen2013-08-301-16/+21
| | | | | | | | | | | | | | | | function bound in the registry. Summary: Reduce the number of symbols by changing how templates are instantiated per function bound in the registry. This change reduces the number of sections in Registry.cpp.o by a little over 10%. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1557 llvm-svn: 189676
* Fix tests to be more specific.Samuel Benzaquen2013-08-291-17/+13
| | | | | | | | | | | | | | | | | | The environments can inject some declaration in every translation unit, which can match very generic matchers, thus failing the tests. Summary: Fix tests to be more specific. The environments can inject some declaration in every translation unit, which can match very generic matchers, thus failing the tests. Reviewers: aaron.ballman CC: klimek, cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1541 llvm-svn: 189587
* Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.Samuel Benzaquen2013-08-282-2/+47
| | | | | | | | | | | | | | | Summary: Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer. These function require some late binding behavior for the type conversions, thus changes in VariadicValue's MatcherList. Second try. This time with a fix for C++11 builds. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1536 llvm-svn: 189500
OpenPOWER on IntegriCloud