summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Remove unused typedef as pointed out by a GCC warning.Benjamin Kramer2014-03-141-1/+0
| | | | | | Yay for auto. llvm-svn: 203912
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-4/+2
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-131-19/+19
| | | | | | class. llvm-svn: 203769
* [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] Simplify compare operators with std::tie.Benjamin Kramer2014-03-031-5/+2
| | | | | | No functionality change. llvm-svn: 202755
* [C++11] ASTMatchers: Use standard static_assert and type traits.Benjamin Kramer2014-03-021-2/+2
| | | | llvm-svn: 202653
* [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-262-4/+2
| | | | llvm-svn: 202238
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-211-10/+0
| | | | | | | | | | | | | | | | | | | introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. llvm-svn: 201842
* 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: Prune redundant dependencies.NAKAMURA Takumi2013-12-101-1/+0
| | | | llvm-svn: 196864
* [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-223-7/+42
| | | | | | | | | | | | 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
* Introduce MatchFinder::matchAST.Peter Collingbourne2013-11-071-12/+14
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2115 llvm-svn: 194223
* Re-introduce MatchFinder::addDynamicMatcher.Peter Collingbourne2013-11-071-0/+24
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2114 llvm-svn: 194222
* Resubmit "Refactor DynTypedMatcher into a value type class, just like ↵Samuel Benzaquen2013-10-296-104/+79
| | | | | | | | | | | | | | 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-216-79/+104
| | | | | | | | | 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-216-104/+79
| | | | | | | | | | | | | | | | 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
* Rewrite eachOf/allOf/anyOf to use a variadic operator.Samuel Benzaquen2013-08-271-0/+45
| | | | | | | | | | | | | | Summary: Rewrite eachOf/allOf/anyOf to use a variadic operator, instead of hand-written calls to Polymorphic matchers. This simplifies their definition and future changes to add them to the dynamic registry. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1427 llvm-svn: 189357
* 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
* Fix crash when encountering alias templates in isDerivedFrom matches.Manuel Klimek2013-08-021-43/+51
| | | | | | | | | - pull out function to drill to the CXXRecordDecl from the type, to allow recursive resolution - make the analysis more robust by rather skipping values we don't understand llvm-svn: 187676
* Add matcher for float literals.Daniel Jasper2013-07-261-0/+1
| | | | | | Patch by Chris Gray! Thanks! llvm-svn: 187232
* Use memoization for has()-matcher.Daniel Jasper2013-07-251-2/+4
| | | | | | | | | | | In TUs with large classes, a matcher like methodDecl(ofClass(recordDecl(has(varDecl())))) (finding all member functions of classes with static variables) becomes unbearably slow otherwise. llvm-svn: 187115
* 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
OpenPOWER on IntegriCloud