summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers/Dynamic/Diagnostics.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* [ASTMatchers] Add support for floatLiteralsPeter Wu2017-06-081-2/+2
| | | | | | | | | | | | | 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
* SourceRanges are small and trivially copyable, don't them by reference.Craig Topper2015-10-041-4/+4
| | | | llvm-svn: 249259
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-3/+3
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* Roll functions back into namespaces, msvc has problems with name lookup ↵Benjamin Kramer2015-03-091-4/+8
| | | | | | outside of it. llvm-svn: 231671
* Make helper functions static. NFC.Benjamin Kramer2015-03-091-13/+9
| | | | | | Found by -Wmissing-prototypes. llvm-svn: 231668
* Add support for named values in the parser.Samuel Benzaquen2014-04-141-1/+3
| | | | | | | | | | | | 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
* Add support for overloaded matchers. ie different matcher function ↵Samuel Benzaquen2013-07-221-5/+43
| | | | | | | | | | | | | | | | 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-181-22/+71
| | | | | | | | | | | | | | | | | 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 polymorphic matchers. Use runtime type checking to determine ↵Samuel Benzaquen2013-06-211-0/+2
| | | | | | the right polymorphic overload to use. llvm-svn: 184558
* Enhancements for the DynTypedMatcher system.Samuel Benzaquen2013-06-201-1/+1
| | | | | | | | | - 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
* Parser/Registry argument enhancements.Samuel Benzaquen2013-06-041-0/+2
| | | | | | | | | | | | | | | 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/+6
| | | | | | | | | | | | 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
* First revision of the dynamic ASTMatcher library.Manuel Klimek2013-05-141-0/+113
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