summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers/Dynamic
Commit message (Collapse)AuthorAgeFilesLines
...
* Add isDeleted() matcher for FunctionDecl nodes.Samuel Benzaquen2014-08-151-0/+1
| | | | | | | | | | Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D4911 llvm-svn: 215714
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-131-2/+2
| | | | | | Modifications made by clang-tidy with minor tweaks. llvm-svn: 215557
* Support named values in the autocomplete feature.Samuel Benzaquen2014-08-124-160/+224
| | | | | | | | | | | | | | | | | | | Summary: This includes: - Passing a Sema to completeExpression to allow for named values in the expression. - Passing a map of names to values to the parser. - Update the Sema interface to include completion for matchers. - Change the parser to use the Sema for completion, instead of going directly to Registry. Reviewers: pcc Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D3509 llvm-svn: 215472
* Remove llvm:: from uses of ArrayRef.Craig Topper2014-06-282-8/+8
| | | | llvm-svn: 211987
* Add hasLocalStorage/hasGlobalStorage matchers.Samuel Benzaquen2014-06-051-0/+2
| | | | | | | | | | | | | | 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
* [C++11] Use 'nullptr'. ASTMatchers edition.Craig Topper2014-05-173-7/+7
| | | | llvm-svn: 209070
* Add support for named values in the parser.Samuel Benzaquen2014-04-143-35/+69
| | | | | | | | | | | | 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-031-27/+21
| | | | | | | | This was submitted before it was ready. This reverts commit 62060a01e095cf35eb9ca42a333752d12714f35c. llvm-svn: 205533
* Add matcher for ExprWithCleanups.Samuel Benzaquen2014-04-021-0/+1
| | | | | | | | | | | | 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-021-21/+27
| | | | | | | | | | | | | | | | | | | | 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
* [C++11] Avoid implicit conversion of ArrayRef to std::vector and use move ↵Benjamin Kramer2014-03-102-10/+10
| | | | | | semantics where appropriate. llvm-svn: 203477
* Add loc() to the dynamic registry.Samuel Benzaquen2014-03-102-6/+17
| | | | | | | | | | | | | | | | | | 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
* [C++11] Use std::unique_ptr for ownership in a vector.Ahmed Charles2014-03-091-24/+14
| | | | | | Also change to using range-based for loops. No functional change intended. llvm-svn: 203396
* [C++11] Replace LLVM-style type traits with C++11 standard ones.Benjamin Kramer2014-03-071-1/+0
| | | | | | No functionality change. llvm-svn: 203241
* [C++11] Remove an LLVM_OVERRIDE use that I missed in my previous commit.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202630
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-3/+3
| | | | llvm-svn: 202625
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-261-2/+1
| | | | llvm-svn: 202238
* Add TemplateSpecializationType polymorphism for hasTemplateArgument andPeter Collingbourne2014-02-201-0/+1
| | | | | | | | | | | 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
* Add isListInitialization matcher.Peter Collingbourne2014-02-061-0/+1
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2708 llvm-svn: 200949
* clang/lib/ASTMatchers/Dynamic/CMakeLists.txt: redundantNAKAMURA Takumi2014-02-021-4/+0
| | | | llvm-svn: 200642
* Introduce Parser::completeExpression.Peter Collingbourne2014-01-301-33/+141
| | | | | | | | | 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
* Fix -Wreturn-type build failure on ASTMatchers, plus an intended assertAlp Toker2014-01-261-0/+1
| | | | llvm-svn: 200140
* Fix debug build.Peter Collingbourne2014-01-231-4/+4
| | | | llvm-svn: 199956
* Introduce Registry::getCompletions.Peter Collingbourne2014-01-232-98/+527
| | | | | | | | | | 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
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-074-9/+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
* [CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on ↵NAKAMURA Takumi2013-12-091-0/+2
| | | | | | | | target_link_libraries() and LLVM_LINK_COMPONENTS. I will prune redundant dependencies later. llvm-svn: 196800
* Another pass at adding missing matchers into the registry.Samuel Benzaquen2013-11-251-0/+15
| | | | | | | | | | | | Summary: Another pass at adding missing matchers into the registry. Reviewers: klimek CC: cfe-commits, revane, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2253 llvm-svn: 195647
* Rename *MatcherCreateCallback to *MatcherDescriptor, and its member run() to ↵Peter Collingbourne2013-11-232-70/+69
| | | | | | | | | | | create(). The new names will be more appropriate when the objects are taught to return type information for the code completer. Differential Revision: http://llvm-reviews.chandlerc.com/D2208 llvm-svn: 195539
* Split registry matcher resolution into a lookup phase and a construction phase.Peter Collingbourne2013-11-232-13/+32
| | | | | | | | The looked-up matchers will be used during code completion. Differential Revision: http://llvm-reviews.chandlerc.com/D2207 llvm-svn: 195534
* Add support for the 'unless' matcher in the dynamic layer.Samuel Benzaquen2013-11-222-7/+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-1/+1
| | | | | | | | | | | | | | 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
* Resubmit "Refactor DynTypedMatcher into a value type class, just like ↵Samuel Benzaquen2013-10-294-52/+41
| | | | | | | | | | | | | | 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-214-41/+52
| | | | | | | | | 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-214-52/+41
| | | | | | | | | | | | | | | | 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
* Reduce the number of symbols by changing how templates are instantiated per ↵Samuel Benzaquen2013-08-301-40/+41
| | | | | | | | | | | | | | | | 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
* Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.Samuel Benzaquen2013-08-283-19/+84
| | | | | | | | | | | | | | | 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
* Revert "Add support for eachOf/allOf/anyOf variadic matchers in the dynamic ↵Samuel Benzaquen2013-08-273-84/+19
| | | | | | | | | | | | | | | | | layer." Summary: This reverts commit 3b082a3c72324aa3363b5184731740534c6b9a2b. It breaks the build in c++11 mode. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1533 llvm-svn: 189368
* Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.Samuel Benzaquen2013-08-273-19/+84
| | | | | | | | | | | | | | 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. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1531 llvm-svn: 189362
* Refactor VariantMatcher to use an interface underneath.Samuel Benzaquen2013-08-221-49/+85
| | | | | | | | | | | | | | Summary: Refactor VariantMatcher to use an interface underneath. It supports "Single" and "Polymorphic". Will support more in the future. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1446 llvm-svn: 189032
* Refactor ArgumentAdaptativeMatcher matchers to remove the template from ↵Samuel Benzaquen2013-08-162-108/+100
| | | | | | | | | | | | | | | | their declaration. Summary: Refactor ArgumentAdaptativeMatcher matchers to remove the template from their declaration. This facilitates dynamic registration. Change the registry code to use the regular overload resolution mechanism for adaptative matchers. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1402 llvm-svn: 188560
* Add ctorInitializer to the dynamic AST Matcher registry.Stefanus Du Toit2013-08-151-0/+1
| | | | llvm-svn: 188439
* Refactor "MatcherList" into "VariantMatcher" and abstract the notion of a ↵Samuel Benzaquen2013-08-134-125/+151
| | | | | | | | | | | | | | | | list of matchers for the polymorphic case. Summary: Refactor "MatcherList" into "VariantMatcher" and abstract the notion of a list of matchers for the polymorphic case. This work is to support future changes needed for eachOf/allOf/anyOf matchers. We will add a new type on VariantMatcher. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1365 llvm-svn: 188272
* Add matcher for float literals.Daniel Jasper2013-07-261-0/+1
| | | | | | Patch by Chris Gray! Thanks! llvm-svn: 187232
* Add support for Adaptative matchers on the dynamic registry.Samuel Benzaquen2013-07-241-8/+65
| | | | | | | | | | | | | | Summary: Add support for Adaptative matchers on the dynamic registry. Each adaptative matcher is created with a function template. We instantiate the function N times, one for each possible From type and apply the techniques used on argument overloaded and polymorphic matchers to add them to the registry. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1201 llvm-svn: 187044
* Add support for overloaded matchers. ie different matcher function ↵Samuel Benzaquen2013-07-222-15/+109
| | | | | | | | | | | | | | | | signatures with the same name. Summary: Add support for overloaded matchers. This composes with other features, like supporting polymorphic matchers. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1188 llvm-svn: 186836
* Add support for raw_ostream on the printing methods of Diagnostics.Samuel Benzaquen2013-07-191-32/+42
| | | | | | | | | | | | | | Summary: Add printToStream*(llvm::raw_ostream&) methods to Diagnostics, and reimplement everything based on streams instead of concatenating strings. Also, fix some functions to start with lowercase to match the style guide. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1187 llvm-svn: 186715
* Separate the notion of 'context' when recursing down in the parser and ↵Samuel Benzaquen2013-07-184-59/+98
| | | | | | | | | | | | | | | | | actual errors. Summary: Change how error messages are constructed and stored in Diagnostics. Separate the notion of 'context' when recursing down in the parser and actual errors. This will simplify adding some new features, like argument overloading and error recovery. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1168 llvm-svn: 186602
* Add TemplateArgument related matchers to the registry.Samuel Benzaquen2013-07-171-4/+2
| | | | | | | | | | | | | | Summary: Continue adding more matchers to the dynamic registry. This time, we add TemplateArgument matchers. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1166 llvm-svn: 186514
* Add CXXCtorInitializer related matchers to the dynamic matcher registry.Samuel Benzaquen2013-07-171-6/+4
| | | | | | | | | | | | Summary: Now that CXXCtorInitializer is already supported in ASTNodeKind, add CXXCtorInitializer matchers to the dynamic matcher registry. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1158 llvm-svn: 186508
* Add support for type traversal matchers.Samuel Benzaquen2013-07-152-30/+20
| | | | | | | | | | | | | | | Summary: Fixup the type traversal macros/matchers to specify the supported types. Make the marshallers a little more generic to support any variadic function. Update the doc script. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1023 llvm-svn: 186340
OpenPOWER on IntegriCloud