summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers/Dynamic/Registry.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Resubmit "Refactor DynTypedMatcher into a value type class, just like ↵Samuel Benzaquen2013-10-291-4/+4
| | | | | | | | | | | | | | 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-4/+4
| | | | | | | | | 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-4/+4
| | | | | | | | | | | | | | | | 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
* Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.Samuel Benzaquen2013-08-281-3/+3
| | | | | | | | | | | | | | | 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-271-3/+3
| | | | | | | | | | | | | | | | | 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-271-3/+3
| | | | | | | | | | | | | | 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 ArgumentAdaptativeMatcher matchers to remove the template from ↵Samuel Benzaquen2013-08-161-108/+8
| | | | | | | | | | | | | | | | 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-131-26/+26
| | | | | | | | | | | | | | | | 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-221-10/+66
| | | | | | | | | | | | | | | | 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
* Separate the notion of 'context' when recursing down in the parser and ↵Samuel Benzaquen2013-07-181-3/+2
| | | | | | | | | | | | | | | | | 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-151-7/+5
| | | | | | | | | | | | | | | 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
* Add support for polymorphic matchers. Use runtime type checking to determine ↵Samuel Benzaquen2013-06-211-32/+32
| | | | | | the right polymorphic overload to use. llvm-svn: 184558
* Parser/Registry argument enhancements.Samuel Benzaquen2013-06-041-4/+171
| | | | | | | | | | | | | | | Summary: Parser/Registry argument enhancements. - 2 argument support. - unsigned values support. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D915 llvm-svn: 183231
* Add support for .bind("foo") expressions on the dynamic matchers.Samuel Benzaquen2013-06-031-0/+17
| | | | | | | | | | | | Summary: Add support on the parser, registry, and DynTypedMatcher for binding IDs dynamically. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D911 llvm-svn: 183144
* Test commitSamuel Benzaquen2013-05-151-3/+3
| | | | llvm-svn: 181915
* First revision of the dynamic ASTMatcher library.Manuel Klimek2013-05-141-0/+153
This library supports all the features of the compile-time based ASTMatcher library, but allows the user to specify and construct the matchers at runtime. It contains the following modules: - A variant type, to be used by the matcher factory. - A registry, where the matchers are indexed by name and have a factory method with a generic signature. - A simple matcher expression parser, that can be used to convert a matcher expression string into actual matchers that can be used with the AST at runtime. Many features where omitted from this first revision to simplify this code review. The main ideas are still represented in this change and it already has support working use cases. Things that are missing: - Support for polymorphic matchers. These requires supporting code in the registry, the marshallers and the variant type. - Support for numbers, char and bool arguments to the matchers. This requires supporting code in the parser and the variant type. - A command line program putting everything together and providing an already functional tool. Patch by Samuel Benzaquen. llvm-svn: 181768
OpenPOWER on IntegriCloud