summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-query/Query.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-271-3/+18
| | | | | | | | | | 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-18/+3
| | | | | | | | | 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-3/+18
| | | | | | | | | | 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-18/+3
| | | | This reverts commit 6a3ecf4dc7ec299394e71b3124df2b3a34ed4ac3.
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-261-3/+18
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71842
* Use ASTDumper to dump the AST from clang-queryStephen Kelly2019-12-061-1/+6
| | | | | | | | | | | | | | | | | | | | Summary: This way, the output is not limited by the various API differences between the dump() member functions. For example, all dumps are now in color, while that used to be the case only for Decls and Stmts, but not Types. Additionally, while DynTypedNode::dump (which was used up to now) was limited to dumping only Decls, Stmts and Types, this makes clang-query support everything ASTNodeTraverser supports. Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62056
* 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] Add non-exclusive output APIStephen Kelly2018-10-291-0/+4
| | | | | | | | | | | | | | | | | | | | 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-8/+3
| | | | | | | | | | | | 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-2/+4
| | | | | | | | | | | | 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] Re-word command helpStephen Kelly2018-10-241-5/+11
| | | | | | | | | | | | | | | | Summary: This will make it possible to easily * Add new commands which accept <feature> parameters * Extend the list of features Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53498 llvm-svn: 345192
* [clang-query] Add option to print matcher expressionStephen Kelly2018-10-201-0/+8
| | | | | | | | | | | | | | 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 single-letter 'q' alias for 'quit'Stephen Kelly2018-10-031-1/+1
| | | | | | | | | | | | Reviewers: aaron.ballman, pcc Reviewed By: aaron.ballman Subscribers: Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52746 llvm-svn: 343664
* [NFC] Update to account for DiagnosticRenderer use of FullSourceLocPeter Smith2017-06-271-4/+4
| | | | | | | | | | | | | | D31709 [NFC] Refactor DiagnosticRenderer to use FullSourceLoc was committed in r305684 and reverted in 305688 as clang-tidy and clang-query failed to build. This change updates the extra tools to use the new interface. Reviewers: christof, rnk, rsmith, rovka, alexfh Reviewed By: alexfh Differential Revision: https://reviews.llvm.org/D34513 llvm-svn: 306385
* modernize-use-auto NFC fixesPiotr Padlewski2016-12-141-6/+3
| | | | llvm-svn: 289656
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-6/+5
| | | | | | | | | | | | | | | | 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
* Revert "Apply modernize-use-default to clang-tools-extra."David Blaikie2015-10-201-1/+1
| | | | | | | | | Breaks the build in GCC 4.7.2 (see http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3 for example) This reverts commit r250824. llvm-svn: 250862
* Apply modernize-use-default to clang-tools-extra.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13889 llvm-svn: 250824
* Add the "quit" command as a way to terminate clang-query interactive sessions.Aaron Ballman2015-08-061-1/+8
| | | | llvm-svn: 244206
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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 svn diff | clang-format-diff -i Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8927 llvm-svn: 234681
* Add 'let' to the help message.Samuel Benzaquen2015-02-271-4/+8
| | | | | | | | | | | | Summary: Add 'let' to the help message. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7940 llvm-svn: 230768
* Remove call to llvm::makeArrayRef. Implicit conversion is sufficient.Craig Topper2014-08-291-1/+1
| | | | llvm-svn: 216711
* Simplify creation of a couple ArrayRefs by using None and makeArrayRef.Craig Topper2014-08-271-2/+2
| | | | llvm-svn: 216529
* Slightly less blindly fixing clang-tools-extra now that I remember that the ↵David Blaikie2014-04-251-4/+1
| | | | | | "check-clang" target doesn't check clang-tools-extra llvm-svn: 207231
* Add new 'let' command to bind arbitrary values into constants.Samuel Benzaquen2014-04-231-1/+10
| | | | | | | | | | | | | | 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
* Revert r194247 conditional on non-MSVC.Peter Collingbourne2013-11-081-0/+5
| | | | | | | These definitions are required by the standard. MSVC rejecting them appears to be a bug. llvm-svn: 194252
* clang-query: Unbreak msvc.NAKAMURA Takumi2013-11-081-3/+0
| | | | llvm-svn: 194247
* Introduce clang-query tool.Peter Collingbourne2013-11-081-0/+131
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