summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-query
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-274-19/+68
| | | | | | | | | | 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-264-68/+19
| | | | | | | | | 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-264-19/+68
| | | | | | | | | | 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-264-68/+19
| | | | This reverts commit 6a3ecf4dc7ec299394e71b3124df2b3a34ed4ac3.
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-264-19/+68
| | | | | | | | | | 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
* 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
* [clang-tools-extra] [cmake] Link against libclang-cpp whenever possibleMichal Gorny2019-10-041-2/+5
| | | | | | | | | Use clang_target_link_libraries() in order to support linking against libclang-cpp instead of static libraries. Differential Revision: https://reviews.llvm.org/D68448 llvm-svn: 373786
* [clang-tools-extra] [cmake] Use add_clang_tool() to install toolsMichal Gorny2019-10-041-3/+1
| | | | | | | | | | | | Replace add_clang_executable() calls with add_clang_tool() that takes care of creating correct, distribution-friendly install target. While at it, remove redundant install calls. This change also causes clang-move and pp-trace to be installed. Differential Revision: https://reviews.llvm.org/D68423 llvm-svn: 373694
* Remove \brief commands from doxygen comments.Dmitri Gribenko2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: 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 [This is analogous to LLVM r331272 and CFE r331834] Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66578 llvm-svn: 369643
* gn build: Add build files for some clang-tools-extraNico Weber2019-03-201-1/+3
| | | | | | | | | Adds clang-change-namespace, clang-move, clang-query, clang-reorder-fields. Differential Revision: https://reviews.llvm.org/D59554 llvm-svn: 356567
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-196-24/+18
| | | | | | | | | | | | | | | | | 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 unnecessary include.Richard Trieu2019-01-101-1/+0
| | | | | | | QuerySession.h does not need anything from Query.h, so it does not need to include it. llvm-svn: 350797
* [Query] NFC: Port QueryParser to StringRefStephen Kelly2019-01-082-29/+19
| | | | | | | | | | | | | | 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
* Add explicit dependency on clangSerialization after rC348911Fangrui Song2018-12-122-0/+2
| | | | llvm-svn: 348916
* [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
* [clang-query] Add non-exclusive output APIStephen Kelly2018-10-294-7/+69
| | | | | | | | | | | | | | | | | | | | 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-244-11/+39
| | | | | | | | | | | | 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-243-6/+10
| | | | | | | | | | | | 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-204-11/+34
| | | | | | | | | | | | | | 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-032-1/+2
| | | | | | | | | | | | 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
* 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
* Fix for LLVM r326109David Zarzycki2018-02-262-31/+24
| | | | llvm-svn: 326118
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 llvm-svn: 319840
* [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-143-15/+6
| | | | llvm-svn: 289656
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-084-25/+13
| | | | | | | | | | | | | | | | 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
* [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
* Fix Clang-tidy modernize-deprecated-headers warnings; other minor fixes.Eugene Zelenko2016-03-171-2/+2
| | | | | | Differential revision: http://reviews.llvm.org/D18231 llvm-svn: 263726
* Remove autoconf supportChris Bieneman2016-01-262-55/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "Now I am become Death, the destroyer of worlds." -J. Robert Oppenheimer Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D16475 llvm-svn: 258864
* 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
* Install clang-query by default.Manuel Klimek2015-09-281-0/+2
| | | | | | | It is already installed by the autotools build, and it is useful for developers who are not working on LLVM/Clang itself. llvm-svn: 248710
* Add the "quit" command as a way to terminate clang-query interactive sessions.Aaron Ballman2015-08-065-2/+26
| | | | llvm-svn: 244206
* Add missing dependency clangFrontend to clangQuery.Adrian Prantl2015-06-201-0/+1
| | | | llvm-svn: 240227
* 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
* Revert "Adapt clang-tools-extra to clang module format changes."Adrian Prantl2015-02-251-3/+2
| | | | | | This reverts commit 230424. llvm-svn: 230456
* Adapt clang-tools-extra to clang module format changes.Adrian Prantl2015-02-251-2/+3
| | | | | | | - add clangCodeGen.a to the tools that need it - tweak pp-trace command line handling to not conflict with clang's. llvm-svn: 230424
* Revert "Adapt Makefile dependencies for the clang module format change in ↵Adrian Prantl2015-02-211-4/+2
| | | | | | r230089." llvm-svn: 230104
* Adapt Makefile dependencies for the clang module format change in r230089.Adrian Prantl2015-02-201-2/+4
| | | | llvm-svn: 230090
OpenPOWER on IntegriCloud