summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers/Dynamic/Marshallers.h
Commit message (Collapse)AuthorAgeFilesLines
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-7/+7
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* [ASTTypeTraits][ASTMatchers][OpenMP] OMPClause handlingRoman Lebedev2019-03-211-0/+23
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 356675
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-25/+25
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* Remove creation of out-of-bounds value of enumeration type (resulting in UB).Richard Smith2017-12-081-12/+10
| | | | | | | Also remove unnecessary initialization of out-parameters with this value, so that MSan is able to catch errors appropriately. llvm-svn: 320212
* [ASTMatchers] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-011-30/+72
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 317137
* [ASTMatchers] Add support for floatLiteralsPeter Wu2017-06-081-0/+10
| | | | | | | | | | | | | Summary: Needed to support something like "floatLiteral(equals(1.0))". The parser for floating point numbers is kept simple, so instead of ".1" you have to use "0.1". Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D33135 llvm-svn: 305021
* [ASTMatchers] Add support for boolean literalsPeter Wu2017-06-081-0/+10
| | | | | | | | | | | | | Summary: Recognize boolean literals for future extensions ("equals(true)"). Note that a specific VariantValue constructor is added to resolve ambiguity (like "Value = 5") between unsigned and bool. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D33093 llvm-svn: 305020
* [AST] Convert Marshallers to use unique_ptr.Justin Lebar2016-10-101-33/+36
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D25425 llvm-svn: 283773
* Add an AST matcher for CastExpr kindEtienne Bergeron2016-05-131-0/+22
| | | | | | | | | | | | | | Summary: This AST matcher will match a given CastExpr kind. It's an narrowing matcher on CastExpr. Reviewers: klimek, alexfh, sbenza, aaron.ballman Subscribers: Prazek, jroelofs, aaron.ballman, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D19871 llvm-svn: 269460
* [ASTMatchers] Add own version of VariadicFunction.Samuel Benzaquen2016-03-251-5/+6
| | | | | | | | | | | | | | | | Summary: llvm::VariadicFunction is only being used by ASTMatchers. Having our own copy here allows us to remove the other one from llvm/ADT. Also, we can extend the API to meet our needs without modifying the common implementation. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D18275 llvm-svn: 264417
* Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.Eugene Zelenko2016-01-261-9/+7
| | | | | | Differential revision: http://reviews.llvm.org/D16567 llvm-svn: 258836
* Roll-back r250822.Angel Garcia Gomez2015-10-201-2/+2
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-2/+2
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* SourceRanges are small and trivially copyable, don't them by reference.Craig Topper2015-10-041-11/+11
| | | | llvm-svn: 249259
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-24/+29
| | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
* Replace variadic operator function pointer with an enum value.Samuel Benzaquen2014-11-201-6/+6
| | | | | | | | | | | | | | | Summary: Replace variadic operator function pointer with an enum value. Hiding the implementation of the variadic matcher will allow to specialize them for the operation performed. In particular, it will allow for a more efficient allOf() matcher. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6293 llvm-svn: 222432
* Remove VariadicOperatorMatcherInterface as it is redundant with logic from ↵Samuel Benzaquen2014-11-171-1/+1
| | | | | | | | | | | | | | | | | | | DynTypedMatcher. Summary: The generic variadic matcher is faster (one less virtual function call per match) and doesn't require template instantiations which reduces compile time and binary size. Registry.cpp.o generates ~14% less symbols and compiles ~7.5% faster. The change also speeds up our clang-tidy benchmark by ~2%. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6278 llvm-svn: 222131
* Adds 'override' to overriding methods. NFC.Fariborz Jahanian2014-10-011-5/+5
| | | | | | These were uncoveredby my yet undelivered patch. llvm-svn: 218774
* Fix some cases where StringRef was being passed by const reference. Remove ↵Craig Topper2014-08-301-1/+1
| | | | | | const from some other StringRefs since its implicitly const already. llvm-svn: 216825
* Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor ↵Craig Topper2014-08-301-2/+2
| | | | | | and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. llvm-svn: 216824
* Add hasAttr matcher for declarations.Manuel Klimek2014-08-251-0/+21
| | | | | | | | Delete special-case CUDA attribute matchers. Patch by Jacques Pienaar. llvm-svn: 216379
* 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-121-49/+3
| | | | | | | | | | | | | | | | | | | 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-281-5/+5
| | | | llvm-svn: 211987
* [C++11] Use 'nullptr'. ASTMatchers edition.Craig Topper2014-05-171-2/+2
| | | | llvm-svn: 209070
* [C++11] Avoid implicit conversion of ArrayRef to std::vector and use move ↵Benjamin Kramer2014-03-101-2/+2
| | | | | | semantics where appropriate. llvm-svn: 203477
* [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
* 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-231-98/+378
| | | | | | | | | | 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-071-2/+1
| | | | | | | 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
* Rename *MatcherCreateCallback to *MatcherDescriptor, and its member run() to ↵Peter Collingbourne2013-11-231-63/+62
| | | | | | | | | | | 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
* Add support for the 'unless' matcher in the dynamic layer.Samuel Benzaquen2013-11-221-6/+21
| | | | | | | | | | | | 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
* Resubmit "Refactor DynTypedMatcher into a value type class, just like ↵Samuel Benzaquen2013-10-291-7/+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/+7
| | | | | | | | | 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-7/+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
* 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-281-0/+37
| | | | | | | | | | | | | | | 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-37/+0
| | | | | | | | | | | | | | | | | 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-0/+37
| | | | | | | | | | | | | | 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-0/+92
| | | | | | | | | | | | | | | | 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
* Refactor "MatcherList" into "VariantMatcher" and abstract the notion of a ↵Samuel Benzaquen2013-08-131-55/+60
| | | | | | | | | | | | | | | | 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
* Separate the notion of 'context' when recursing down in the parser and ↵Samuel Benzaquen2013-07-181-3/+3
| | | | | | | | | | | | | | | | | 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 support for type traversal matchers.Samuel Benzaquen2013-07-151-23/+15
| | | | | | | | | | | | | | | 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-42/+81
| | | | | | the right polymorphic overload to use. llvm-svn: 184558
* Enhancements for the DynTypedMatcher system.Samuel Benzaquen2013-06-201-7/+19
| | | | | | | | | - Added conversion routines and checks in Matcher<T> that take a DynTypedMatcher. - Added type information on the error messages for the marshallers. - Allows future work on Polymorphic/overloaded matchers. We should be able to disambiguate at runtime and choose the appropriate overload. llvm-svn: 184429
OpenPOWER on IntegriCloud