summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-query/tool/ClangQuery.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-271-4/+7
| | | | | | | | | | 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-7/+4
| | | | | | | | | 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");
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-261-4/+7
| | | | | | | | | | 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-7/+4
| | | | This reverts commit 6a3ecf4dc7ec299394e71b3124df2b3a34ed4ac3.
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-261-4/+7
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71842
* Revert "Use InitLLVM to setup a pretty stack printer"Nico Weber2019-11-251-2/+1
| | | | | | | This reverts commit 3f76260dc0674cc0acb25f550a0f0c594cf537ea. Breaks at least these tests on Windows: Clang :: Driver/clang-offload-bundler.c Clang :: Driver/clang-offload-wrapper.c
* Use InitLLVM to setup a pretty stack printerRui Ueyama2019-11-261-1/+2
| | | | | | | | | | | | | | InitLLVM does not only save a few lines from main() but also makes the commands do the right thing for multibyte character pathnames on Windows (i.e. canonicalize argv's to UTF-8) because of the code we have in this file: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Support/InitLLVM.cpp#L32 For many LLVM commands, we already have calls of InitLLVM, but there are still remainings. Differential Revision: https://reviews.llvm.org/D70702
* 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
* [clang-query] Continue if compilation command not found for some filesGeorge Karpenkov2018-12-051-2/+13
| | | | | | | | | | | | | | | | | When searching for a code pattern in an entire project with a compilation database it's tempting to run ``` clang-query **.cpp ``` And yet, that often breaks because some files are just not in the compilation database: tests, sample code, etc.. clang-query should not stop when encountering such cases. Differential Revision: https://reviews.llvm.org/D51183 llvm-svn: 348328
* Add preload option to clang-queryStephen Kelly2018-08-301-0/+15
| | | | | | | | | | Summary: This allows loading a file with pre-defined let commands for example. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51261 llvm-svn: 341145
* Extract runCommandsInFile methodStephen Kelly2018-08-301-12/+19
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51260 llvm-svn: 341144
* modernize-use-auto NFC fixesPiotr Padlewski2016-12-141-6/+2
| | | | llvm-svn: 289656
* [clang-query] Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-011-2/+2
| | | | | | | | | | Reviewers: pcc, dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26205 llvm-svn: 285731
* Update to match LLVM r272232.Richard Smith2016-06-091-1/+1
| | | | llvm-svn: 272235
* Add the "quit" command as a way to terminate clang-query interactive sessions.Aaron Ballman2015-08-061-0/+2
| | | | llvm-svn: 244206
* Use CommonOptionsParser in clang-query. This fixes its support of the fixedAlexander Kornienko2014-08-021-26/+11
| | | | | | | | | | | | | | compilation database and makes it behave consistently with other clang tools. Reviewers: klimek, pcc Reviewed By: pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4763 llvm-svn: 214607
* Fix clang-query on Windows: flush llvm::outs() after each command.Manuel Klimek2014-05-211-0/+1
| | | | llvm-svn: 209313
* Blindly try to fix the clang-tools-extra build since my local build doesn't ↵David Blaikie2014-04-251-3/+1
| | | | | | appear to be picking it up llvm-svn: 207230
* Add new 'let' command to bind arbitrary values into constants.Samuel Benzaquen2014-04-231-4/+6
| | | | | | | | | | | | | | 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
* [C++11] Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-091-3/+2
| | | | | | | | This removes all references to OwningPtr, which should be fairly undisruptive to out-of-tree projects since they are unlikely to use clang-tools-extra as a library instead of a set of tools. llvm-svn: 203382
* Add completion to the query parser, and hook it up to clang-query.Peter Collingbourne2014-02-011-3/+4
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2263 llvm-svn: 200604
* Switch clang-query to use the lineeditor library.Peter Collingbourne2014-02-011-28/+4
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2262 llvm-svn: 200603
* Run llvm/utils/sort_includes.py over the Clang tools code. This doesn'tChandler Carruth2014-01-071-4/+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
* Introduce clang-query tool.Peter Collingbourne2013-11-081-0/+158
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