summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-query/QueryParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix newline handling in clang-query parserStephen Kelly2019-12-291-1/+1
| | | | Don't prematurely remove characters from the end of the string
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-271-12/+42
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71842
* Revert "Allow newlines in AST Matchers in clang-query files" + 1Evgenii Stepanov2019-12-261-42/+12
| | | | | | | | | Revert "Fix -Wunused-lambda-capture warnings." This reverts commit 2369560f4a7720b19edfbf9de14ef061307ff773. This reverts commit 522ee29a4fb3814db604b585c8637247477ec057. clang/lib/ASTMatchers/Dynamic/Parser.cpp:610:13: warning: implicit conversion turns string literal into bool: 'const char [35]' to 'bool' [-Wstring-conversion] assert(!"Newline should never be found here");
* Fix -Wunused-lambda-capture warnings.Eric Christopher2019-12-261-1/+1
|
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-261-12/+42
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71842
* Revert "Allow newlines in AST Matchers in clang-query files"Stephen Kelly2019-12-261-42/+12
| | | | This reverts commit 6a3ecf4dc7ec299394e71b3124df2b3a34ed4ac3.
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-261-12/+42
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71842
* 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
* [Query] NFC: Port QueryParser to StringRefStephen Kelly2019-01-081-26/+17
| | | | | | | | | | | | | | Summary: There is no reason for it to not be a StringRef. Making it one simplifies existing code, and makes follow-up features easier. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56415 llvm-svn: 350660
* [clang-query] Add non-exclusive output APIStephen Kelly2018-10-291-6/+32
| | | | | | | | | | | | | | | | | | | | Summary: Add granular options for AST dumping, text printing and diagnostics. This makes it possible to * Have both diag and dump active at once * Extend the output with other queryable content in the future. Reviewers: aaron.ballman, pcc, ioeric, ilya-biryukov, klimek, sammccall Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52857 llvm-svn: 345522
* [clang-query] Refactor Output settings to booleansStephen Kelly2018-10-241-1/+11
| | | | | | | | | | | | Summary: This will make it possible to add non-exclusive mode output. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53501 llvm-svn: 345194
* [clang-query] Add 'detailed-ast' output as an alias for 'dump'Stephen Kelly2018-10-241-3/+5
| | | | | | | | | | | | Summary: Future development can then dump other content than AST. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53500 llvm-svn: 345193
* [clang-query] Add option to print matcher expressionStephen Kelly2018-10-201-8/+18
| | | | | | | | | | | | | | Summary: This is useful if using clang-query -f with a file containing multiple matchers. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52859 llvm-svn: 344840
* [clang-query] Add comment token handlingStephen Kelly2018-10-031-0/+8
| | | | | | | | | | | | | | | | | Summary: It is possible to pass a file of commands to clang-query using the command line option -f or --preload. Make it possible to write comments in such files. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D52752 llvm-svn: 343666
* [clang-query] Add single-letter 'q' alias for 'quit'Stephen Kelly2018-10-031-0/+1
| | | | | | | | | | | | Reviewers: aaron.ballman, pcc Reviewed By: aaron.ballman Subscribers: Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52746 llvm-svn: 343664
* [clang-query] Add missing 'l' command handlingStephen Kelly2018-10-011-0/+1
| | | | | | | | | | | | The `let` command was added in commit 045c15ba (Add new 'let' command to bind arbitrary values into constants., 2014-04-23). The `let` command and the non-existant `l` command were documented in commit 233092a0 (Add 'let' to the help message., 2015-02-27). Implement the `l` command now for completeness. llvm-svn: 343533
* [clang-query] Sort command optionsStephen Kelly2018-10-011-2/+2
| | | | llvm-svn: 343532
* Fix for LLVM r326109David Zarzycki2018-02-261-30/+24
| | | | llvm-svn: 326118
* modernize-use-auto NFC fixesPiotr Padlewski2016-12-141-3/+1
| | | | llvm-svn: 289656
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-12/+6
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* Add the "quit" command as a way to terminate clang-query interactive sessions.Aaron Ballman2015-08-061-0/+5
| | | | llvm-svn: 244206
* [clang-query] Use the new API for named values from the Parser.Samuel Benzaquen2014-08-121-18/+5
| | | | | | | | | | | | Summary: This finishes the support for autocomplete for user defined values.. Reviewers: pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4851 llvm-svn: 215474
* QueryParser::doParse(): Fix msc17 build. Don't use initializer list.NAKAMURA Takumi2014-04-231-1/+1
| | | | llvm-svn: 206998
* Add new 'let' command to bind arbitrary values into constants.Samuel Benzaquen2014-04-231-27/+83
| | | | | | | | | | | | | | Summary: Add new 'let' command to bind arbitrary values into constants. These constants can then be used in the matcher expressions. Reviewers: pcc CC: cfe-commits Differential Revision: http://reviews.llvm.org/D3383 llvm-svn: 206984
* [cleanup] Re-sort headers with llvm/utils/sort_includes.py.Chandler Carruth2014-03-041-1/+0
| | | | llvm-svn: 202809
* Add completion to the query parser, and hook it up to clang-query.Peter Collingbourne2014-02-011-38/+110
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2263 llvm-svn: 200604
* Run llvm/utils/sort_includes.py over the Clang tools code. This doesn'tChandler Carruth2014-01-071-2/+2
| | | | | | | | | | always produce as pretty of results as it does in LLVM and Clang, but I don't mind and the value of having a single canonical ordering is very high IMO. Let me know if you spot really serious problems here. llvm-svn: 198703
* Silence GCC warning.Peter Collingbourne2013-11-081-0/+2
| | | | llvm-svn: 194230
* Introduce clang-query tool.Peter Collingbourne2013-11-081-0/+165
This tool is for interactive exploration of the Clang AST using AST matchers. It currently allows the user to enter a matcher at an interactive prompt and view the resulting bindings as diagnostics, AST pretty prints or AST dumps. Example session: $ cat foo.c void foo(void) {} $ clang-query foo.c -- clang-query> match functionDecl() Match #1: foo.c:1:1: note: "root" binds here void foo(void) {} ^~~~~~~~~~~~~~~~~ 1 match. Differential Revision: http://llvm-reviews.chandlerc.com/D2098 llvm-svn: 194227
OpenPOWER on IntegriCloud